Dagger module: dast-scan
Dynamic Application Security Testing (DAST) — runs against a deployed
HTTP target (typically the ephemeral preview environment from a PR
deploy). Distinct from security-scan (SAST/SCA: scans source).
Tools
| Function | Tool | Speed | Intrusiveness | When to run |
|---|---|---|---|---|
zap-baseline |
OWASP ZAP baseline | 1-3min | Passive | Every PR + nightly against prod |
zap-full |
OWASP ZAP active | 10-60m | Intrusive | PR preview env only |
nuclei |
ProjectDiscovery | 1-5min | Passive | Every PR + nightly against prod |
Never run
zap-fullor destructive Nuclei templates against production. Use it only on the ephemeral env that the deploy pipeline spins up for the PR. The CI workflow in.github/workflows/security.ymlonly runszap-baselineandnucleiagainst the public canary URL.
Usage
From CI (GitHub Actions)
The dast job in .github/workflows/security.yml calls:
dagger call -m dagger/dast-scan zap-baseline \
--target https://canary.integraci.co \
--auth-header "Bearer $CANARY_TOKEN" \
--fail-on high
Findings → SARIF → github/codeql-action/upload-sarif → Security tab.
From IntegraCI golden path pipelines
Add a step to template.yaml to run DAST against the per-PR
ephemeral env after the deploy stage completes:
- id: dast
name: DAST scan
action: integraci:dagger:exec
input:
module: dast-scan
function: zap-baseline
args:
target: ${{ steps.deploy-preview.output.url }}
auth-header: "Bearer ${{ secrets.PREVIEW_TOKEN }}"
fail-on: high
Locally (dev)
dagger call -m dagger/dast-scan zap-baseline --target http://localhost:8000
dagger call -m dagger/dast-scan nuclei --target http://localhost:8000 --severity critical,high
Failure thresholds
fail-on accepts info | low | medium | high | critical.
Default is high — the run fails when any Critical or High
finding is present.
False positive workflow
- Triage in the SARIF Security tab.
- If a finding is a true FP, add the rule ID to:
- ZAP:
--ignore-rules 10038,10054 - Nuclei: built-in
-exclude-idflag
- ZAP:
- Document the rationale in
docs/security/dast-suppressions.md(referenced by the OPAgolden_standardpolicy — every suppression needs a docs entry or the self-audit fails).