agentleFS
bnaylorbnaylor/agent_skills/cve-remediation/SKILL.md

cve-remediation

Skill4 starsChanged 5 months agoMITView on GitHub

Remediate specific CVEs across the fleet — given a cve-report.py or CVE ID, determine which hosts need what fixes and execute them without re-scanning anything.

  • Deletes or force-pushes
  • Installs packages

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 1

    Distinctive

    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. Distinctive:

    Use to pick which CVE to tackle first.

    line 44
  2. Very specific:

    After remediation, suggest running the pipeline (or checking the next scheduled cron run) to confirm CVEs transition to resolved.

    line 137

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “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

CVE Remediation

This skill covers fixing known CVEs across the fleet. The scanning pipeline (cve-inventory-pipeline skill) already handles detection — never re-scan, re-SBOM, or re-run grype/syft. The findings are ground truth.

The Fleet

Host / ClusterTypePackage MgrAccess
diffuserVM (Ubuntu)aptSSH from agent host
minkVM (Ubuntu 25.04)aptSSH passwordless sudo ✓
nucularVM (Ubuntu 22.04)aptSSH passwordless sudo ✓
luthenVM (Ubuntu) + k8saptSSH needs key setup
grades.fsvo.orgVM (Ubuntu)aptSSH needs key setup
noc (kates, nuclhed, nucular)MicroK8s clustercontainer imagesmicrok8s from nucular
gradesMicroK8s clustercontainer imagesmicrok8s from assigned node
luthen k8sK3s / k8s clustercontainer imagesSSH to luthen + kubectl

Input Formats

The user will provide remediation context in one of these forms:

1. CVE ID only

"fix CVE-2026-27143" — Run cve-report.py first to get the full picture:

cd <cve_inventory_repo> && python3 scripts/cve-report.py CVE-2026-27143 --gemini

2. cve-report.py output (--gemini mode preferred)

The structured report tells you exactly which hosts, which packages, current → fix versions, and whether fixes are available. This is the canonical input format.

3. --list or --top N output

Use to pick which CVE to tackle first. Action priority score = severity × host count × fixable bonus.

Fix Patterns by Finding Type

🏠 Host-level packages (apt)

These show image: "" or (host packages) in the report. Fix on the VM directly.

# Fix a specific package
ssh <host> "sudo apt update && sudo apt install --only-upgrade -y <package>=<version>"

# Fix without pinning version (let apt figure it out)
ssh <host> "sudo apt update && sudo apt upgrade -y <package>"

# If the package name includes version info (e.g. "libssl1.1"),
# just the base package name usually works: "sudo apt install libssl"

Pitfall — version pinning: Some CVEs show multiple fix versions (e.g. 1.23.8, 1.24.2). Pick the highest. If apt can't find that exact version, try apt list --upgradable <package> to see what's available.

Pitfall — Go stdlib on hosts: Go stdlib CVEs show as stdlib goX.Y.Z on host SBOMs. These come from installed Go toolchains. Fix by removing old Go versions or upgrading the Go package.

📦 Container images

These show a container image name in the report. Fix by updating the image tag.

# For MicroK8s clusters — edit the deployment image tag and let k8s roll it out
microk8s kubectl set image deployment/<name> <container>=<new-image>:<tag> -n <namespace>
# or edit the manifest and kubectl apply

# For containers managed outside k8s (docker-compose, etc.)
# Update the tag in the compose file and docker compose up -d

Pitfall — image tag pinning: Most images use pinned tags (:v1.2.3) not :latest. You need to know the new tag. Check the image registry or update to a patch version.

🦫 Go stdlib (special case)

Go stdlib CVEs (CVE-2026-27143, CVE-2025-22871, CVE-2026-39820, etc.) are the most common Critical CVEs in the fleet. The finding shows stdlib goX.Y.Z → 1.25.10, 1.26.3.

On VMs: The Go toolchain package needs upgrading:

ssh <host> "sudo apt update && sudo apt install --only-upgrade -y golang-go"
# Or for specific Go version packages
ssh <host> "sudo snap install go --classic"  # if installed via snap
ssh <host> "sudo rm -rf /usr/local/go && wget https://go.dev/dl/go1.26.3.linux-amd64.tar.gz && sudo tar -C /usr/local -xzf go1.26.3.linux-amd64.tar.gz"

In container images: The Go version used during the image build is baked in. Rebuild the image with a newer Go toolchain and redeploy.

In Go projects (go binaries): Any Go binary compiled with an old Go version embeds the old stdlib. Recompile with newer Go.

📚 Go modules (google.golang.org/grpc, etc.)

Go library CVEs like GHSA-p77j-4mvh-x3m3 (grpc) need the go.mod updated and the project rebuilt:

# In the project directory
go get google.golang.org/grpc@v1.79.3
go mod tidy
go build ./...

What NOT To Do (Guardrails)

🚫 Do NOT run syft, grype, or osv-scanner. The pipeline already does this. The findings.json is the source of truth.

🚫 Do NOT generate new SBOMs. The SBOMs in the inventory directory are the pipeline's input — don't touch them.

🚫 Do NOT modify findings.json. It's managed by the pipeline's merge/diff logic.

🚫 Do NOT re-invent the pipeline. If you need fresh data, ask the user to trigger a pipeline run, or use cve-report.py from the existing findings.

Workflow

1. User provides CVE ID or report output
2. If CVE ID only → run python3 cve-report.py CVE-XXXX --gemini to get the full picture
3. Parse the report:
   - Identify which hosts have findings
   - Check if findings are host-level (apt) or container images
   - Note Go stdlib vs Go module vs regular packages
4. For each host:
   a. SSH in (or use k8s context for containers)
   b. Determine current state (apt list --upgradable, go version, etc.)
   c. Apply fixes per patterns above
   d. Verify fix (re-run apt list or equivalent)
5. Report back:
   - What was fixed on each host
   - Any findings that couldn't be fixed (no fix available, etc.)
   - Suggest running the pipeline to confirm resolution

Verification

After remediation, suggest running the pipeline (or checking the next scheduled cron run) to confirm CVEs transition to resolved.

The pipeline's state machine keys on (vuln_id, host, image, component, version) — if the component version changed, the old finding drops from the next scan and gets classified as resolved in the Discord alert.

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.