Trivy & Grype Scan Policy Gate Design Prompt
Design a CI vulnerability-scanning gate using Trivy and Grype with severity thresholds, ignore policies, and exception governance so builds fail safely on known CVEs.
- Target user
- Platform and DevSecOps engineers wiring image scanning into pipelines
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT
The prompt
You are a senior DevSecOps engineer who builds vulnerability-scanning quality gates that are strict enough to block real risk but pragmatic enough not to stall delivery. I will provide: - Our container registry and CI system (e.g., GitLab CI, GitHub Actions) - Current Trivy/Grype config and any sample scan output - Risk appetite (which severities must block) and SLAs for fixing CVEs Your job: 1. **Baseline** — review the existing scan invocation and identify gaps (no fixed-only flag, missing secret/license scanning, no SBOM input). 2. **Severity policy** — propose a tiered gate: hard-fail on CRITICAL/HIGH with available fixes, warn on MEDIUM, track LOW; explain `--ignore-unfixed` trade-offs. 3. **Exception process** — design a `.trivyignore`/grype ignore file with mandatory expiry dates, ticket references, and owner annotations so suppressions are auditable, not permanent. 4. **Pipeline wiring** — show the exact CI steps including SBOM generation (CycloneDX), caching of the vuln DB, and exit-code handling. 5. **Drift control** — recommend scheduled rescans of already-deployed images so newly disclosed CVEs are caught after build time. 6. **Reporting** — output SARIF for code-scanning dashboards and a human summary. 7. **Rollout** — phase the gate from warn-only to enforcing with a deadline. Output as: (a) a policy table by severity, (b) annotated CI config, (c) an exception-file template, (d) a 4-week enforcement rollout plan. Flag any suppression that lacks an expiry or owner; recommend starting in non-blocking mode in a feature branch before enforcing on the default branch.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
Dependency Pinning & Lockfile Integrity Prompt
Harden the software supply chain by enforcing pinned, hash-verified dependencies and lockfile integrity across language ecosystems to block tampering and unexpected upgrades.
-
Ansible Playbook & Vault Security Review Prompt
Review Ansible playbooks and roles for plaintext secrets, unsafe privilege escalation, and host-key/command-injection risks, and produce a hardened Vault, become, and templating configuration.
-
Consul ACL & Gossip Encryption Hardening Review Prompt
Review a HashiCorp Consul cluster for open ACLs, unencrypted gossip and RPC, and over-broad tokens, and produce a hardened default-deny ACL, TLS, and encryption configuration.
-
Container Registry Authentication & Access Hardening Review Prompt
Review a container registry and its pull/push credentials for anonymous access, long-lived tokens, and over-broad scopes, and produce a hardened authentication, image-pull-secret, and access-control design.
More DevOps Security & Hardening prompts & error guides
Browse every DevOps Security & Hardening prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.