/devsecops-skills:secure-cicd-gatesfrom devsecops-skills
Designs coherent security gates across CI/CD pipelines sequencing SAST, SCA, secret-scanning, DAST, container scanning, and policy checks into ordered stages with block-vs-warn thresholds.
Ships in devsecops-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Individually adding SAST, SCA, secret-scanning, DAST, container scanning, and policy checks to a pipeline is necessary but not sufficient — without a deliberate design, teams end up with checks that run at the wrong stage (a 45-minute DAST scan blocking every PR), gates that duplicate each other's coverage (three tools all flagging the same hardcoded secret), inconsistent blocking thresholds (one tool blocks on medium severity, another only on critical), and no clear escalation path when a finding is legitimately hard to fix immediately. This skill is about the orchestration layer: sequencing individual scan types into stages with consistent severity thresholds, deciding what blocks a merge versus what blocks a production deploy versus what's advisory, and building the triage/exception workflow that keeps the whole pipeline trustworthy rather than something developers route around.
needs:, GitLab CI stages:, Jenkins pipeline
stages) and the ability to mark checks as required vs. optional
status checks on a PR.Map scan types to pipeline stages by cost and blast radius, fastest and cheapest first:
Define one severity-to-action table and apply it consistently across tools instead of letting each tool's default thresholds stand independently:
| Severity | PR merge gate | Release gate | SLA to fix |
|-----------------|--------------------|----------------------|------------------|
| Critical | Block | Block | 48 hours |
| High | Block (new code) | Block | 2 weeks |
| Medium | Warn (PR comment) | Warn, tracked ticket | 90 days |
| Low/Info | Report only | Report only | Best effort |
Wire required status checks to match exactly this table — don't mark a tool as a "required" GitHub check if its default behavior would block on medium/low findings; configure the tool's own exit-code behavior to match the table first.
# Example: consistent exit-code gating across tools in one job
jobs:
security-gate:
runs-on: ubuntu-latest
needs: [sast, sca, secret-scan]
steps:
- name: Evaluate combined gate
run: |
python3 scripts/gate_check.py \
--sast sast-results.sarif \
--sca sca-results.json \
--secrets gitleaks-report.json \
--fail-on critical,high
Separate PR gates from release gates explicitly — a PR gate
protects code entering main; a release gate protects what reaches
production and can afford to be stricter and slower (e.g. include a
DAST baseline scan against a preview environment that wouldn't be
practical to run on every single commit).
Give every blocking finding a suppression/exception path with an expiry, consistent across tools (see the per-tool skills for tool-specific suppression syntax) — a gate with no legitimate escape hatch gets bypassed by disabling the whole check instead.
Consolidate reporting — export SARIF from SAST/DAST/IaC tools and JSON from SCA into one dashboard (GitHub code scanning, a SIEM, or a dedicated AppSec tool like DefectDojo) so a developer or reviewer checks one place, not four.
Review the gate design itself periodically (quarterly is reasonable) — check false-positive rate, time-to-fix against the SLA table, and whether any check has become a rubber stamp because it never actually blocks anything.
Symptom: Every PR takes 40+ minutes because SAST, full SCA, and a DAST scan against a spun-up preview environment all run synchronously on every commit. Fix: Split into fast/blocking PR-time checks (diff-aware SAST, dependency scan, secret scan — should complete in a few minutes) and slow checks (DAST, full-repo sweeps) that run on a schedule or at release time instead of every commit.
Symptom: Three different tools (a SAST rule, a dedicated secret-scanner, and the SCA tool's license scanner) all separately flag the same hardcoded value, and developers see triplicate noise for one real issue. Fix: Assign each finding category to exactly one primary tool (e.g. secret-scanning owns secret detection; disable overlapping secret-detection rulesets in the SAST tool) and consolidate into one report instead of running fully overlapping checks blind to each other.
Symptom: A critical finding blocks a release, engineering leadership overrides the gate to ship on a deadline, and there's no record of the override or follow-up commitment. Fix: Build an explicit, auditable override mechanism (a documented emergency-bypass process requiring named sign-off and an auto-created follow-up ticket with a deadline) rather than an informal "an admin disabled the check" workaround that leaves no trail.
Symptom: A required status check has been red for months because the underlying tool is too noisy, and PRs merge via admin override so routinely that the check is effectively decorative. Fix: This is a signal to fix the noise (better rules, diff-aware scanning, tuned suppressions) or formally reclassify the check as non-blocking — a permanently-overridden "required" check trains the team to ignore red X's generally, including on checks that matter.
Symptom: Security wants to add a new blocking gate; engineering pushes back that it will break every in-flight PR on rollout day. Fix: Roll out new gates in warn-only/report mode first (mirroring the audit-mode pattern from policy-as-code-guardrails), review the hit rate for a representative period, then flip to blocking once the false-positive rate is acceptable.
A team designs a four-stage gate structure for a containerized service.
Stage table (documented in the repo, e.g. docs/security-gates.md):
| Stage | Checks | Blocking on |
|----------------------|------------------------------------------|-----------------------|
| Pre-commit | Gitleaks (secrets) | Any match |
| Pull request | Semgrep SAST (diff), Trivy SCA (fs), | Critical/High (new) |
| | Conftest IaC policy | |
| Merge to main | Trivy image scan, Syft SBOM, cosign sign | Critical/High |
| Release (pre-prod) | ZAP baseline DAST vs. preview env | High-risk/High-conf |
| Nightly | ZAP full scan, full-repo SAST/SCA sweep | Report only (ticketed)|
.github/workflows/pr-gates.yml:
name: pr-security-gates
on: [pull_request]
jobs:
sast:
runs-on: ubuntu-latest
container: { image: semgrep/semgrep:1.78.0 }
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 0 }
- run: semgrep ci --config p/owasp-top-ten --baseline-commit "${{ github.event.pull_request.base.sha }}"
sca:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: aquasecurity/[email protected]
with: { scan-type: 'fs', severity: 'CRITICAL,HIGH', exit-code: '1', ignore-unfixed: true }
iac-policy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: terraform plan -out=plan.tfplan && terraform show -json plan.tfplan > plan.json
- run: conftest test plan.json --policy policies/
gate-summary:
needs: [sast, sca, iac-policy]
if: always()
runs-on: ubuntu-latest
steps:
- name: Fail if any required gate failed
run: |
if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" ]]; then
echo "One or more blocking security gates failed."
exit 1
fi
gate-summary becomes the single required PR status check, so branch
protection references one job instead of three independently-configured
checks that could drift out of sync.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
devsecops, pipeline-security, security-gates, ci-cd-security, sast, sca
17 skills in this plugin
/checkov-and-tfsec-iac-security-scanningConfigures Checkov and tfsec to scan Terraform/CloudFormation/Kubernetes IaC source for misconfigurations — hardcoded secrets, overly permissive IAM policies, unencrypted storage, open security groups — before `terraform apply` or `aws cloudformation deploy` ever runs. Use when a user asks to "scan my Terraform for security issues," "add Checkov/tfsec to CI," "find overly permissive IAM in my IaC," "write a Checkov suppression," "compare Checkov and tfsec," or "catch misconfigured cloud resources before they're provisioned."
/complete-devsecops-pipeline-for-kubernetes-from-scratchBuilds the complete security-gate sequence for a Kubernetes-targeted DevSecOps pipeline from scratch — SAST, SCA, container image scanning, a policy-as-code (OPA/Kyverno) admission gate placed before the GitOps handoff, and a secrets model where plaintext credentials never touch the pipeline because an External Secrets Operator pulls them cluster-side instead. Use when the user asks to "build a DevSecOps pipeline for Kubernetes from scratch," "add a policy gate before our GitOps commit," "make sure secrets never touch CI for our K8s deploys," or "sequence SAST/SCA/image-scan/policy gates for a container pipeline end-to-end."
/complete-devsecops-pipeline-for-serverless-from-scratchBuilds the complete security-gate sequence for a serverless (Lambda- style) DevSecOps pipeline from scratch — SAST, SCA against a much larger bundled transitive-dependency surface, package/artifact signing, and least-privilege execution-role scoping as the primary release gate (rather than a Kubernetes-style admission policy), with runtime secrets fetched from a managed secrets service instead of baked into the deployment package. Use when the user asks to "build a DevSecOps pipeline for a Lambda function from scratch," "gate a serverless release on execution-role scope instead of admission policy," "sign a Lambda deployment package," or "make sure a Lambda function's secrets aren't baked into its zip."
/complete-devsecops-pipeline-for-vm-based-workloads-from-scratchBuilds the complete security-gate sequence for a VM-based DevSecOps pipeline from scratch — SAST, SCA, golden-image scanning and CIS benchmark hardening baked into the machine image itself, config- management-applied secrets via Ansible Vault (never plaintext), and an ongoing patch/drift-detection gate that runs independently of any single deploy, distinct from the per-deploy scanning in the Kubernetes and serverless variants. Use when the user asks to "build a DevSecOps pipeline for EC2/VM workloads from scratch," "harden a golden AMI to CIS benchmarks in the pipeline," "apply secrets with Ansible Vault instead of plaintext," or "add ongoing patch/drift detection for a VM fleet."
/container-image-hardeningGuides building minimal, non-root, hardened container images — multi-stage builds, distroless/minimal base images, non-root users, read-only root filesystems, dropped Linux capabilities, and pinned/ digest-referenced base images. Use when the user asks to "harden this Dockerfile", "reduce container image attack surface/size", "make our container run as non-root", "switch to a distroless base image", "fix a container security scan finding about running as root or having a shell", or "set Kubernetes securityContext restrictions for a pod".
/critical-vulnerability-emergency-responseGuides the accelerated, out-of-band response when a critical CVE is publicly disclosed in a widely-used dependency, library, or platform component — rapid exposure assessment across the fleet, patch or temporary mitigation, verification, and closeout. Use when the user says "a critical CVE just dropped in X", "we need to check if we're affected by CVE-YYYY-NNNNN", "log4shell-style emergency patching", "zero-day just disclosed in our dependency", or "run an emergency vulnerability response". Distinct from the steady-state finding-queue management in security-finding-backlog-triage — this is the fire-drill process for one urgent, time-critical disclosure.
npx claudepluginhub selvarajmurugesan90/ops-engineering-skills --plugin devsecops-skillsOther plugins' skills for the same job