What are SCA, SAST, and DAST: how they work, market tools, and how to implement them in Azure DevOps, GitHub, and more
Learn what each type of scan finds, which tools to use (open source and commercial), and how to set up SCA, SAST, DAST, and secret scanning in GitHub, Azure DevOps, and GitLab pipelines, with gates that don't block the team.
CI/CD$ trivy fs --format sarif --output trivy.sarif .▍SCA, SAST, and DAST come up in every conversation about DevSecOps, almost always as if they were the same thing under different names. They aren’t. Each acronym looks at a different part of the software, runs at a different moment in the pipeline, and gets things wrong in a different way. Teams that mix the three up end up with tools shouting about the same false positives.
This guide explains how each one works, which tools the market uses, and how to implement all of it in GitHub, Azure DevOps, and GitLab, with ready-to-adapt YAML.
What SCA, SAST, and DAST are
SCA: the code you import
Software Composition Analysis inventories third-party dependencies and matches each one against databases of known vulnerabilities (CVEs and advisories). The tool reads the manifests (package.json, pom.xml) and, above all, the lockfiles (package-lock.json, poetry.lock, go.sum), which pin the exact version, including transitive dependencies.
Three details separate a good SCA setup from a noisy one:
- Reachability: some tools check whether your code actually calls the vulnerable function, which changes the priority.
- Licenses: the same scan flags licenses that don’t fit your use, such as a copyleft license in a closed-source product.
- Continuity: a new CVE can show up tomorrow in a dependency that hasn’t changed. SCA runs on the PR and continuously.
SAST: the code you write
Static Application Security Testing analyzes source code, bytecode, or binaries without running the application. The heart of the technique is data-flow (taint) analysis: the tool marks untrusted inputs (an HTTP parameter, a header, a file) as sources, marks dangerous operations (an SQL query, a shell command, HTML rendering) as sinks, and looks for paths between them that skip sanitization.
Everything is driven by rules: queries (CodeQL) or patterns (Semgrep). Rule quality sets the false positive rate, which is why SAST runs early but needs curation.
DAST: the running application
Dynamic Application Security Testing is black-box testing: the tool doesn’t see the code, only the live application. It crawls to discover pages and endpoints, then fires attacks (injection payloads, header tampering, TLS and cookie configuration tests) and watches the responses.
That’s why DAST needs an environment: it runs after the deploy to staging or to an ephemeral environment per PR, never during the build. In return, it finds what only exists at runtime, such as a missing security header or an exposed debug endpoint.
IAST, secrets, IaC, and containers
- IAST: an agent inside the application watches code paths during integration tests. It combines SAST’s context with DAST’s confirmation.
- Secret scanning: looks for credentials in the code and in Git history, ideally before the push.
- IaC scanning: checks Terraform, Bicep/ARM, CloudFormation, Kubernetes, and Helm for dangerous configurations, on the PR and before
apply. - Container scanning: analyzes OS packages and dependencies inside the image, plus Dockerfile mistakes, after the build and again in the registry.
Comparison
| Type | What it finds | When it runs | Speed | False positives | What it needs |
|---|---|---|---|---|---|
| SCA | CVEs and licenses in dependencies | PR, build, and continuously | Seconds | Low (high without reachability) | Manifests and lockfiles |
| SAST | Injection, weak crypto, insecure flows | Editor, PR, main branch | Minutes | Medium to high | Source code and rules |
| DAST | Runtime and configuration flaws | After deploy to staging | Minutes to hours | Low to medium | Running app and a URL |
| IAST | Vulnerabilities confirmed at runtime | Integration tests | Alongside the tests | Low | Agent and good test coverage |
| Secrets | Exposed credentials | Pre-commit, push, PR | Seconds | Low to medium | Repository and history |
| IaC / container | Insecure configuration, vulnerable packages | PR, build, registry | Seconds | Low | IaC files or image |
Market tools
| Category | Open source / free | Commercial |
|---|---|---|
| SAST | CodeQL (free for public repositories), Semgrep Community Edition, Opengrep, SonarQube Community Build | GitHub Code Security, Semgrep Code (Semgrep AppSec Platform), SonarQube Server and SonarQube Cloud, Snyk Code, Checkmarx One, Fortify (OpenText) |
| SCA | Dependabot, Renovate, OWASP Dependency-Check, OSV-Scanner, Trivy, Grype | Snyk Open Source, Mend, SonarQube Advanced Security |
| DAST | ZAP, Nuclei | Snyk API & Web, Fortify (OpenText) |
| Secrets | gitleaks, TruffleHog | GitHub Secret Protection, GitLab Ultimate |
| IaC | Checkov, Trivy, KICS | Snyk IaC, Defender for Cloud |
| Container and SBOM | Trivy, Grype, Syft | Snyk Container |
A few name changes that confuse anyone researching today:
- Semgrep OSS became Semgrep Community Edition (CE) in December 2024. The engine is still LGPL-2.1, but the Semgrep-maintained rules moved to the Semgrep Rules License, which isn’t open source. That’s what prompted the Opengrep fork.
- ZAP now presents itself as “ZAP by Checkmarx,” remains Apache-2.0, and is no longer an OWASP project. Plenty of material still calls it “OWASP ZAP.”
- The SonarQube family uses the names SonarQube Server (self-managed), SonarQube Cloud (SaaS), SonarQube Community Build (free), SonarQube for IDE, and the SonarQube Advanced Security add-on.
- gitleaks has declared itself feature complete, and its maintainer is moving to Betterleaks.
Versions change every week, so check the current docs before pinning any of them.
Implementing on GitHub
Since April 2025, GitHub Advanced Security has been sold as two products, available on the Team and Enterprise plans: GitHub Secret Protection (secret scanning, push protection, custom patterns) and GitHub Code Security (code scanning with CodeQL or third-party tools, Copilot Autofix, dependency review). Public repositories get code scanning, Autofix, secret scanning, and push protection at no cost.
CodeQL: default setup or advanced
Default setup is turned on in the repository’s security settings, with no file: GitHub picks the languages and schedules a weekly scan. It’s the best starting point. To control the build, queries, or triggers, use advanced setup with your own workflow:
# .github/workflows/codeql.yml
name: "CodeQL Advanced"
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "30 3 * * 1"
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
permissions:
security-events: write
packages: read
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
- language: javascript-typescript
build-mode: none
- language: python
build-mode: none
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{ matrix.language }}"
Dependabot and dependency review
Dependabot has three parts: alerts (a vulnerable dependency was detected), security updates (an automatic PR with the fix), and version updates, configured in dependabot.yml:
# .github/dependabot.yml
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
Alerts look at the main branch. To stop a vulnerability before the merge, use the dependency review action, which compares the PR’s dependencies with the base branch’s (see the workflow below).
Secret scanning and push protection
With push protection on, a push containing a known secret is rejected. Anyone who needs to bypass it gives a reason (“used in tests,” “false positive,” or “fix later”), and every bypass creates an alert, an audit log entry, and an email. Delegated bypass requires approval from a specific group.
SARIF: third-party tools on the same dashboard
Any tool that produces SARIF can publish results to the Security tab and as PR annotations via upload-sarif. This PR workflow combines dependency review and Semgrep CE:
# .github/workflows/security-pr.yml
name: security-pr
on:
pull_request:
branches: [main]
permissions:
contents: read
jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/dependency-review-action@v5
with:
fail-on-severity: high
semgrep:
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write
steps:
- uses: actions/checkout@v7
- name: Semgrep CE
run: |
pip install semgrep==1.187.0
semgrep scan --config p/default --sarif --output semgrep.sarif
- name: Upload SARIF
if: always()
uses: github/codeql-action/upload-sarif@v4
with:
sarif_file: semgrep.sarif
category: semgrep
Trivy works the same way: generate the file and upload it with a different category.
trivy fs --scanners vuln,secret,misconfig --format sarif --output trivy.sarif .
A warning: in March 2026, stolen credentials were used to move almost every tag of aquasecurity/trivy-action to malware (CVE-2026-33634). Pin third-party actions to the full commit SHA, as detailed in how to improve your CI/CD.
DAST with ZAP against staging
After the deploy to staging, ZAP’s baseline scan walks the application with the spider and runs passive analysis only, with no attacks:
# .github/workflows/dast.yml
name: dast-staging
on:
workflow_dispatch:
schedule:
- cron: "0 5 * * *"
permissions:
contents: read
jobs:
zap-baseline:
runs-on: ubuntu-latest
steps:
- name: ZAP baseline scan
uses: zaproxy/[email protected]
with:
target: "https://staging.example.com"
allow_issue_writing: false
Full and API scans are active: run them only against environments you control, and never against production without agreeing on it first.
Implementing on Azure DevOps
GitHub Advanced Security for Azure DevOps
GitHub Advanced Security for Azure DevOps (GHAzDO) works on Azure DevOps Services with Azure Repos Git, and it’s also sold separately as GitHub Secret Protection for Azure DevOps and GitHub Code Security for Azure DevOps. To turn it on:
- Pick the scope: repository (Project settings > Repos > Repositories), project, or organization.
- Toggle Secret Protection and/or Code Security and confirm with Begin billing.
- Optionally, enable it automatically for new repositories.
CodeQL has a default setup here too, with no pipeline. In a pipeline, the tasks are AdvancedSecurity-Codeql-Init@1, AdvancedSecurity-Dependency-Scanning@1, and AdvancedSecurity-Codeql-Analyze@1. The current docs example uses no autobuild task: your own build steps go between init and analyze, or use buildtype: 'none' for C# and Java. For third-party SARIF there’s AdvancedSecurity-Publish@1. In branch policies, the AdvancedSecurity/NewHighAndCritical status blocks only what the PR introduced.
Microsoft Security DevOps and Defender for Cloud
The MicrosoftSecurityDevOps@1 task is still documented and runs Bandit, BinSkim, Checkov, ESLint, Template Analyzer, Terrascan, and Trivy, among others. The extension moves slowly: treat it as an IaC complement. Defender for Cloud brings findings from Azure DevOps, GitHub, and GitLab connectors into a single console, with code-to-cloud context; the plan each feature requires changes, so check the current docs.
SonarQube and Snyk come in through Marketplace extensions (SonarQube and Snyk Security Scan), each with its own tasks.
Full pipeline
# azure-pipelines.yml
trigger:
branches:
include:
- main
pr:
branches:
include:
- main
stages:
- stage: Build
jobs:
- job: BuildAndScan
pool:
vmImage: ubuntu-latest
steps:
- checkout: self
- task: AdvancedSecurity-Codeql-Init@1
displayName: Initialize CodeQL
inputs:
languages: "csharp"
enableAutomaticCodeQLInstall: true
- script: dotnet build --configuration Release
displayName: Build
- task: AdvancedSecurity-Dependency-Scanning@1
displayName: Dependency scanning
- task: AdvancedSecurity-Codeql-Analyze@1
displayName: CodeQL analysis
- job: IaC
pool:
vmImage: ubuntu-latest
steps:
- task: MicrosoftSecurityDevOps@1
displayName: Microsoft Security DevOps
inputs:
categories: "IaC"
- stage: DeployStaging
dependsOn: Build
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main'))
jobs:
- deployment: Staging
environment: staging
pool:
vmImage: ubuntu-latest
strategy:
runOnce:
deploy:
steps:
- script: echo "deploy the application to staging"
- stage: DAST
dependsOn: DeployStaging
jobs:
- job: ZapBaseline
pool:
vmImage: ubuntu-latest
steps:
- script: |
docker run --rm -t ghcr.io/zaproxy/zaproxy:stable \
zap-baseline.py -t https://staging.example.com -I
displayName: ZAP baseline on staging
-I keeps warnings from failing the stage; remove it once the baseline is clean. The ZAP extension on the Marketplace is community-maintained, so the official container in a script step is the more predictable option.
GitLab and Jenkins
In GitLab, the scanners ship as templates. One include covers almost everything:
# .gitlab-ci.yml
stages: [build, test, deploy, dast]
include:
- template: Jobs/SAST.gitlab-ci.yml
- template: Jobs/Secret-Detection.gitlab-ci.yml
- template: Jobs/Dependency-Scanning.v2.gitlab-ci.yml # Ultimate
- template: Jobs/Container-Scanning.gitlab-ci.yml
- template: Jobs/SAST-IaC.gitlab-ci.yml
- template: Security/DAST.gitlab-ci.yml # Ultimate
dast:
variables:
DAST_TARGET_URL: "https://staging.example.com"
About tiers: SAST, secrets, container, and IaC scanning run on every plan, but merge request findings and vulnerability management are Ultimate. Dependency scanning, DAST, and secret push protection are Ultimate only. The old Gemnasium-based Security/Dependency-Scanning.gitlab-ci.yml template is deprecated: migrate to v2.
Jenkins has nothing built in: use plugins (SonarQube Scanner, OWASP Dependency-Check) or call the CLIs (trivy, semgrep, gitleaks) in sh steps and archive the reports.
How to roll it out without blocking the team
Turning everything on in blocking mode on day one is the fastest way to get the team asking to turn it off. The silent DevSecOps logic applies: block little, with high confidence.
Where to block and where to warn
| Check | Blocks the merge | Warns only (ticket or dashboard) |
|---|---|---|
| Secrets | Any valid secret (push protection) | Low-confidence generic patterns |
| SCA | New dependency with a fixable critical or high CVE | CVE with no fix, medium or low severity |
| SAST | High-confidence rules on new code (injection, deserialization) | Other rules and legacy code |
| IaC | Public resource, no encryption, or a port open to the internet | Best practices and tags |
| Container | Fixable critical CVE in the final image | Base image packages with no fix |
| DAST | Nothing on the PR; high severity holds the promotion to production | Baseline alerts |
Baseline, triage, and owners
- Baseline: on the first scan, move the existing debt to the backlog with a justification and block only what’s new. GHAzDO’s
NewHighAndCritical, dependency review, and Semgrep’s--baseline-commitdo exactly that. - Triage SLA: set deadlines per severity (for example, critical in 7 days, high in 30, medium in 90) and measure compliance.
- Noise reduction: disable rules with a history of false positives, use reachability where available, and give exceptions an expiration date.
- Fix owner: the team that owns the code fixes it (use
CODEOWNERS). The security team owns the rules, the platform, and the critical cases, and security champions bridge the two.
To prioritize what the tools find, the OWASP Top 10 is the most widely used risk map. And SCA doesn’t replace SBOMs, signing, and provenance: that’s covered in supply chain security.
Checklist
- SCA on the PR (dependency review or equivalent) and continuous alerts enabled
- SAST with CodeQL or Semgrep, uploading SARIF to the provider’s dashboard
- Secret scanning with push protection turned on
- DAST baseline running against staging on every release
- Third-party actions and extensions pinned by SHA or a reviewed version
- Blocking table published, with a baseline of the existing debt
- Triage SLA per severity and an owner defined for each repository
Three acronyms, three points of view: SCA looks at what you import, SAST at what you write, and DAST at what you ship. You need all three, each in the right place.