cloud-infra: add trivy-scan skill and wire it into verification gates#1
Merged
Merged
Conversation
Adds a dedicated trivy-based security scanner as a first-class skill in
cloud-infra and makes it a mandatory gate in the existing verification
workflow.
New skill: /trivy-scan
- Runs `trivy config` against the Terraform tree and Helm charts
- Honours a `.trivyignore` in the Terraform root, with a convention that
every suppression must carry a justifying comment
- Preflights the trivy binary and prints an install hint (brew / curl)
if missing — never auto-installs
- Severity gating: fails on CRITICAL/HIGH/MEDIUM by default; --strict
includes LOW; --warn-only never exits non-zero
- Reusable `scripts/scan-trivy.sh` consumed by other skills via
`bash {plugin-skills-path}/trivy-scan/scripts/scan-trivy.sh`
Wired into existing skills
- /infra-lint: invokes /trivy-scan as the final step, adds a new quality
gate row in the output
- /complete-infra: adds Track D (security scan) to Phase 1's parallel
lint, adds a quality gate row
Agent updates
- infra-reviewer: new "Scanner Correlation (trivy)" section. The agent
no longer re-runs the scanner; instead it sanity-checks the
.trivyignore justifications against the current diff (catches
obsolete suppressions, missing reasons, rules targeting deprecated
resources).
Docs / versioning
- cloud-infra version 0.1.0 -> 0.2.0
- cloud-infra README skills table updated
- Top-level README: skill count badge + headline 29 -> 30
- Added `trivy` and `security-scanning` keywords to plugin.json
Motivation
Discovered during issue #15 (SparkReach F01 Azure infra): `terraform
validate` and `helm lint` don't see AZU-0013/0022 (public KV/Postgres),
AZU-0019/0024 (missing Postgres audit logging), or AZU-0015
(unclassified KV secrets). The infra-reviewer agent is good for
judgement calls but doesn't apply Aqua's curated rule library.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/trivy-scanskill undercloud-infrathat runstrivy configagainst Terraform modules and Helm charts./infra-lintinvokes it as a final step, and/complete-infraruns it as a parallel track in Phase 1 alongside format/validate/helm-lint.infra-revieweragent to correlate.trivyignoresuppressions with the current diff instead of re-running the scanner.Why
Working through SparkReach F01 Azure infra (issue surfaced in my
sparkreachrepo),terraform validateandhelm lintdidn't catch:AZU-0022,AZU-0013)AZU-0019,AZU-0024)AZU-0015)The
infra-revieweragent is great for judgement calls but doesn't carry Aqua Security's curated IaC rule library.trivy configdoes, and takes seconds. The gap felt like a missing verification gate incloud-infra.Changes
New skill:
plugins/cloud-infra/skills/trivy-scan/SKILL.md— user-invocable; arguments--strict,--warn-only,--severity; documents the.trivyignoreconvention (every suppression must have a justifying comment).scripts/scan-trivy.sh— reusable script, consumed from other skills viabash {plugin-skills-path}/trivy-scan/scripts/scan-trivy.sh.trivybinary, prints brew / curl install hints if missing (never auto-installs)..trivyignoreat$TF_PARENT/.trivyignoreor$(dirname $CHARTS_PATH)/.trivyignore.CRITICAL,HIGH,MEDIUM.TRIVY_STRICT=1addsLOW.TRIVY_WARN_ONLY=1makes it non-blocking.Wired into existing skills
infra-lint— new "Security Scan" section that invokes/trivy-scan, new quality-gate row.complete-infra— Phase 1 gains Track D (security scan) running in parallel with fmt/validate/helm-lint; quality-gate output updated.Agent update
infra-reviewer— new "Scanner Correlation (trivy)" section. The agent no longer re-runs trivy; it sanity-checks the.trivyignorejustifications against the current diff and flags:AZU-0026is Single-Server only, misfires on Flexible Server)Docs / versioning
cloud-infraplugin0.1.0→0.2.0, addedtrivyandsecurity-scanningkeywords.cloud-infra/README.mdskills table updated.README.mdskill count badge and headline29→30.Test plan
scan-trivy.shagainst a real Terraform tree (SparkReachdeploy/terraform/): correctly picks up.trivyignore, suppresses justified items, exits 0 on clean./trivy-scandirectly from a consumer project after plugin update./infra-lintand confirm the new trivy gate appears in the output./complete-infraand confirm Track D runs in parallel with the other lint tracks.Notes
trivyis intentionally not auto-installed. The script prints the install command and exits non-zero — consistent with howlint-helm.shhandles a missinghelmbinary..trivyignorewith obsolete rules.Generated with Claude Code