Repository navigation
test(policies): adversarially verify AMI-gating SCPs vs live IAM simulator (provabl#13) - #19
Merged
Merged
Conversation
…lator (#13) Turns the "can a researcher forge attest:vetted?" reasoning into tested fact. policies/scp_simulate_test.go (build tag awssim, creds-gated, excluded from CI) drives iam:SimulateCustomPolicy with an attack matrix and asserts each decision: - researcher CreateTags/DeleteTags of attest:vetted → explicitDeny (forgery blocked) - the vetter principal may set attest:vetted; an unrelated key is unaffected - RunInstances denied for a false-tagged OR untagged AMI (missing != vetted) The simulator is the faithful test: SCPs never apply to an Organization's management account (the suite's dev account), so the policy can't be observed denying in-account — the simulator evaluates the logic with no resources, no spend. Verified all-passing against the live API. policies/SECURITY.md documents the matrix, how AWS permissions tagging (condition keys, not per-tag ACLs), and the honest trust boundary: the gate reduces to who can assume the vetter principal, and SCPs don't restrict the management-account root. Adds aws-sdk-go-v2/service/iam as a direct dep (simulator client). 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.
Answers "what stops a researcher forging the
attest:vettedtag?" with a tested answer, not just reasoning.What's here
policies/scp_simulate_test.go(build tagawssim, creds-gated → excluded from CI) drivesiam:SimulateCustomPolicywith an adversarial matrix and asserts the decision:CreateTags/DeleteTagsofattest:vetted→ explicitDeny (forgery + strip blocked)RunInstancesdenied for afalse-tagged or untagged AMI (a missing tag is not "vetted" — the subtle deny-unless direction, pinned)policies/SECURITY.md— the matrix, how AWS permissions tagging (condition keysaws:TagKeys/aws:ResourceTag/aws:PrincipalArn, not per-tag ACLs), and the honest trust boundary: soundness reduces to who can assume the vetter principal, and SCPs never restrict the management-account root.Why the simulator
The suite's dev account is its Organization's management account, and SCPs never apply there — so the policy can't be observed denying in-account.
SimulateCustomPolicyevaluates the policy logic against synthetic contexts with no resources and no spend. Verified all-passing against the live API.CI (
go test ./..., no creds) is unaffected — the test isawssim-tagged. Reproduce:AWS_PROFILE=… go test -tags awssim ./policies/ -v.Refs: #13