agentleFS
onur-yuksekkayaonur-yuksekkaya/cve-delta/skills/scan/SKILL.md

scan

Skill4 starsChanged 4 days agoMITView on GitHub

Scan an Ubuntu server (local or over SSH) for CVEs that actually affect it. Collects the real package inventory (dpkg, Docker images, running services, listening ports), matches it with distro-aware advisory data, ranks findings by exploitation (CISA KEV, EPSS) and exposure, catches patches waiting for a reboot, and writes a report that opens with an action list and what changed since the last scan. Read-only: never runs a fix on its own.

39 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use coverage, metrics and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • PydanticSkill

    coverage

    Fetch coverage diff from Codecov for the current branch or a specific PR. Shows uncovered lines, patch coverage, and overall coverage change.

    Also in 4 projects that use this

  • GoogleSkill

    metrics

    Expertise in analyzing time-series repository health metrics, investigating root causes, and proposing proactive workflow improvements.

    Also in 3 projects that use this

  • MicrosoftSkill

    report

    Turn an exploration (threads, findings, charts) into a single Markdown report — note, blog post, executive summary, KPI dashboard, slide brief, or multi-section analytical report, with embedded charts.

    Also in 5 projects that use this

  • anombyte93Skill

    discover

    Phase 1 of the prd-taskmaster pipeline: brainstorm-driven discovery. Delegates to superpowers:brainstorming in Interactive Mode (one adaptive question at a time), or self-brainstorms in Autonomous Mode when no user is present. Intercepts before the brainstorming chain hands off to writing-plans — this skill owns the exit. Extracts constraints, calibrates scale (Solo / Team / Enterprise), and advances the pipeline to GENERATE.

    Also in 3 projects that use this

  • tuistSkill

    migrate

    Migrates existing Xcode projects to Tuist generated workspaces with build and run validation, external dependency mapping, and migration checklists. Use when adopting Tuist for an existing app or converting a hand-edited Xcode project to generated projects.

    Also in 3 projects that use this

  • Google CloudSkill

    fix

    Plan a remediation strategy after a test failure.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

7 rules. 0 are common, 5 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 34 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Ask before connecting: if the user didn't name the target.

    line 21
  2. Distinctive:

    Run this one command. It is read-only on the target.

    line 40
  3. Very specific:

    Don't run the individual scripts yourself, and don't wrap the command in mkdir, &&, variables or redirects: a single plain command is what …

    line 47
  4. Distinctive:

    Other Do now items that rest on an exposure label: verify with one targeted command.

    line 125
  5. Very specific:

    Failed services: read their recent log (journalctl -u <unit> -n 20) and say what is wrong.

    line 126
  6. Distinctive:

    Expired certificates: check whether the web server still uses them and whether DNS still points anywhere.

    line 131
  7. Distinctive:

    Don't paste the whole report.

    line 138

“Common” is measured: kept by at least 6 in 10 of the 34 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-delta scan

Supports Ubuntu 22.04 and 24.04. Debian 12 is experimental.

Your job is to turn "the scanner found 800 CVEs" into "do these 3 things today, run one apt upgrade for the rest, and ignore these, here is why". Every run, including the first, must end with a short, ranked, actionable report.

Rules

  • Read-only. Inventory and analysis only. Never run upgrades, restarts, or config changes. Fix commands go into the report for the user to run.
  • Ask before connecting if the user didn't name the target. The scan command isn't pre-approved on purpose, so the user also approves it once with the target visible.
  • Deterministic matching. Decide "affected or not" from advisory data (OSV, distro security trackers), never from web search results. Web search may add context to a finding that has already been matched.
  • Distro-aware versions. Debian and Ubuntu backport fixes into old upstream versions. Compare against the distro's fixed version (1.2.3-4+deb12u2), not NVD's upstream range.
  • No secrets in output. The inventory never includes environment variables, file contents, or process arguments.

Steps

1. Confirm the target

The target is $ARGUMENTS, or the local machine (local) if empty. If the user named it in this request, that's your confirmation. Otherwise ask before connecting.

2. Scan

Run this one command. It is read-only on the target. Always run it in the background: a first scan takes a few minutes while advisory data is cached, and later ones are faster. Tell the user that, and wait for it to finish.

bash ${CLAUDE_SKILL_DIR}/scripts/scan.sh <target> --data ${CLAUDE_PLUGIN_DATA}

Don't run the individual scripts yourself, and don't wrap the command in mkdir, &&, variables or redirects: a single plain command is what the user can approve once and trust. It writes cve-report-<target>-<date>.md in the current directory, and intermediate files under ${CLAUDE_PLUGIN_DATA}/hosts/<target>/, including a small snapshot per scan under history/. From the second scan of a host on, the report opens with "Since the last scan". Its last lines give the report's path and verdict. If it says the host is unsupported (it covers Ubuntu, and Debian experimentally), tell the user and stop.

