agentleFS
ykotikykotik/cli-power-skills/skills/security-scanning/SKILL.md

security-scanning

Skill1 starsChanged 7 months agoMITView on GitHub

Use when checking code for vulnerabilities, linting shell scripts, scanning containers or IaC for security issues, or managing encrypted secrets

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Prefer Trivy over manual npm audit / pip audit — scans all ecosystems in one pass

    line 116
  2. Distinctive:

    Prefer ShellCheck over manual review for shell scripts — catches subtle quoting, globbing, and portability bugs

    line 117
  3. Distinctive:

    Prefer sops over storing plaintext secrets — encryption at rest with version control compatibility

    line 118

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Security Scanning

When to Use

  • Scanning a project directory for known vulnerabilities (CVEs)
  • Scanning a container image before deployment
  • Scanning Infrastructure-as-Code (Terraform, CloudFormation) for misconfigurations
  • Linting shell scripts for bugs, pitfalls, and unsafe patterns
  • Encrypting or decrypting secrets stored in YAML/JSON config files
  • Checking dependencies for known security issues

Tools

ToolPurposeStructured output
TrivyVulnerability scanner for filesystems, containers, IaC--format json or --format sarif
ShellCheckStatic analysis and linting for shell scripts-f json for JSON output
sopsEncrypt/decrypt secrets in YAML, JSON, ENV filesOutputs decrypted file to stdout

Patterns

Scan project directory for vulnerabilities

trivy fs --format json --output results.json .

Scan project and show results in terminal

trivy fs --severity HIGH,CRITICAL .

Scan a container image

trivy image --format json --output scan.json nginx:latest

Scan Terraform files for misconfigurations

trivy config --format json .

Scan a lockfile (package-lock.json, requirements.txt, etc.)

trivy fs --scanners vuln --format json package-lock.json

Generate SARIF report for CI integration

trivy fs --format sarif --output report.sarif .

Lint a shell script with JSON output

shellcheck -f json script.sh

Lint all shell scripts in a directory

shellcheck -f json *.sh scripts/*.sh

Lint with specific severity threshold

shellcheck -S warning -f json script.sh

Encrypt a secrets file with sops (using age key)

sops --encrypt --age $(cat ~/.config/sops/age/keys.txt | grep "public key:" | awk '{print $NF}') secrets.yaml > secrets.enc.yaml

Decrypt a secrets file to stdout

sops --decrypt secrets.enc.yaml

Edit encrypted file in-place

sops secrets.enc.yaml

Decrypt a single value

sops --decrypt --extract '["database"]["password"]' secrets.enc.yaml

Pipelines

Scan and summarize critical findings

trivy fs --format json . | jq '[.Results[] | .Vulnerabilities[]? | select(.Severity == "CRITICAL") | {id: .VulnerabilityID, pkg: .PkgName, title: .Title}]'

Each stage: Trivy scans and outputs JSON, jq filters to critical vulnerabilities and extracts key fields.

Lint all shell scripts and count issues by severity

shellcheck -f json scripts/*.sh | jq 'group_by(.level) | map({level: .[0].level, count: length})'

Each stage: ShellCheck lints all scripts to JSON, jq groups and counts by severity level.

Scan image and fail if critical vulns found

trivy image --format json myapp:latest | jq -e '[.Results[] | .Vulnerabilities[]? | select(.Severity == "CRITICAL")] | length == 0'

Each stage: Trivy scans image, jq checks for critical vulns and exits non-zero if any found.

Prefer Over

  • Prefer Trivy over manual npm audit / pip audit — scans all ecosystems in one pass
  • Prefer ShellCheck over manual review for shell scripts — catches subtle quoting, globbing, and portability bugs
  • Prefer sops over storing plaintext secrets — encryption at rest with version control compatibility

Do NOT Use When

  • Reviewing business logic or application design flaws — these tools find known CVEs and script bugs, not logic errors
  • Linting Python code — use Ruff (python-tooling skill) instead
  • Linting JavaScript/TypeScript — use ESLint or Biome directly
  • Managing runtime secrets (use Vault or environment variables for that)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.