
Essay CI/CD Pipelines
Dependency Vulnerability Scanning in CI Before Deployment
A tiered CI scan blocks fixable critical flaws without alert fatigue.
Dependency vulnerability scanning belongs in CI, before deployment, where a fixable flaw can stop a risky merge and prevent a production problem. The setup should scan dependencies and container images, block findings that need a stop, and create a software bill of materials to use as audit evidence. The goal is to catch known risk without teaching developers to ignore the scanner.
Why dependency scanning belongs in the CI pipeline, not after deployment
A pipeline can pass unit tests, integration tests, and linting while shipping dependencies with critical vulnerabilities and published patches. Passing them does not establish that the packages underneath the application are safe. Without that check, known flaws with patches play no part in the decision to release, even when tools could flag them before merge.
The timing of discovery changes the cost. Fixing a vulnerability during development is cheaper than fixing it in production, and discovering it during an active incident is more expensive still. A pull request gives the team a chance to deal with the dependency before deployment. Scanning only after release gives up that advantage. Runtime monitoring remains necessary, but it cannot replace a check at the point where the team can still stop the change.
The case also extends beyond incident prevention. In 2026, SOC 2 Type II audits, PCI DSS v4, and enterprise procurement questionnaires routinely ask whether security scanning is integrated into development and how findings are tracked. A tool installed somewhere is not the same as a working control. The pipeline needs to connect detection with a release decision and retain evidence of what happened to the finding.
What dependency scanning actually examines, and where most teams fall short
Source-level scanning reads lockfiles and checks direct and transitive dependencies against known vulnerabilities. Transitive dependencies are packages pulled in indirectly by other packages. They deserve more than a passing check. Over 80 percent of exploitable CVEs come from these indirect dependencies, so a scanner must resolve the full dependency tree rather than inspect only the packages named in a manifest.
Container scanning covers what source scanning leaves out. It examines OS packages and application dependencies introduced during the Docker build, including packages added in image layers. A clean lockfile scan gives no information about those added packages.
Runtime monitoring covers a different gap in time. It detects newly disclosed CVEs after a build has already reached production, when the earlier scan could not have known about them. Together, these checks cover source dependencies, the built image, and the deployed environment. Software Composition Analysis, or SCA, is the category name for comparing the resolved dependency graph with vulnerability databases such as NVD, OSV, and GHSA. Most teams cover only the first layer, leaving their scan results incomplete even when accurate.
Choosing a scanner: Trivy, Grype, Snyk, and ecosystem-native tools compared
For most teams starting in 2026, Trivy is the practical baseline. It is free and open source, scans containers, filesystems, git repositories, and Terraform, and generates SBOMs without a separate licensing decision. Its Aqua OSS DB is updated frequently, though findings still need triage because its false-positive rate is moderate.
Budget and remediation needs can change that choice. Snyk offers a proprietary curated database, the lowest false-positive rate among the options described here, deep remediation guidance, reachability analysis, and native IDE and CI plugins. Its free tier is limited, while its Team tier is paid. Even then, relying solely on one proprietary database limits portability, so open standards such as OSV remain useful unless a contract requires otherwise.
A single-stack team has a simpler starting point. Node.js has npm audit, Python has the official PyPA tool pip-audit, Go has govulncheck with call-graph reachability, and Rust has cargo audit backed by RustSec. These tools catch most known vulnerabilities in their respective ecosystems without additional setup. On GitHub, Dependabot adds free dependency monitoring and automated security PRs, but it works best with a scanner such as Trivy or Grype.
Compliance needs may justify broader coverage. OWASP Dependency-Check is free and open source, uses standardized product identifiers for matching, covers several ecosystems, and produces HTML and JSON reports. Teams use it in workflows to comply with the EU Cyber Resilience Act, although the law does not name it. For high-compliance environments, Trivy provides breadth and speed while Grype adds precision on OS-level packages. Caching their vulnerability databases keeps the extra time spent scanning low.
The CVE volume problem and why naive thresholds cause alert fatigue that breaks the pipeline
CVE disclosures rose substantially in 2025, making raw finding counts a poor basis for triage. A long report is not a risk ranking. JFrog’s 2026 supply chain report reviewed a large sample of high-profile CVEs and found that roughly one in eight were genuinely exploitable. That finding shows why treating every alert as an equally urgent failure wastes attention, even while the others remain relevant.
CVSS scores show severity, which is only part of the decision. Teams also need to know whether the application calls the vulnerable code path, whether mature exploit code exists, and whether a patched version is available. Blocking every finding ignores those distinctions. When the checks get in the way, developers are more likely to bypass them, so a gate that could help becomes background noise. Alert fatigue is a configuration failure in scanning that remains valuable.
NIST announced in April 2026 that it would stop enriching most CVE submissions and move the National Vulnerability Database to risk-based enrichment. That work would cover CVEs in the CISA Known Exploited Vulnerabilities catalog, in federal software, and in critical software as defined by Executive Order 14028. NVD-only scanners therefore have meaningful blind spots for application vulnerabilities in web frameworks and JavaScript, PHP, and Python packages. The practical response is to prefer scanners that supplement NVD with aggregated OSV, GHSA, and vendor feeds.
Fixing a vulnerability during development is cheaper than fixing it in production, and discovering it during an active incident is more expensive still.
Setting severity thresholds that block real risk without halting deployments over noise

