Course contentsShow
← Security
Lesson 1401 of 3,05228. Application Security - TestingFree lesson

Dynamic Testing and DAST in Pipelines

Deploying applications to test environments, running automated DAST scans, and integrating runtime security testing.

Dynamic Testing and DAST in Pipelines

What you'll learn: How to integrate runtime security testing into your CI/CD pipeline by deploying applications to test environments and running automated DAST scans.

The Runtime Testing Challenge

So far, you've integrated static analysis (SAST) and dependency scanning at build time. But remember: DAST works by attacking a running application. You can't run DAST against source code or a container image—you need a live, deployed instance to probe. This means your pipeline must temporarily deploy your application to a test environment before security gates can pass.

The Pipeline Flow

Think of it like a dress rehearsal before opening night. Your pipeline:

  1. Deploys to staging: Spins up your application in an ephemeral or dedicated test environment (containers, VMs, or cloud instances)
  2. Runs DAST scans: Launches an automated scanner (OWASP ZAP, Burp Suite, etc.) that crawls, authenticates, and actively probes for vulnerabilities
  3. Collects results: Captures findings in a structured format (JSON, XML)
  4. Gates the deployment: Blocks promotion to production if critical vulnerabilities are found
  5. Tears down: Cleans up the test environment

Integration Patterns

Your pipeline script might look conceptually like:

# deploy test environment
# wait for app health check
# run DAST scan with API/config
# parse scan results
# fail build if critical issues found
# cleanup test environment

The scanner configuration includes authentication credentials (from secret stores), scan scope, and result thresholds—all automated so every commit gets runtime-tested.

Key Takeaway: Dynamic testing in pipelines requires deploying your application to a live test environment where DAST tools can actively probe it, catching runtime vulnerabilities before production while maintaining automated, gated deployments.