/linux:linux-benchmark-scanningfrom linux
Runs read-only OpenSCAP and Lynis compliance scans on Debian/Ubuntu and RHEL-family hosts. Helps select distro-matched profiles, interpret failures, and draft remediation.
Ships in linux. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Two-family skill. OpenSCAP (oscap) and Lynis run on both families;
the difference is which SCAP Security Guide (SSG) datastream you point
oscap at — there is one per distro and major version. On the RHEL family
SSG is first-class (scap-security-guide, openscap-scanner); on
Debian/Ubuntu the packages exist but profile coverage is thinner, so Lynis
often does more of the work. Body uses the RHEL family for OpenSCAP (where
coverage is strongest) and is family-neutral for Lynis. Substitute per this
matrix.
| Concept | Debian/Ubuntu | RHEL family |
|---|---|---|
| OpenSCAP scanner | apt install openscap-scanner ssg-debderived | dnf install openscap-scanner scap-security-guide |
| SSG datastream dir | /usr/share/xml/scap/ssg/content/ | /usr/share/xml/scap/ssg/content/ |
| Datastream file | ssg-ubuntu2204-ds.xml (version-specific) | ssg-rhel9-ds.xml (version-specific) |
| List profiles | oscap info <ds.xml> | oscap info <ds.xml> (same) |
| Lynis | apt install lynis | dnf install lynis (EPEL on RHEL/Rocky/Alma) |
| Lynis run | lynis audit system | lynis audit system (same) |
OpenSCAP gives you policy compliance against a formal benchmark (CIS,
STIG, PCI-DSS) with pass/fail per rule and auto-generated remediation. Lynis
gives you a fast, opinion-rich hardening sweep with a numeric index and
prioritized suggestions — no formal benchmark, but excellent at surfacing
operational weaknesses (file perms, kernel params, missing tooling). Run
both: OpenSCAP for the audit trail, Lynis for the quick wins. They complement
the other two compliance layers — linux-auditd-rules (attribution) and
linux-file-integrity (drift). See
../../docs/multi-distro/plan.md.
linux-auditd-rules.linux-file-integrity.linux-server-hardening.| Artefact | Source | Required? | If absent |
|---|---|---|---|
| Exact distro/version, role, scope, and benchmark/profile requirement | Inventory and control owner | yes | Stop profile selection; do not scan against a guessed datastream. |
| Scanner/content versions, profile ID, tailoring, and exceptions | Read-only package/content inspection | yes | Report coverage unavailable or run Lynis as a qualified secondary check. |
| Remediation authority, test host, rollback, and service constraints | Change record | remediation only | Generate a draft only; do not apply. |
Default to read-only: read/search installed content and run scans that do not remediate. Package installation, generated-script execution, Ansible application, service changes, and any --remediate action require explicit authority and a test host. A report is not certification.
If matching SCAP content/profile is unavailable, do not substitute a different distro/version. Return a coverage gap and optionally a read-only Lynis result. Unassessed rules remain unassessed, never passed; generated remediation remains an unexecuted draft.
| Choice | Action | Failure or risk avoided |
|---|---|---|
| OpenSCAP or Lynis | Use OpenSCAP for named policy evidence; Lynis for advisory hardening breadth. | Treating an advisory score as compliance. |
| Datastream/profile | Match exact distro major version and list profile IDs before evaluation. | Invalid or misleading results. |
| Tailoring/exception | Record business justification and expiry without rewriting raw results. | Hidden control waiver. |
| Remediation | Review generated changes, test with rollback, then rescan before production proposal. | Breaking services or claiming unverified compliance. |
results.xml for the audit trail, not just the HTML report.--remediate to production. Fix: generate, review, test, rollback-test, and rescan before proposing production change.| Artefact | Consumer | Acceptance condition |
|---|---|---|
| Scan evidence set | Control owner | Exact content/profile/tailoring, command, XML, human report, timestamp, and host identity are preserved. |
| Qualified findings summary | System owner | Separates pass/fail/error/not-checked/exceptions, prioritises failures, and states coverage limits. |
| Remediation draft/rescan | Change owner | Every change is reviewed/tested with rollback and identical-profile rescan, or remains clearly unexecuted. |
| Artefact | Acceptance |
|---|---|
| Compliance scan pack | Contains scanner/content versions, datastream/profile, raw XML, report, status counts, exceptions, errors, Lynis separation, and pre/post evidence where authorised. |
On RHEL 9, confirm ssg-rhel9-ds.xml, list the exact profile, run a read-only evaluation, preserve XML and HTML, and report errors separately. Generate remediation only as a draft unless a test-host change is explicitly authorised.
../../docs/continuous-improvement/linux-product-audit-checklist.md
references/openscap-reference.md — install SSG, list profiles, evaluate against CIS/STIG/PCI-DSS, generate HTML reports and remediation (bash + Ansible), and pick datastreams per distro.
references/lynis-reference.md — install, lynis audit system, reading the hardening index, prioritizing suggestions, and CI/cron usage.
../linux-auditd-rules/references/auditd-reference.md — applying SSG/CIS audit rulesets via auditd (the rule layer behind a benchmark).
This skill is self-contained. Every command below is standard oscap or
lynis on its family (see Distro support for the install and datastream
substitutions). The sk-* script in the Optional fast path section is a
convenience wrapper — never required.
# RHEL family
sudo dnf install openscap-scanner scap-security-guide
# Debian/Ubuntu
sudo apt install openscap-scanner ssg-debderived
# List the profiles in your distro's datastream (pick the right ds.xml!)
oscap info /usr/share/xml/scap/ssg/content/ssg-rhel9-ds.xml
# Evaluate against a CIS profile, writing machine + human reports
sudo oscap xccdf eval \
--profile xccdf_org.ssgproject.content_profile_cis \
--results results.xml \
--report report.html \
/usr/share/xml/scap/ssg/content/ssg-rhel9-ds.xml
results.xml is the audit-trail artefact; report.html is the readable
pass/fail breakdown. STIG, PCI-DSS, and HIPAA profiles live in the same
datastream — list them with oscap info and swap the --profile ID.
# Bash remediation script from a completed scan
sudo oscap xccdf generate fix \
--profile xccdf_org.ssgproject.content_profile_cis \
--fix-type bash \
--output remediate.sh \
results.xml
# Ansible playbook instead
sudo oscap xccdf generate fix \
--profile xccdf_org.ssgproject.content_profile_cis \
--fix-type ansible \
--output remediate.yml \
results.xml
Review every generated change. Apply on a test host first, then re-scan to confirm the score improved before touching production. Full datastream selection, profile IDs, and remediation detail in
references/openscap-reference.md.
sudo apt install lynis # dnf install lynis (EPEL on RHEL/Rocky/Alma)
sudo lynis audit system # interactive: score + suggestions
sudo lynis audit system --quiet --logfile /var/log/lynis.log # for cron/CI
# Results: hardening index + warnings + suggestions
sudo grep -E 'Hardening index|Warning|Suggestion' /var/log/lynis-report.dat
The hardening index is a quick directional score, not a benchmark. Work the
prioritized suggestions, then re-run. Detail in
references/lynis-reference.md.
Running sudo install-skills-bin linux-benchmark-scanning installs:
| Task | Fast-path script |
|---|---|
| Auto-pick the SSG datastream, run OpenSCAP + Lynis, summarise scores | sudo sk-benchmark-scan --profile cis |
This is an optional read-only wrapper around oscap and lynis — it scans
and reports, it never remediates. The commands above are the source of truth.
This skill installs the following scripts to /usr/local/bin/. To install:
sudo install-skills-bin linux-benchmark-scanning
| Script | Source | Core? | Purpose |
|---|---|---|---|
| sk-benchmark-scan | scripts/sk-benchmark-scan.sh | yes | Read-only compliance scan on both families: auto-detect the distro/version, locate the matching SSG datastream, run oscap xccdf eval against the chosen profile (CIS/STIG/PCI-DSS) into timestamped results.xml + report.html, optionally run lynis audit system, and print a pass/fail + hardening-index summary. Never remediates. |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
openscap, lynis, compliance-scanning, cis-benchmark, stig, pci-dss
45 skills in this plugin
/cisco-ios-patternsUse when reading or reviewing Cisco IOS/IOS-XE configuration, selecting read-only show commands, or planning and verifying bounded router or switch configuration work. Not for Linux host networking, bulk SSH automation, or config preflight parsing; route those to linux-network-admin, netmiko-ssh-automation, or network-config-validation./linux-access-controlUse when creating, revoking, or auditing Linux users, groups, SSH keys, sudo/wheel access, PAM settings, SELinux user mappings, or file permissions. Use linux-secrets for credential material and linux-server-hardening for broader host policy./linux-archive-integrityUse when creating, signing, encrypting, listing, comparing, or restoring metadata-preserving tar archives on Debian/Ubuntu or RHEL-family hosts. Covers ACLs, xattrs, incrementals, and verification; use linux-rsync-sync for file-tree mirrors./linux-auditd-rulesUse when inspecting, designing, testing, persisting, or querying auditd rules for forensic attribution on Debian/Ubuntu or RHEL-family hosts. Covers watches, syscalls, loss, and immutable mode; use linux-file-integrity for drift and linux-benchmark-scanning for scoring./linux-bash-scriptingUse when writing or reviewing portable sk-* Bash scripts for this engine, including common.sh primitives, flags, preview mode, and safety gates; use linux-repo-sync for Git-update behaviour and not for one-off commands./linux-cloud-initUse when authoring, validating, or debugging cloud-init user-data, Ubuntu autoinstall, or RHEL-family Kickstart for first-boot provisioning. Use linux-server-provisioning for interactive post-boot setup and linux-config-management for ongoing desired state.npx claudepluginhub peterbamuhigire/linux-skills --plugin linuxOther plugins' skills for the same job