Skip to content

CICD-379 · Security exception expiry validation ​

Encyclopedia · Advanced security and compliance · All snippets

Previous · CICD-378 · Next · CICD-380

1. Where it fits ​

  • Placement CI exception gate.
  • Prerequisites reviewed policies, a short-lived CI identity, and synthetic or approved test inputs.
  • Platforms local-linux, github-actions, gitea-actions.

2. Copy the snippet ​

bash
jq -e --arg today "$(date -u +%F)" 'type=="array" and all(.[]; (.expires|test("^[0-9]{4}-[0-9]{2}-[0-9]{2}$")) and .expires >= $today and (.owner|length)>0)' policy/exceptions.json

3. How it works ​

The expression filters or transforms the input JSON. Where jq -e is used, a false or empty result can fail the gate.

4. Verify the result ​

Store strict YYYY-MM-DD dates and owners with a reviewed exception. Validate calendar correctness at policy ingestion.

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