A secure CI/CD pipeline should identify risks early without turning every warning into a failed release. This practical DevSecOps pipeline checklist maps dependency scanning, secret detection, container security scanning, infrastructure-as-code analysis, license checks, and deployment approvals to the stages where they provide the most value. Use it when creating a repository, auditing an existing workflow, or changing a security policy.
Overview
DevSecOps works best when security checks are part of normal delivery rather than a separate inspection at the end. Each check should have a clear input, an accountable owner, a severity policy, and a defined response. The goal is not to make every pipeline stop for every finding. The goal is to prevent unacceptable risk from reaching the next environment while giving developers a practical path to remediation.
A useful pipeline separates findings into at least three categories:
- Release-blocking: A confirmed secret, an exploitable critical vulnerability, a dangerous infrastructure change, or a prohibited license may require the job or deployment to stop.
- Review-required: A high-severity issue, an unexpected permission change, or a package with uncertain reachability may require human approval before release.
- Track-and-fix: Lower-risk issues, development-only findings, and accepted exceptions can be recorded with an owner and due date without blocking routine work.
These categories should reflect your application's risk, data sensitivity, deployment exposure, and recovery options. Do not copy thresholds from another team without checking those assumptions. A small internal service and a public-facing production system may reasonably use different gates.
Checklist by scenario
1. Pull request and pre-merge checks
Run fast checks before code is merged. The purpose of this stage is to provide feedback while the change is still easy to understand and revise.
- Dependency scanning: Inspect manifest and lock files for known vulnerable packages, unexpected version changes, and dependencies that are no longer maintained according to your chosen policy. Include direct and, where supported, transitive dependencies.
- Secret detection: Scan changed files and relevant repository history for API keys, tokens, private keys, passwords, and connection strings. Treat a confirmed secret as compromised: revoke or rotate it rather than merely deleting the line.
- License checks: Compare new or changed dependencies with the licenses your project permits. Send ambiguous results to review instead of silently allowing or rejecting them.
- IaC analysis: Scan Terraform, Kubernetes manifests, Helm values, and other supported configuration files for public exposure, excessive permissions, missing encryption settings, unsafe defaults, and unpinned or weakly controlled inputs.
- Policy visibility: Post concise results in the pull request, identify the affected file and package or resource, and link to remediation guidance.
Keep pre-merge checks focused. A long list of noisy warnings trains developers to ignore the results. For broader context, pair this checklist with a documented dependency update workflow so routine upgrades have owners and review rules.
2. Build and artifact checks
The build stage should verify what will actually be shipped, not only what appears in source files.
- Generate a repeatable build from a controlled runner and record the commit, dependency inputs, and artifact identifier.
- Scan the produced container image, archive, or package for operating-system and application vulnerabilities.
- Check image layers and build output for embedded credentials, debug content, unnecessary tools, and files that should not enter production.
- Confirm that the artifact is traceable to the source revision and that promotion uses the same artifact rather than rebuilding silently.
- Retain scan results with the build record so a later incident can be investigated.
Container scanning is most useful when findings are connected to a remediation path: update the base image, rebuild the affected dependency, remove an unnecessary package, or document a time-bounded exception. The related Docker image security scanning remediation workflow can serve as a companion process.
3. Infrastructure and deployment checks
Infrastructure-as-code security scanning should run before changes are applied and, where practical, again against the rendered configuration. Rendering matters because templates, variables, and overlays can change the final permissions or network exposure.
- Scan Terraform plans or equivalent plans when the tool supports plan-aware analysis.
- Check for public endpoints, unrestricted ingress, broad identity permissions, exposed state or credentials, and missing encryption or logging settings.
- Review Kubernetes manifests for privileged containers, host access, weak isolation, exposed services, and missing resource or security controls appropriate to the workload.
- Require a second reviewer for changes to identity, network boundaries, production data stores, or security controls.
- Keep deployment credentials outside source control and restrict them to the environment and actions they need.
Deployment approval should be based on risk, not on habit. Low-risk, reversible changes can use automated promotion when checks pass. Changes that alter access, data handling, or blast radius deserve explicit review. If the release strategy supports canary or blue-green delivery, use that control to limit exposure while monitoring the result; see the blue-green and canary deployment guide for the operational trade-offs.
4. Post-deployment verification
Security is not finished when a deployment succeeds. Verify that the intended controls are present in the running environment.
- Confirm the deployed image or artifact matches the approved build.
- Check that health, audit, access, and security logs are being emitted and retained according to your operational needs.
- Monitor for unexpected outbound connections, authentication failures, privilege changes, and configuration drift.
- Record exceptions, approvals, and rollback decisions in the deployment system or incident record.
Make alerts actionable rather than merely numerous. The Prometheus alert design guide offers useful principles for connecting detection to an owner and response.
Decision table for common findings
| Finding | Default pipeline response | Follow-up |
|---|---|---|
| Confirmed credential or private key | Stop the affected path and prevent use of the credential | Revoke, rotate, investigate exposure, and remove the secret from future builds |
| Critical or directly exploitable dependency issue | Block release unless an approved exception exists | Upgrade, replace, isolate, or document compensating controls |
| High-risk container package | Require remediation or security review | Rebuild the image, reduce packages, or set a short exception deadline |
| Unsafe Terraform or Kubernetes setting | Block changes that cross a defined production boundary | Correct the configuration and review the resulting plan or rendered output |
| License conflict or unknown license | Hold the dependency for legal or policy review | Replace, obtain approval, or record the permitted use |
| Low-confidence or development-only finding | Report without automatically blocking | Triage, suppress narrowly if appropriate, and assign ownership |
What to double-check
- Tool coverage: Confirm the scanner supports the languages, manifest formats, lock files, image types, Terraform versions, Kubernetes resources, and template formats actually used by the repository. A check that silently skips an unsupported file creates false confidence.
- Configuration scope: Review ignored paths, excluded severities, allowlists, suppression files, and baseline settings. Every exception should have a reason, owner, and review date.
- Severity meaning: Vendor severity is an input, not a complete release policy. Consider exploitability, internet exposure, privileges, reachable code, sensitive data, and available mitigations.
- Branch behavior: Ensure pull requests, scheduled scans, release tags, and emergency fixes use consistent policies. A check that runs only on the default branch may discover issues too late.
- Credential boundaries: Verify that pull-request jobs from untrusted forks cannot access production secrets or privileged deployment credentials.
- Failure handling: Decide what happens when a scanner is unavailable. Fail closed for especially sensitive deployment paths, or fail with a clearly visible warning and follow-up owner where continuity is more important.
- Evidence: Retain enough logs and metadata to explain what was scanned, with which configuration, and why a release was allowed.
Common mistakes
Blocking every finding. A universal hard gate creates pressure to disable the tool. Start with a small set of material release blockers, then expand as triage quality improves.
Scanning only source code. Dependencies, generated files, container layers, deployment plans, and runtime configuration can introduce risks that a source-only scan will miss.
Deleting a detected secret. Removal from the current commit does not invalidate a credential that may already have been copied or logged. Rotate it and review access records.
Using broad suppressions. Suppressing an entire rule, directory, or package can hide future regressions. Prefer a narrow exception with an explanation and expiry.
Ignoring the rendered deployment. A secure template can produce an unsafe result when variables, overlays, or defaults change. Review the final plan or manifest.
Leaving ownership undefined. Security findings without an owner become backlog noise. Route each category to a team, service owner, or release approver and define an escalation path.
When to revisit
Review this DevSecOps pipeline checklist before seasonal planning cycles, after a significant incident, and whenever workflows or tools change. Also revisit it when a repository adds a language, package manager, container base image, cloud account, Kubernetes cluster, or production data path.
At each review, confirm the scanner integrations, supported file formats, severity thresholds, suppression rules, credential boundaries, and approval requirements. Test the pipeline with safe examples: a deliberately vulnerable test dependency, a non-production secret pattern, an insecure infrastructure fixture, and a prohibited license fixture. The test should verify both detection and the expected response.
Finish with a short audit record:
- List which checks run at pull request, build, deployment, and runtime stages.
- Record which findings block, require review, or create tracked work.
- Assign owners for unresolved findings and exceptions.
- Verify that artifacts, scan results, approvals, and deployment identities are traceable.
- Schedule the next review when the next policy, platform, or workflow change is expected.
Security controls remain useful when they are understandable, proportionate, and maintained. Treat this checklist as a living part of your release process, not a one-time compliance document.