Safeguard
Developer Tools•

How long should a DAST scan run in CI? Setting a time budget

Run a short passive scan on every merge, a time boxed active scan nightly, and a full authenticated scan on a schedule. Here is how to set the budgets.

Safeguard Security Team
4 min read

Split DAST by depth. Run a short passive scan of a few minutes on each merge, a time boxed active scan nightly or weekly against staging, and deep authenticated scans on a schedule. Pipelines stay fast, and slow scans still happen, just not where developers wait.

Why one scan cannot do everything

Active scanning sends attack payloads and can take hours on a large app. Passive scanning only observes traffic and finishes quickly. Putting an hours long job in the path of every pull request teaches developers to bypass it.

The ZAP project documents this split. Its baseline scan spiders a target for one minute by default, then waits for passive scanning to finish, and the page says the whole run is a few minutes at most. It states the script does not perform actual attacks and calls it ideal for CI/CD. Its API scan, by contrast, imports an API definition and runs an active scan against the discovered URLs.

A three tier budget

TierTriggerDepthTarget timeFails the build
FastEvery merge to mainPassive only, short crawlUnder 10 minutesOnly on a short list of high confidence rules
NightlyScheduleActive scan, time boxed, staging1 to 3 hoursNo, opens tickets
DeepWeekly or per releaseAuthenticated, full crawl and API importAs long as neededRelease gate for high severity

The target times are starting points to adjust against your own pipeline, not standards.

Steps to set it up

  1. Measure how long each scan takes on a warm environment today.
  2. Choose the fast tier budget by asking developers how long they will wait. Anything above ten minutes needs a reason.
  3. Put every rule on a three level setting: ignore, warn, fail. The ZAP packaged scans use a config file for exactly this, where rules default to warn and exit codes report whether any rule failed or only warned.
  4. Exclude URLs that waste time, such as static assets, third party hosts and endlessly paginated lists. Packaged scans accept regex based out of scope lines for this.
  5. For active rules, remember that setting a rule to ignore in the API scan config also stops it running, which shortens the scan.
  6. Review runtime monthly. Scan time grows with the app.

Make the slow scans useful

A nightly scan nobody reads is wasted compute. Route its findings to the owning team, deduplicate against open tickets, and report new findings only. For how often to run each type, see how often to run SAST, DAST and SCA.

Try it yourself

Open the demo and compare what a quick scan reports with what a fuller one adds.

Click through it at your own pace, or open it full screen.

One factual note on Safeguard

Safeguard offers policies and gates that can be applied at pull request and pipeline stages. If you want a quick look at your own code, the free scan at gold.safeguard.sh/scan is a no-account place to start.

Quick check

Should a DAST scan block merges?

Only the fast tier, and only on rules you trust. Slow active scans are better as scheduled jobs that open tickets.

Can I run active scans against production?

Be cautious. Active payloads can create data or trip alarms. Staging with production like data is the safer default.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.