A useful default is a tiered policy. CRITICAL findings, with CVSS scores of 9.0 or higher, hard-fail the build and block merge when a patched version exists. HIGH findings add a PR comment but let the merge go ahead. MEDIUM and LOW findings stay in reports for scheduled triage, with no added comments or failures.
Fix availability belongs in the blocking rule. A team that wants a stricter gate can block both HIGH and CRITICAL findings, but should still do so only when a patch is available. When a fix is missing, the vulnerability remains a risk and blocking a merge cannot produce the dependency upgrade the rule is asking for. When a team accepts a risk, it should record why in machine-readable suppression rules, such as Trivy’s .trivyignore or Grype’s ignore rules, and keep the check running.
To put that policy into practice, the job should run on push and pull requests, with the dependency check before the container build. Cache the vulnerability database through actions/cache to reduce network flakiness and API rate limits. Scan the lockfile first for fast feedback, then scan the built image separately for packages introduced by the Dockerfile layers. In Trivy, a strict HIGH and CRITICAL gate uses an exit code of 1 and blocks only findings that have a fix. Lower-severity results can go to the GitHub Security tab as SARIF without stopping the PR.
Release evidence and later discoveries need their own place in that workflow. Generate an SPDX or CycloneDX SBOM as a release artifact, and add a weekly scheduled scan to catch CVEs disclosed after the last build. Separate concurrent jobs for SAST, SCA, and secrets detection keep independent checks from running one after another. These choices affect cost as well as feedback speed. In one documented case of Terraform security-scanning, scanning only what each merge changed, instead of the full repository, cut the cost per year to approximately $126.
Generating SBOMs as compliance artifacts, not just scan byproducts
An SBOM is a software inventory that leaves the software’s security unproven. Its compliance value comes from recording what is in a release and linking that inventory to vulnerability findings and review decisions. SPDX and CycloneDX are open formats supported natively by Trivy and Grype, and are preferable to proprietary formats for portability across tools and auditors. The format is only the starting point. Generating the inventory during CI makes it part of the release process rather than something assembled manually when an auditor asks.
Anchore’s compliance research maps software inventory needs across PCI DSS 4.0.1, SOC 2, the proposed HIPAA Security Rule, NIST SP 800-218, and ISO/IEC 27001:2022. The same inventory artifact can help meet the needs those frameworks share, but each framework has other obligations to meet. Executive Order 14028, the EU Cyber Resilience Act, and NIST SP 800-218 also include requirements related to component tracking and SBOM generation. The distinction is important for audit planning. An SBOM shows what is in the software, while the evidence around it shows how the team dealt with known risks.
For SOC 2 Type II, manual screenshots of scan results do not scale. The practical approach is to send scan summaries and SBOM metadata to a centralized store, such as S3, Azure Blob, or a compliance platform, linked to change management records. Generating the SBOM before scanning makes the relationship especially clear because the scan uses the inventory that becomes the compliance record. Grype with Syft supports this SBOM-then-scan pattern. A critical-finding gate then gives the record more substance than a log showing that a warning appeared and the release shipped anyway.
What 2026's supply chain incidents reveal about the limits of CVE-based scanning
CVE-based scanning catches known, catalogued vulnerabilities, with coverage of malicious packages and compromised release processes remaining limited regardless of configuration. A package with no known CVE can still contain hostile code. That limitation means a clean report provides only a partial security verdict.
The March 2025 tj-actions/changed-files compromise, CVE-2025-30066, exposed the danger of mutable version tags. Attackers moved tags to a malicious commit, which exposed secrets through workflow logs and may have affected over 23,000 repositories. CISA’s advisory named valid access keys, GitHub Personal Access Tokens, npm tokens, and private RSA keys among the exposed secrets. The trusted workflow component was itself the attack path.
The 2026 incidents extended that lesson into release infrastructure. In TanStack’s May compromise, a poisoned pnpm cache in the release job was used to publish packages that contained a supply chain worm. Socket’s AI Scanner detected it within six minutes, but an accurate inventory showing @tanstack/router with no known CVEs would not have identified the malicious code. AsyncAPI’s July 14 attack exploited a misconfigured pull_request_target workflow to steal the highly privileged asyncapi-bot GitHub personal access token. No npm publish token was stolen. The attacker used the bot token to push malicious commits and let the project’s OIDC trusted-publisher pipeline publish them.
NVIDIA GPU driver flaws NvRoot and ForgePtr, disclosed in November 2026 and present since 2022, allowed unprivileged users with GPU access on a shared host to gain root. An August 2026 audit also found NVIDIAScape still exploitable at one neocloud provider despite a July 2025 patch. Package scanning alone cannot stand in for attention to the environment running the workload.
Pin GitHub Actions and third-party dependencies to immutable commit SHAs rather than mutable tags, and use lockfiles with cryptographic hashes. Audit pull_request_target permissions and treat the CI environment itself as an attack surface. A small team can phase in secrets detection, dependency scanning, SAST, and then DAST without waiting for a dedicated security engineer.


