claudesec / scanner
AGENTS.md16 starsChanged 6 months agoMITView on GitHub
Zero-dependency bash security scanner CLI. Outputs findings to stdout or JSON. The main entrypoint is scanner/claudesec. For how many checks each category implements and the total, see README's Scanner Categories — that table is the one statement of those numbers that test_ci_scanner_check_counts.py holds to the tree, so restating them here would only rot (it already had: this line said ~120+ against a real 201).
- Reads credentials
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,542 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository14 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/AGENTS.mdAGENTS.md
- scripts/AGENTS.mdAGENTS.md
- .claude/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/claude-agents-and-practices.mdcCursor rule
- .cursor/rules/claudesec-project.mdcCursor rule
- .cursor/rules/markdown-quality.mdcCursor rule
- .cursor/rules/no-sensitive-paths.mdcCursor rule
- .cursor/rules/security-citations.mdcCursor rule
- ci-config-guard-claudesecSkill
- kcov-debugSkill
- lychee-redirect-triageSkill
- omc-referenceSkill
The file
We split this AGENTS.md into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 53
Follow the existing check function pattern in lib/checks.sh — use log_info, log_warn, log_fail from lib/output.sh.
- Very specific: line 55
Add a corresponding test in tests/ (bash or pytest depending on check type).
- Very specific: line 87
Check IDs follow CATEGORY-NNN format (e.g., SECRETS-002, CICD-005).
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md 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.
Files
AGENTS.md — scanner/
<!-- Parent: ../AGENTS.md --><!-- Generated: 2026-04-08 -->Purpose
Zero-dependency bash security scanner CLI. Outputs findings to stdout or JSON. The main entrypoint is scanner/claudesec. For how many checks each category implements and the total, see README's Scanner Categories — that table is the one statement of those numbers that test_ci_scanner_check_counts.py holds to the tree, so restating them here would only rot (it already had: this line said ~120+ against a real 201).
Directory Structure
scanner/
├── claudesec # Main CLI entrypoint (bash, ~1029 lines)
├── checks/ # Check modules by category
│ ├── access-control/ # .env files, password hashing, JWT, sessions
│ ├── ai/ # LLM API keys, prompt injection, RAG, agent tools
│ ├── cicd/ # GitHub Actions permissions, SHA pinning, secrets, run freshness
│ ├── cloud/ # AWS, GCP, Azure IAM, logging, storage
│ ├── code/ # SQL/command/XSS injection, SSRF, XXE, crypto (24 checks)
│ ├── infra/ # Docker, Kubernetes, IaC (Terraform/Helm)
│ ├── macos/ # CIS Benchmark v4.0 macOS hardening (20 checks)
│ ├── network/ # TLS, CORS, headers, Trivy, optional Nmap/SSLScan
│ ├── prowler/ # Prowler OCSF integration (16 cloud providers)
│ ├── saas/ # SaaS API scanning: GitHub, Datadog, Okta, Slack, ...
│ └── windows/ # KISA W-series Windows checks (20 checks)
├── lib/
│ ├── checks.sh # Core check functions (~906 lines)
│ ├── output.sh # log_info / log_warn / log_fail formatters
│ ├── dashboard-gen.py # HTML dashboard generator
│ ├── dashboard-template.html
│ ├── compliance-map.py # ISMS-P / ISO / NIST / SOC 2 mapping
│ ├── audit-points-scan.py # Audit evidence collector
│ ├── diagram-gen.py # Architecture diagram generator
│ ├── dashboard_api_client.py
│ ├── dashboard_auth.py
│ ├── dashboard_data_loader.py # Re-exports dashboard_data_analysis below
│ ├── dashboard_data_analysis.py # Prowler analysis + provider filters + env status
│ ├── dashboard_mapping.py # Re-exports compliance/arch modules below
│ ├── dashboard_compliance.py # Compliance frameworks + control map + mapping
│ ├── dashboard_arch.py # Architecture security-domain mapping
│ ├── dashboard_utils.py
│ ├── csp_utils.py
│ └── zscaler-api.py
└── tests/ # bash + pytest test suiteFor AI Agents
Adding a New Check
- Identify the correct category directory under
checks/. - Follow the existing check function pattern in
lib/checks.sh— uselog_info,log_warn,log_failfromlib/output.sh. No rawecho. - Register the check in the category's entrypoint file.
- Add a corresponding test in
tests/(bash or pytest depending on check type). - Map the check to compliance frameworks in
lib/compliance-map.py.
Testing
# Run all scanner tests
python3 -m pytest scanner/tests/ -v --tb=short
# Specific bash test
bash scanner/tests/test_check_cicd_pipeline.sh
bash scanner/tests/test_output_functions.sh
bash scanner/tests/test_check_infra_docker.sh
# Specific pytest
python3 -m pytest scanner/tests/test_compliance_map.py -v
python3 -m pytest scanner/tests/test_dashboard_gen_smoke.py -vRunning the Scanner
./scanner/claudesec scan
./scanner/claudesec scan --category code
./scanner/claudesec scan --severity high,critical
./scanner/claudesec scan --format json
./scanner/claudesec report --output report.jsonConventions
- Bash: match style in
lib/checks.sh— 2-space indent,localvariables, quoted expansions. - Check IDs follow
CATEGORY-NNNformat (e.g.,SECRETS-002,CICD-005). - Allowlist paths for noise reduction:
templates/,examples/,docs/,scanner/tests/. - Python helpers: PEP 8, type hints encouraged, no third-party deps unless in
requirements-ci.txt.
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
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.

