Repository navigation
feat: vet ami-scan — deep AMI content scanning, end to end — vet#32 slice 6 - #38
Merged
Merged
Conversation
…ice 6 The CLI that ties the amiscan pipeline together. vet ami-scan <ami-id> --helper-instance i-… --az … --scan-bucket … resolves the AMI's backing snapshot, mounts a copy read-only on the operator's helper instance, syfts the filesystem, and stores the SBOM at the AMI's CycloneDX store path — where `vet verify <ami-id> --check-cves <level>` reads it (AMIs auto-route to the distro-aware grype scanner from slice 2). vet creates a volume + attachment and tears them down when done (deferred release, even on error) — never the helper instance, never the AMI's own snapshot. Validation guards (non-AMI ref, missing helper/az/bucket) run before any AWS call. Updates README (the stale "not yet generated by vet" note becomes the ami-scan section) and CHANGELOG. Live validation against a real AMI follows. Tests: cmd/vet/ami_scan_test.go — arg/flag validation matrix + help-documents- prereqs. Full suite green.
4 tasks
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.
Sixth slice of vet#32 — the CLI that ties the pipeline together. Closes the AMI deep-content-scan gap end to end (the last open item of the AMI-gating epic, #13). Code half here; live validation follows in the same effort.
What
ami-scanrunsamiscan.NewLive: resolve the AMI's backing snapshot → create+attach a volume → SSM-mount read-only + syft → download the CycloneDX SBOM → store it at the AMI's SBOM path, where the existingverify --check-cves(slice 2: AMIs auto-route to the distro-aware grype source) reads it.--helper-instance/--az/--scan-bucket.Tests
cmd/vet/ami_scan_test.go: the validation matrix + a help-documents-the-prereqs check.Docs
README's stale "deep AMI-content scanning … not yet generated by vet" note becomes the real
vet ami-scansection. CHANGELOG updated.Live validation (next, this same effort)
Against a real AL2023 AMI: stand up a throwaway SSM+syft helper + an S3 staging bucket, run
ami-scan, confirm the SBOM + a grype-scannedverify, then tear everything down with verification (helper, bucket, and confirm vet's own scan volume was released). Results posted to vet#32.