What it does:

  1. Inventory (collect_inventory.sh): packages, services, ports, reboot state, automatic updates, certificates, failed services.
  2. Match (match_osv.py): OSV with the distro's own ecosystem and source package versions, so backported fixes count as fixed. Only the running kernel is matched. Packages from other archives (Docker, NodeSource) are compared with the vendor's latest version instead.
  3. Enrich (enrich.py): CISA KEV, EPSS and, for kernel CVEs, the source files each fix touches.
  4. Exposure (probe_exposure.sh, exposure.py): which running processes load each package, whether they listen publicly, and which kernel modules are active. Needs passwordless sudo or root to see other users' processes. Without it, user-space exposure is unknown.
  5. Containers (collect_containers.sh, match_containers.py): reads package databases with docker cp, without running anything in a container, one per distinct image. Covers OS and npm packages, runtimes past end of life, each container's exposure (public, proxied through nginx, host-network, internal) and root-level settings (Docker socket, privileged). It can't see Python packages or binaries installed outside a package manager (Node and Postgres in official images), and a package in an image may not be loaded.
  6. Report (report.py): the same scan always gives the same report.

fix_state per finding:

fix_stateMeaning
pending-rebootThe fixed kernel is installed but not running. A reboot closes it.
availableApt can install the fix now.
publishedFixed in the archive, but the host's apt cache doesn't show it yet.
noneNo fix published.

The JSON files are large. Never load them into context whole. Summarize with python3 -I -c or jq. Container findings are in container-enriched.json, with image, kind (os or npm), dev and malicious. Their severity is in advisory_rating or cvss_rating instead of distro_priority.

exposure.status per host finding:

StatusMeaningCaveat
publicLoaded by a process listening on a non-loopback address (public_via)The vulnerable code path may still be unused (e.g. libtiff in nginx without image_filter).
local-serviceLoaded by a process listening on loopback onlyReachable from anything already on the host or in a container.
in-useLoaded by a running process without sockets
not-in-useNo running host process loads it; required_by says why it is installedCLI tools (rsync, binutils) can still be run on demand.
module-loaded / coreThe kernel code is active
module-idleFilesystem module loaded, but nothing of that type is mountedReachable only by mounting, which needs privileges.
module-not-loadedModule present, not loaded, not autoloadedSome modules autoload on demand for local users (unprivileged user namespaces). Lower priority for remote attackers only.
module-blockedBlacklisted in /etc/modprobe.d
unverifiedKernel code no module claims, outside core directoriesMay be built in or not compiled at all. Counts as reachable. Report it separately from core.
not-applicableOnly touches another architecture, arch-only drivers, or userspace tools (tools/)
unknownNot determinedCounts as reachable. Say that it is unknown.

Container processes don't count here: their packages are inside the image, and step 5 covers those.

3. Read and check the report

The script decides the actions, so the same scan always gives the same report. It opens with a one-line verdict and a checklist (Do now, This week, When convenient, Optional) with exact commands, then Watch out, the numbers, the most important findings, what is safe to set aside, and coverage.

Rules it applies:

LevelRule
Do nowReachable and in KEV or EPSS ≥ 0.5 (with or without a patch). A reboot that closes such a CVE, or a critical/high one in active code. A database on a public port. A certificate expiring within 2 weeks. An exposed container with root-level access (Docker socket, privileged). An exposed container with a KEV CVE or a high-EPSS npm package, or any container with a known malicious package.
This weekUpdates that close reachable high/critical CVEs or EPSS ≥ 0.1. Any other pending reboot. Packages from other archives that are behind and in use. Expired certificates. Automatic updates turned off. Containers: exposed with a fixable critical/high CVE or a runtime past end of life; any with a fixable KEV or EPSS ≥ 0.5 CVE; a non-exposed container with root-level access.
When convenientRoutine updates. Other container rebuilds.
OptionalRemoving unused packages or blacklisting unused modules that carry high-EPSS CVEs without a patch. Old kernels.

Then:

  1. Check it on the host before showing it, with read-only commands. The report file stays as the script wrote it. Put what you find in your reply, under "Checked on the host":
    • Reboot in Do now: confirm with uname -r and ls /boot.
    • Other Do now items that rest on an exposure label: verify with one targeted command.
    • Failed services: read their recent log (journalctl -u <unit> -n 20) and say what is wrong. A failing certificate renewal, for example, matters more than most CVEs.
    • Public ports: try each from outside if you can (nc -z <ip> <port>, with the IP from ssh -G <target> | awk '/^hostname /{print $2}'). A provider firewall may already block them. That's one TCP connect to the user's own server: never try logging in.
    • Expired certificates: check whether the web server still uses them and whether DNS still points anywhere. Unused ones get deleted, not renewed.
    • Rebuild items: they assume the project's source is on this server. Say so if it isn't.
  2. If the user writes in another language, save a translation next to the report as cve-report-<target>-<date>.<language>.md. Keep commands, CVE ids and package names exactly as they are.
  3. In your reply, give the verdict, what changed since the last scan (if the report has it), the "Do now" list and what you checked, plus the path to the file. Don't paste the whole report.
  4. Never run the commands yourself unless the user explicitly asks, one action at a time.

The report maps this host's weaknesses. Don't publish it or commit it.

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.