Module 23 · DevSecOps & Application Security · Lesson 68 of 75

Security tools in the CI/CD pipeline

SAST, SCA, secrets scanning, infrastructure-as-code and container scanning, and DAST: what each finds, where it runs, and how to stop them drowning developers in noise.

In this lesson · about 45 minutes

  • Match each type of security scanner to what it finds
  • Place scanners at the right stages of a pipeline
  • Run secrets, SAST, dependency and image scans and read the results

The scanners

TypeLooks atFindsExamples
Secrets scanningCode and git historyKeys, passwords, tokensGitleaks, TruffleHog, GitHub secret scanning
SAST (static)Source code, not runningInjection, unsafe functions, hard-coded crypto keysSemgrep, CodeQL, SonarQube, Bandit (Python)
SCA (software composition)DependenciesKnown CVEs in libraries, licence issuesDependabot, OWASP Dependency-Check, Snyk, npm audit, pip-audit
IaC scanningTerraform, CloudFormation, Kubernetes YAMLPublic buckets, open security groups, privileged podsCheckov, tfsec/Trivy, KICS
Container scanningImagesVulnerable OS packages, running as rootTrivy, Grype, Docker Scout
DAST (dynamic)The running appXSS, misconfigured headers, auth issuesOWASP ZAP, Burp Suite Enterprise, Nuclei
IAST / RASPInstrumented running appFlaws seen from inside at test or run timeAgent-based commercial tools

Where they run

  1. Pre-commit on the developer's laptop: secrets scanning (catch the key before it ever reaches git).
  2. Pull request: SAST, SCA, IaC scan; results shown as review comments.
  3. Build: container scan of the image; generate an SBOM; sign the artefact.
  4. Staging: DAST against the deployed app.
  5. Production: continuous dependency alerts, runtime protection, monitoring.

Making it work for people

  • Break the build only on high-confidence, high-severity findings (a live secret, a critical CVE with a fix available). Report the rest.
  • Tune rules and suppress false positives with a reason; noisy tools get ignored.
  • Show the fix, not just the problem (Dependabot opens the upgrade PR for you).
  • Track metrics: mean time to remediate, open criticals per team.
  • Security champions in each team spread knowledge faster than a central team can.

If a secret is committed

Removing it from the latest commit is not enough: it is still in git history and may already be copied. Revoke and rotate the secret first, then clean history if needed, and check logs for use of the leaked key.

Try it · watch it run

Watch a pipeline catch problems

Switch on one or more problems (a pasted key, SQL injection, an old library, a public bucket, an old base image, missing headers), run the pipeline, and see which gate catches each one and what the fix is.

Put problems in the code

Fail the build on:
  1. 1. Secret scan

    Gitleaks

  2. 2. SAST

    Semgrep

  3. 3. Dependencies

    npm audit / Trivy fs

  4. 4. IaC scan

    Checkov

  5. 5. Build + image scan

    Trivy image

  6. 6. DAST on staging

    OWASP ZAP

security findings
Push to run the pipeline.
Each gate catches a different kind of problem, as early as possible: a leaked key is caught before anything is built, a public bucket before it exists. The threshold is a team decision: blocking on everything slows the team down, and blocking on nothing teaches people to ignore the warnings. Many teams block on critical and high, and track medium as tickets.

Hands-on lab (simulated terminal)

Lab: scan a project before it ships

The shop-api repository is about to be released. Run the same checks the pipeline will. Output is simulated; the key is fake.

Step 1 of 5. Type each command and press Enter. Nothing runs on your computer.

Lab: scan a project before it ships

1. Scan the repository and its git history for secrets with Gitleaks.

dev@build:~/shop-api$

Check your understanding0 of 4 correct

Question 1

1.Which tool type finds vulnerable third-party libraries?

Question 2

2.DAST differs from SAST because it...

Question 3

3.A live key was committed last week. What comes first?

Question 4

4.When should a scan fail the build?

Quiz score: 0 of 4

Tip: answer every quiz question correctly first.

Written by Noviq Academy in its own words. All labs are simulations: no real systems are touched, and every name, address, password and hash is made up. The offensive techniques taught here are for defending systems and for authorised testing only; never scan, access or test a system without the owner's written permission. Tool and product names belong to their owners, and command output may differ slightly from yours. Read-aloud uses your device's built-in voices.