50 lines
2.1 KiB
Markdown
50 lines
2.1 KiB
Markdown
# secret-scan
|
|
|
|
Engine-agnostic IntegraCI Dagger module for **secret / credential detection**.
|
|
Catches committed credentials and keys before they ship — a best-practice
|
|
gate every service should run, callable from any CI engine via `dagger call`.
|
|
|
|
Translates `security_pipeline_adapter.build_secret_scan_step` (which renders
|
|
GitHub-Actions YAML) into portable container-exec recipes.
|
|
|
|
## Verb
|
|
|
|
### `scan`
|
|
|
|
```
|
|
dagger call scan --source . [--tool gitleaks|trufflehog|detect-secrets|none]
|
|
```
|
|
|
|
| Arg | Type | Default | Description |
|
|
| -------- | ----------- | ---------- | --------------------------------------------- |
|
|
| `source` | `Directory` | (required) | Source tree to scan |
|
|
| `tool` | `String` | `gitleaks` | Scanner to run |
|
|
|
|
## Tools
|
|
|
|
| Tool | Image | Command |
|
|
| ---------------- | --------------------------------- | --------------------------------------------------------------- |
|
|
| `gitleaks` | `zricethezav/gitleaks` | `detect --source=/src --no-git -v` |
|
|
| `trufflehog` | `trufflesecurity/trufflehog` | `filesystem /src --results=verified,unknown --fail` |
|
|
| `detect-secrets` | `python:3.12-slim` | `pip install detect-secrets && detect-secrets scan --all-files` |
|
|
| `none` | — (no-op) | skip (mirrors `governance.secret_scan=none`) |
|
|
|
|
## Result (`ScanResult`)
|
|
|
|
```json
|
|
{ "tool": "gitleaks", "skipped": false, "findings": 0, "report": "...", "pass": true }
|
|
```
|
|
|
|
Tools exit non-zero when secrets are found; the module swallows that exit,
|
|
captures the report, and surfaces `pass` / `findings` so the calling CI
|
|
engine decides how to gate the pipeline.
|
|
|
|
## Examples
|
|
|
|
```bash
|
|
dagger call scan --source .
|
|
dagger call scan --source . --tool trufflehog
|
|
dagger call scan --source . --tool detect-secrets
|
|
dagger call scan --source . --tool none
|
|
```
|