Skip to content

CICD-492 · Mandatory security gates ​

Encyclopedia · Pipeline governance and operational management · All snippets

Previous · CICD-491 · Next · CICD-493

1. Where it fits ​

  • Placement CI image security gate.
  • Prerequisites trusted policy checkout and normalized deployment events with scoped access.
  • Platforms local-linux, github-actions, gitea-actions.
  • Parameters CANDIDATE_IMAGE.

2. Copy the snippet ​

bash
trivy image --exit-code 1 --severity HIGH,CRITICAL "${CANDIDATE_IMAGE:?}"

3. How it works ​

Trivy gates the deployed digest on the chosen severity levels. Tying the scan to a candidate digest prevents a later tag update from invalidating the result.

4. Verify the result ​

Scan the exact candidate digest and use a documented, expiring exception policy.

Validation syntax-validated (Bash parse). Status definitions.