Pipeline Security Gates and Policies
You'll learn how to define break-build policies, vulnerability thresholds, and approval workflows that enforce security standards automatically in your CI/CD pipelines.
What Are Security Gates?
Pipeline security gates act as automated checkpoints that your code must pass before proceeding to the next stage or deployment. Think of them like airport security scanners: each bag (code change) must meet safety standards before boarding the plane (production).
Unlike simply scanning for issues, gates make policy decisions—they can stop a build, require manual approval, or allow passage based on predefined rules.
Defining Break-Build Policies
A break-build policy specifies which findings must halt the pipeline:
- Severity thresholds: Block builds containing critical or high-severity vulnerabilities
- Vulnerability types: Always fail on SQL injection or RCE flaws, regardless of severity
- Score-based: Use CVSS scores (e.g., CVSS ≥ 7.0 stops the build)
- New vs. existing: Fail only on newly introduced issues, not technical debt
These policies connect to your scanning tools (SAST, SCA, container scans) and evaluate their outputs against your criteria.
Approval Workflows
Not all issues warrant automatic blocking. Approval workflows handle gray areas:
- Security team review: High-severity findings trigger manual review before deployment
- Risk acceptance: Allow authorized users to create exceptions with documented justification
- Time-bound exemptions: Approve deployments with known issues, but only for 30 days
Workflows integrate with ticketing systems to track decisions and maintain audit trails.
Integration Example
Your pipeline evaluates scan results, applies threshold policies, and routes to approval queues when needed—all before the deploy stage executes.
Key Takeaway: Security gates transform scanning results into enforceable decisions, automatically blocking risky deployments or routing edge cases to human reviewers based on your organization's risk tolerance and compliance requirements.