Home / Insights / QA and Software Testing

QA and Software Testing

Security Testing in CI: How to Layer SAST, DAST, Dependency Scanning and Secrets Detection Without Stalling Releases

Adding four security scanners to a pipeline is easy. Getting developers to trust and act on what they report is the hard part. This guide explains what each scan type finds, where it belongs in CI, how to set gates that block real risk without blocking every release, and how to run triage.

TopicsQA and Software TestingArchitecture and Modernization

Key takeaways

  • SAST, DAST, dependency scanning and secrets detection find different classes of problem; none replaces the others, and none replaces a periodic penetration test.
  • Put fast, precise checks (secrets, dependency scanning, focused SAST rules) on every pull request, and slower or noisier checks (full SAST, DAST) on merge, nightly or before release.
  • Start every new scanner in report-only mode, baseline existing findings, then block only new high-severity issues, so the gate protects you without freezing delivery.
  • A leaked secret is an incident, not a defect: rotate it first, then clean history and add push-time prevention.
  • Treat findings like any other defect: one queue, a named owner per repository, severity-based service levels and a documented process for accepted risk and false positives.

Most teams adopt security testing in CI the same way: someone adds a scanner, it reports hundreds of findings, the build turns red, and within a month the step is set to “allow failure” and quietly ignored. The tools work. What fails is the rollout: no baseline, no agreement on what should block a release, and no owner for the results.

This guide is written from a QA lead’s perspective for engineering managers, CTOs and product owners who want security checks in the pipeline that people actually act on. It explains the four core automated checks, where each belongs, how to gate builds and how to run triage. In our QA and testing work, we build UI and API automation into clients’ pipelines on tools such as GitHub Actions and GitLab CI; the same discipline of fast feedback, stable gates and clear ownership applies to security checks. If enterprise customers already send you security questionnaires, the evidence these checks produce also helps; see our guide to SOC 2 readiness and security questionnaires.

What each automated security check actually finds

The OWASP DevSecOps Guideline describes a secure pipeline that finds design flaws and vulnerabilities as early and cheaply as possible, and lists secrets scanning, software composition analysis (dependency scanning), SAST, DAST and infrastructure-as-code scanning among its stages. Each answers a different question.

CheckWhat it examinesTypical findingsBlind spots
Secrets detectionSource code, config and Git historyAPI keys, tokens, passwords, private keys committed to the repositorySecrets stored outside the repository; unusual custom formats without a rule
Dependency scanning (SCA)Third-party packages and their versionsLibraries with known published vulnerabilities; licence issuesVulnerabilities in your own code; flaws not yet published
SASTYour source code, without running itInjection patterns, unsafe deserialisation, weak cryptography use, hard-coded credentialsRuntime configuration, authentication logic flaws, business logic
DASTThe running application over HTTPMissing security headers, cookie flags, exposed endpoints, some injection issuesCode paths it cannot reach; issues behind complex authentication

What none of them find well

Automated scanners are weak at broken access control between tenants or roles, flawed business rules (for example, applying a discount twice), and multi-step abuse. These need targeted test cases written by people who understand the product, and periodic manual testing. Scope penetration tests so they complement, rather than repeat, what CI already catches. The same principle applies to AI features, where our guide to testing AI features with evaluation sets shows how to combine automated regression checks with human review.

Where each check belongs in the pipeline

The guiding principle is that feedback on a pull request must be fast and trustworthy. Developers tolerate a check that takes a minute and is usually right. They route around one that takes twenty minutes and is often wrong.

On every commit or pull request

  • Secrets detection on the changed files, and ideally before code reaches the server at all through push-time protection.
  • Dependency scanning when a lockfile or manifest changes, flagging newly introduced vulnerable packages.
  • Focused SAST with a curated, high-precision rule set, scanning only changed code where the tool supports it.

On merge to the main branch

  • Full SAST across the codebase with the broader rule set.
  • Full dependency scan producing an inventory of components for later monitoring.

Against a deployed test environment

  • DAST baseline scan on each deployment to a test or staging environment.
  • Deeper DAST with authenticated, active scanning on a nightly or pre-release schedule, against a disposable environment, never against production data.

Continuously, outside the pipeline

  • Re-scanning dependencies of released versions, because new vulnerabilities are published against code that has not changed.
  • Repository-wide secret scanning of full history.
