-
Notifications
You must be signed in to change notification settings - Fork 0
CLI Reference
Installation:
pip install counterscarp-engine— See Getting Started for details.
Counterscarp Engine provides three CLI commands:
| Command | Entry Point | Description |
|---|---|---|
counterscarp-engine |
orchestrator:main |
Primary audit orchestrator |
counterscarp |
orchestrator:main |
Short alias (identical) |
garrison-generate-pipeline |
pipeline_generator:main |
CI/CD pipeline generator |
| Flag | Type | Default | Description |
|---|---|---|---|
--target |
PATH | (required) | Path to project root or .sol file |
--config |
FILE | Auto-detect | Path to counterscarp.toml config file |
--report |
flag | false |
Generate professional HTML/Markdown audit report |
--project-name |
NAME | From path | Project name for report headers |
| Flag | Type | Default | Description |
|---|---|---|---|
--aderyn |
flag | false |
Run Aderyn static analysis (requires aderyn CLI) |
| Flag | Type | Default | Description |
|---|---|---|---|
--fuzz-contract |
NAME | None | Foundry invariant test contract name |
--medusa |
flag | false |
Run Medusa coverage-guided fuzzing |
--symbolic |
flag | false |
Run Mythril symbolic execution (requires myth CLI) |
| Flag | Type | Default | Description |
|---|---|---|---|
--solana-root |
PATH | None | Path to Solana/Anchor project root |
| Flag | Type | Default | Description |
|---|---|---|---|
--upgrade-old |
PATH | None | Path to OLD contract version |
--upgrade-new |
PATH | None | Path to NEW contract version |
| Flag | Type | Default | Description |
|---|---|---|---|
--history |
flag | false |
Run time-travel historical vulnerability scan |
--time-travel |
flag | false |
Alias for --history
|
--commits |
INT | 50 |
Maximum commits to scan in history mode |
--since |
DATE | None | Only scan commits since this date (ISO format, e.g. 2024-01-01) |
--branch |
NAME | main |
Branch to scan in history mode |
| Flag | Type | Default | Description |
|---|---|---|---|
--fingerprint |
flag | false |
Run protocol fingerprint similarity scan |
| Flag | Type | Default | Description |
|---|---|---|---|
--rag |
flag | false |
Enable RAG enrichment for findings |
--build-rag-index |
flag | false |
Rebuild the RAG knowledge base index |
Counterscarp Engine ships with three pre-configured profiles via TOML config files:
| Feature | PR Profile | Audit Profile | Bounty Profile |
|---|---|---|---|
| Config file | counterscarp-pr.toml |
counterscarp.toml |
counterscarp-bounty.toml |
| Heuristic scan | Yes | Yes | Yes |
| Slither | High/Medium | High/Medium | All impacts |
| Aderyn | No | Optional | Yes |
| Fuzzing | No | Optional | Yes (Medusa) |
| Symbolic (Mythril) | No | Optional | Yes |
| RAG enrichment | No | Optional | Yes |
| Exploit generation | No | No | Yes (HIGH+) |
| Report format | Markdown | HTML + MD | HTML + MD + SARIF |
| Fail threshold | HIGH | MEDIUM | LOW |
| Typical runtime | 30-60s | 5-15 min | 30-60 min |
Designed for CI/CD gates on pull requests. Fast, focused, actionable.
counterscarp --target ./contracts --config counterscarp-pr.tomlFor professional security audits. Comprehensive analysis with professional reporting.
counterscarp --target ./contracts --config counterscarp.toml --report --project-name "ProtocolName"Maximum depth for bug bounty hunters. All analyzers, all rules, exploit generation.
counterscarp --target ./contracts \
--config counterscarp-bounty.toml \
--report \
--fuzz-contract InvariantTest \
--medusa \
--aderyn \
--symbolic \
--fingerprint \
--rag \
--project-name "BountyTarget"counterscarp --target ./contracts --config counterscarp-pr.tomlRuns heuristics + Slither (High/Medium only). Fails CI on HIGH+ findings.
counterscarp --target ./contracts --report --project-name "UniswapV4"Full pipeline with professional HTML + Markdown report generation.
counterscarp --target ./contracts \
--config counterscarp-bounty.toml \
--fuzz-contract InvariantTest \
--medusa \
--aderyn \
--symbolic \
--fingerprint \
--rag \
--reportAll analyzers, RAG enrichment, protocol fingerprinting, exploit generation.
counterscarp --target ./contracts \
--upgrade-old ./contracts/ImplementationV1.sol \
--upgrade-new ./contracts/ImplementationV2.sol \
--reportCompares old and new implementations for storage collisions, removed auth, and other upgrade risks.
# Scan last 100 commits on develop branch
counterscarp --target ./my-project --history --commits 100 --branch develop
# Scan commits since a specific date
counterscarp --target ./my-project --history --since 2024-06-01 --branch mainTraces vulnerability patterns across git history, identifying active vs. fixed issues.
counterscarp --target ./evm-contracts --solana-root ./programs --reportRuns EVM analysis on the first target and Solana/Anchor static analysis on the programs directory.
# Build the knowledge base index first
counterscarp --target ./contracts --build-rag-index
# Then enrich findings
counterscarp --target ./contracts --rag --reportUses local sentence-transformers embeddings (no API key needed) to enrich findings with historical context and remediation guidance.
| Variable | Description |
|---|---|
PYTHONUNBUFFERED |
Set to 1 for real-time log output in production |
GARRISON_UPLOAD_DIR |
Override upload directory for web app |
GARRISON_RESULTS_DIR |
Override results directory for web app |
COUNTERSCARP_PRO_LICENSE |
Pro license key for unlocking premium features |
OPENAI_API_KEY |
Required when using llm_backend = "openai" in [ai] config |
ANTHROPIC_API_KEY |
Required when using llm_backend = "anthropic" in [ai] config |
COUNTERSCARP_LOG_LEVEL |
Log level: DEBUG, INFO, WARNING, ERROR, CRITICAL |
COUNTERSCARP_LOG_FORMAT |
Output format: "text" or "json" |
COUNTERSCARP_LOG_FILE |
Optional file path for log output |
| Code | Meaning |
|---|---|
0 |
Scan completed, no findings at or above fail_on_severity threshold |
1 |
Scan completed, findings detected at or above threshold (CI failure) |
2 |
Fatal error (missing module, invalid config, etc.) |
Note: The exit code is determined by the engine.fail_on_severity config setting. With the default of HIGH, any HIGH or CRITICAL finding causes exit code 1.
Garrison Security Engine • counterscarp.io
Scarpshield Wiki (Counterscarp Engine)
- Home
- Current Status
- Getting Started
- CLI Reference
- Configuration
- Web App Guide
- Deployment
- Report Formats
- Rules Catalog
- Architecture
- Plugin Development
- Contributing
- Security & Licensing
- Pricing & Pro Features
- FAQ & Troubleshooting
GitHub Repo | Web App | PyPI