$npx -y skills add Masriyan/Claude-Code-CyberSecurity-Skill --skill 02-vulnerability-scannerDependency auditing, CVE detection, configuration security review, CVSS scoring, and prioritized vulnerability reporting
| 1 | # Vulnerability Scanning & Assessment |
| 2 | |
| 3 | ## Purpose |
| 4 | |
| 5 | Enable Claude to perform comprehensive vulnerability assessments by directly analyzing dependency files, configuration files, and scan output — then generating prioritized, actionable reports. Claude identifies vulnerabilities, calculates risk, and prescribes remediation with version specifics. |
| 6 | |
| 7 | --- |
| 8 | |
| 9 | ## Activation Triggers |
| 10 | |
| 11 | This skill activates when the user asks about: |
| 12 | - Scanning dependencies for known CVEs |
| 13 | - Auditing `requirements.txt`, `package.json`, `go.mod`, `pom.xml`, `Cargo.toml` |
| 14 | - Reviewing server configurations for security issues |
| 15 | - CVSS scoring or severity calculation |
| 16 | - Vulnerability assessment or security audit reports |
| 17 | - Checking software versions against known exploits |
| 18 | - Configuration hardening for nginx, Apache, SSH, Docker, Kubernetes |
| 19 | - NVD, OSV, or CVE database queries |
| 20 | |
| 21 | --- |
| 22 | |
| 23 | ## Prerequisites |
| 24 | |
| 25 | ```bash |
| 26 | pip install requests packaging jinja2 pyyaml |
| 27 | ``` |
| 28 | |
| 29 | **Optional enhanced tools:** |
| 30 | - `nuclei` — Template-based vulnerability scanner |
| 31 | - `trivy` — Container and filesystem scanner |
| 32 | - `nmap` with NSE scripts — Network vuln scanning |
| 33 | - `openvas` — Full vulnerability management |
| 34 | |
| 35 | --- |
| 36 | |
| 37 | ## Core Capabilities |
| 38 | |
| 39 | ### 1. Dependency Vulnerability Auditing |
| 40 | |
| 41 | Claude can directly read and analyze dependency files: |
| 42 | |
| 43 | **When the user asks to audit dependencies:** |
| 44 | |
| 45 | 1. **Read the dependency file** using Claude's Read tool or ask the user to paste it |
| 46 | 2. **Identify package manager** from file format: |
| 47 | - `requirements.txt` / `Pipfile.lock` / `pyproject.toml` → Python/pip |
| 48 | - `package.json` / `package-lock.json` / `yarn.lock` → Node.js/npm |
| 49 | - `go.mod` / `go.sum` → Go modules |
| 50 | - `pom.xml` / `build.gradle` → Java/Maven/Gradle |
| 51 | - `Cargo.toml` / `Cargo.lock` → Rust/Cargo |
| 52 | - `Gemfile.lock` → Ruby/Bundler |
| 53 | - `composer.lock` → PHP/Composer |
| 54 | 3. **Extract exact versions** for all direct and transitive dependencies |
| 55 | 4. **Query vulnerability databases** — Claude can search NVD API, OSV, and GitHub Advisory Database for each package+version combination |
| 56 | 5. **Calculate CVSS v3.1 severity** for each finding |
| 57 | 6. **Check for available patches** — identify the minimum safe version |
| 58 | 7. **Generate prioritized remediation report** |
| 59 | |
| 60 | **Use this command to run the automated audit:** |
| 61 | ```bash |
| 62 | python scripts/dependency_auditor.py --project-dir ./myapp --format json --output audit.json |
| 63 | python scripts/dependency_auditor.py --requirements requirements.txt --severity high,critical |
| 64 | ``` |
| 65 | |
| 66 | **Claude's native analysis** — When running without scripts, analyze pasted dependency content directly: |
| 67 | - Flag packages with `>= `, `*`, or missing version pins (supply chain risk) |
| 68 | - Identify known high-risk packages (log4j, spring-core, struts, etc.) |
| 69 | - Cross-reference with CISA KEV (Known Exploited Vulnerabilities) catalog |
| 70 | |
| 71 | ### 2. Configuration Security Auditing |
| 72 | |
| 73 | Claude can directly read and analyze configuration files: |
| 74 | |
| 75 | **When the user asks to audit a configuration:** |
| 76 | |
| 77 | #### Nginx Audit Checklist |
| 78 | ``` |
| 79 | [ ] ssl_protocols — Must NOT include SSLv2, SSLv3, TLSv1, TLSv1.1 |
| 80 | [ ] ssl_ciphers — Must not include RC4, DES, MD5, EXPORT ciphers |
| 81 | [ ] server_tokens — Should be 'off' (hides version) |
| 82 | [ ] add_header X-Frame-Options — Required (SAMEORIGIN or DENY) |
| 83 | [ ] add_header X-Content-Type-Options — Required (nosniff) |
| 84 | [ ] add_header Strict-Transport-Security — Required (min 1 year) |
| 85 | [ ] add_header Content-Security-Policy — Required |
| 86 | [ ] autoindex — Must be 'off' (prevents directory listing) |
| 87 | [ ] client_max_body_size — Should be set (prevents DoS) |
| 88 | [ ] access_log / error_log — Must be enabled |
| 89 | ``` |
| 90 | |
| 91 | #### SSH (sshd_config) Audit Checklist |
| 92 | ``` |
| 93 | [ ] PermitRootLogin — Should be 'no' or 'prohibit-password' |
| 94 | [ ] PasswordAuthentication — Should be 'no' (key-only) |
| 95 | [ ] PermitEmptyPasswords — Must be 'no' |
| 96 | [ ] Protocol — Should be '2' only |
| 97 | [ ] Port — Consider non-default port |
| 98 | [ ] AllowUsers / AllowGroups — Explicit allowlist preferred |
| 99 | [ ] MaxAuthTries — Should be 3-5 |
| 100 | [ ] LoginGraceTime — Should be 30-60s |
| 101 | [ ] ClientAliveInterval — Enable session timeout |
| 102 | [ ] X11Forwarding — Should be 'no' if unused |
| 103 | [ ] UsePAM — Review PAM configuration |
| 104 | ``` |
| 105 | |
| 106 | #### Docker/Dockerfile Audit Checklist |
| 107 | ``` |
| 108 | [ ] USER — Must not run as root; add non-root user |
| 109 | [ ] Image tags — Must not use 'latest'; pin specific digest |
| 110 | [ ] COPY vs ADD — Prefer COPY; ADD has implicit extraction risks |
| 111 | [ ] Secrets — No RUN commands with passwords/tokens |
| 112 | [ ] Multi-stage builds — Minimize attack surface |
| 113 | [ ] HEALTHCHECK — Define health monitoring |
| 114 | [ ] .dockerignore — Exclude .env, keys, secrets |
| 115 | [ ] Read-only filesystem — Use --read-only where possible |
| 116 | ``` |
| 117 | |
| 118 | #### Kubernetes YAML Audit Checklist |
| 119 | ``` |
| 120 | [ ] securityContext.runAsNonRoot — Must be true |
| 121 | [ ] securityContext.readOnlyRootFilesystem — Should be true |
| 122 | [ ] s |