StageChecksTarget durationGate behaviour
Pull requestSecrets, dependency diff, focused SASTA few minutesBlock on new high-severity and any verified secret
Main branchFull SAST, full dependency scanCan be longerRaise tickets; block release on critical
Test environmentDAST baselineA few minutesFail on agreed rules only
Nightly or pre-releaseAuthenticated DAST, full re-scansHours acceptableRelease checklist item

Durations here are planning targets for illustration, not tool benchmarks; measure your own and tune.

Choosing tools: questions that matter more than feature lists

There are open-source and commercial options for every category, and platform-native features from code hosts. Rather than recommending a brand, use these questions to compare them.

  1. Language and framework coverage. Does the SAST tool understand your languages and frameworks well enough to trace data through them? Poor framework support is the main source of false positives.
  2. Pull request integration. Can findings appear as inline comments on the changed lines, with a link to guidance?
  3. Baselining and suppression. Can you mark existing findings as baseline and suppress false positives with a recorded reason that survives refactoring?
  4. Output formats. Can results be exported in a standard format for aggregation across tools?
  5. Configurable failure rules. Can you decide precisely which findings fail the build?
  6. Data handling. Where is your code sent, and is that acceptable under your contracts?

Two examples of configurable behaviour

The ZAP baseline scan is a good model for CI-friendly DAST. According to its documentation, it spiders the target for one minute by default, then waits for passive scanning to finish, without performing attacks. By default every alert is a warning; you generate a configuration file and set each rule to WARN, FAIL or IGNORE, and exit codes distinguish failures from warnings. That lets a pipeline fail only on rules the team has agreed matter.

For secrets, GitHub’s secret scanning documentation explains that it scans full Git history across branches as well as issues and pull request text, and that it runs automatically and free on public repositories, while private organisation repositories need GitHub Secret Protection on a Team or Enterprise Cloud plan. Whatever host you use, check whether history is scanned and whether pushes containing secrets can be blocked before they land.

Setting gates that block real risk, not every release

A security gate is a policy decision, so write it down and agree it with engineering leadership and the product owner before you switch anything to blocking.

A rollout sequence that works

  1. Report only. Run each new tool for two to four weeks without failing builds. Measure volume and false-positive rate.
  2. Tune. Disable or downgrade rules that are consistently wrong for your codebase, with a recorded reason.
  3. Baseline. Mark existing findings as known debt, each with an owner and a target date.
  4. Block new high-severity findings. Fail the pull request only for issues introduced by that change.
  5. Tighten gradually. Lower the blocking threshold as the baseline shrinks.

A sample gating policy

FindingPull requestRelease
Verified secret in code or historyBlock; trigger incidentBlock
New critical or high SAST findingBlock unless marked false positive with reasonBlock
New dependency with a critical known vulnerability and a fix availableBlockBlock
Known vulnerability with no fix availableWarn; require risk noteProduct owner decision
Medium or low findingsComment onlyTracked in backlog
DAST rule agreed as FAILNot applicableBlock

This is an illustrative policy; severity labels and thresholds must reflect your own risk appetite and contractual obligations.

Break-glass, with a record

There will be urgent releases. Allow a named person to override a gate, but require a ticket explaining the risk and a follow-up date. Overrides without records are how gates quietly die.

Triage: turning findings into fixed defects

As a QA lead, I treat security findings the same way as functional defects: one queue, a clear severity, a named owner and a definition of done. Separate dashboards that only the security team opens tend to grow, not shrink.

A triage routine

  1. Deduplicate. The same flaw may be reported by SAST and DAST, or by several dependency paths. Merge them into one ticket.
  2. Confirm exploitability in context. Is the vulnerable function reachable? Is the endpoint public? Is the dependency used at runtime or only in tests?
  3. Assign severity and due date. Use a simple scale with service levels per severity agreed in advance.
  4. Fix, suppress or accept. Suppressions need a reason in code or tool configuration. Accepted risk needs a business owner’s sign-off and a review date.
  5. Verify. The scan that found it should pass after the fix; add a regression test when the flaw was in your own logic.

Secrets are incidents

When a real credential is found, removing it from the latest commit is not enough, because it remains in history and may already be copied. GitHub’s guidance is that the recommended response is to rotate the exposed credential. Rotate first, check access logs for misuse, then remove it from history, and only then close the ticket.

Dependency findings need a policy

Dependency alerts can be numerous and recurring. A written update policy, covering how quickly to patch by severity, who approves major upgrades and how to handle abandoned packages, saves debate on every alert. Our article on software supply chain security and dependency policies goes deeper on this.

