Repository navigation
feat(policies): AMI-launch gating SCPs (provabl#13, slice 1) - #18
Merged
Merged
Conversation
Layer-1 IAM enforcement for the AMI-gating epic: only vetted AMIs may launch, and only the vetter may mark one vetted. - ami_launch_gating_scp.json — Deny ec2:RunInstances unless the AMI carries ec2:ResourceTag/attest:vetted == "true". Deny scoped to the image ARN (arn:aws:ec2:*::image/*) so the tag condition evaluates only against the AMI; a Resource:"*" scope would also match the instance/volumes/ENIs the call creates (which lack the tag) and deny every launch. - ami_vetting_lockdown_scp.json — Deny CreateTags/DeleteTags of the attest:vetted key on AMIs except the designated vetter (ArnNotLike aws:PrincipalArn). Solves the trust trap: a researcher can't self-mark an AMI vetted (same principle as qualify#32's locked attest:* tags). Vetter ARN is a deploy-time placeholder ground/vendor substitutes per account. - Tests mirror the nitro SCP test, with regression guards for the image-scope and the vetter exception (verified both fail when violated). The runtime half (PCR0 proving the booted image) already exists in nitro/nitrotpm. Deferred follow-ups: vet writing attest:vetted (AMI vetting), and vendor deploying these SCPs into vended accounts. Refs: #13
scttfrdmn
added a commit
to provabl/vet
that referenced
this pull request
Jun 11, 2026
vet becomes the producer for ground's AMI-launch-gating SCP (slice 1, provabl/ground#18): `vet gate ami-… --tag-vetted` writes attest:vetted=true to the AMI via the EC2 API when the gate passes. That tag is exactly what ground's SCP requires to permit ec2:RunInstances; the companion lockdown SCP restricts who may set it, so the principal running this is the designated vetter. Fail-closed: a failing gate writes no tag. - internal/amitag: an injectable Tagger seam (AWS EC2 CreateTags in prod, a fake in tests), mirroring nitro's IAMTagger. Adds aws-sdk-go-v2 + service/ec2. - cmd/vet gate: ami- target branch + --tag-vetted/--region; tagIfVetted is a small pure seam so the pass→tag / fail→no-tag decision is unit-tested without driving the os.Exit path. - Tests: pass writes the tag, fail writes nothing (fail-closed, guard-verified), nil tagger never tags, tagger error propagates, ami- detection. Validated end-to-end on real AWS: vet gate --tag-vetted wrote attest:vetted=true to a real AMI (confirmed via describe-images); all resources torn down. v1 asserts provenance/verdict + an authenticated vetter marking — not a deep image-content guarantee. Deep AMI scanning (Inspector / snapshot+syft) and the runtime golden-PCR0 binding are deferred (README + #13). Refs: #13
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.
Layer-1 IAM enforcement for the AMI-gating epic (#13): only vetted AMIs may launch, and only the vetter may mark one vetted. Mirrors the existing nitro SCP pattern; no new deps; unit-tested.
Two SCPs
ami_launch_gating_scp.json— Denyec2:RunInstancesunless the AMI carriesec2:ResourceTag/attest:vetted == "true". The Deny is scoped to the image ARN (arn:aws:ec2:*::image/*) — the one non-obvious correctness point: aResource:"*"scope evaluates the ResourceTag condition against the instance/volumes/ENIsRunInstancesalso creates (none carry the AMI tag) and would deny every launch.ami_vetting_lockdown_scp.json— Denyec2:CreateTags/DeleteTagsof theattest:vettedkey on AMIs for everyone except the vetter (ArnNotLike aws:PrincipalArn). Solves the "trust trap": a researcher can't self-mark an AMI vetted (same "appraised, not asserted" principle as qualify#32's lockedattest:*tags). The vetter ARN is a deploy-time placeholder ground/vendor substitutes per account (SCPs can't parameterize).Tests
Mirror
TestNitroAttestationSCPRequiresAttestedTag, with regression guards for the two failure modes that would silently defeat the gate — the image-scope on the launch gate and the vetter exception on the lockdown. Verified both guards fail when violated and pass when correct.Scope
Layer-1 (enforcement) only. The runtime half (an instance proving it booted the vetted image via PCR0) already exists in nitro/nitrotpm. Deferred follow-ups, tracked on the epic: vet writing
attest:vetted(AMI vetting — carries the golden-PCR0 + CVE-source open questions), and vendor deploying these SCPs into vended accounts.Refs: #13