Costs, risks and how to know it is working

The NIST Secure Software Development Framework (SP 800-218), published in February 2022, describes a core set of high-level secure development practices aimed at reducing vulnerabilities in released software and addressing their root causes. Automated testing in CI is one practical part of that, not the whole of it. Budget for it accordingly.

Where the cost really is

  • Licences or platform tiers for commercial tools and private-repository features.
  • Pipeline minutes and environments, especially for DAST against deployed test environments.
  • Tuning time in the first months, which is easy to underestimate.
  • Ongoing triage, usually a few hours a week per active product once baselines are under control. Treat this as an assumption to measure, not a benchmark.

Risks to manage

  • Alert fatigue. Too many low-value findings train people to ignore all findings.
  • False confidence. A green pipeline does not mean an application is secure; access control and business logic still need human testing.
  • Pipeline as attack surface. The OWASP guideline notes that CI/CD tools themselves expand your attack surface; restrict who can change pipeline configuration and how scanners access secrets.
  • Scanning production. Active DAST can modify data; run it against disposable environments.

Measures worth tracking

  • New high-severity findings introduced per month, which should fall.
  • Median time to fix by severity, against agreed service levels.
  • Baseline size over time.
  • Gate overrides per month and their follow-up completion.
  • False-positive rate per tool after tuning.

Implementation checklist

  • Inventory repositories, languages, frameworks and deployment targets.
  • Enable secrets detection with history scanning and push-time blocking where available.
  • Add dependency scanning on manifest changes and continuous re-scanning of released versions.
  • Introduce SAST with a curated rule set on pull requests and a broader set on main.
  • Add a DAST baseline scan against each test deployment, with an agreed FAIL rule list.
  • Run every new tool in report-only mode first; tune, then baseline existing findings.
  • Write and approve a gating policy, including break-glass overrides with records.
  • Route all findings into the normal defect queue with owners and severity-based due dates.
  • Document how to suppress false positives and accept risk, with review dates.
  • Restrict who can change pipeline configuration and how scanners access credentials.
  • Schedule periodic manual and penetration testing for what scanners cannot see.
  • Review the metrics monthly and tighten thresholds as the baseline shrinks.

Frequently asked questions

Do we need all four types of security scanning?

For most web and mobile products handling customer data, yes, because each finds a different class of issue. If you must phase them, start with secrets detection and dependency scanning, which are quick to adopt and precise, then add SAST and DAST.

Will security scans slow down our pipeline?

They will if every check runs on every commit. Keep pull request checks fast and focused, run full SAST on merge, and run authenticated DAST nightly or before release against a test environment.

How do we deal with hundreds of findings on day one?

Do not block on them. Run in report-only mode, tune noisy rules, baseline the existing findings with owners and dates, and block only new high-severity issues introduced by each change. Reduce the baseline over time.

Does automated security testing replace penetration testing?

No. Scanners are weak at access control, business logic and multi-step abuse. Use CI scanning for continuous coverage of common issues and schedule manual penetration testing for the rest, especially before major releases.

What should we do if a scanner finds a real password or API key in our repository?

Treat it as an incident. Rotate the credential immediately, check logs for misuse, then remove it from Git history and enable push-time protection so it cannot recur. Deleting it from the latest commit alone is not enough.

Sources and methodology

Guidance reflects PoliteTech delivery experience. The external references below informed specific points in this article.

  1. OWASP: DevSecOps Guideline — accessed 9 November 2026. Pipeline stages for secrets scanning, SCA, SAST, DAST and IaC; advice to start simple, and that CI/CD tooling expands the attack surface.
  2. ZAP: Baseline Scan documentation — accessed 9 November 2026. One-minute default spider, passive-only scanning, WARN/FAIL/IGNORE rule configuration and exit codes for CI use.
  3. GitHub Docs: About secret scanning — accessed 9 November 2026. Full-history scanning, rotation as the recommended response, and availability on public versus private repositories.
  4. NIST: SP 800-218 Secure Software Development Framework (February 2022) — accessed 9 November 2026. SSDF as a core set of secure development practices to reduce vulnerabilities in released software and address root causes.

Are your pipeline’s security checks blocking real risk, or just being ignored?

We can review your CI pipeline and test strategy and propose where automated checks, gates and manual testing should sit so findings get fixed.