Skip to content

test(policies): adversarially verify AMI-gating SCPs vs live IAM simulator (provabl#13) - #19

Merged
scttfrdmn merged 1 commit into
mainfrom
test/scp-adversarial-sim
Jun 11, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
test/scp-adversarial-sim

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Answers "what stops a researcher forging the attest:vetted tag?" with a tested answer, not just reasoning.

What's here

  • policies/scp_simulate_test.go (build tag awssim, creds-gated → excluded from CI) drives iam:SimulateCustomPolicy with an adversarial matrix and asserts the decision:
    • researcher CreateTags/DeleteTags of attest:vetted → explicitDeny (forgery + strip blocked)
    • the vetter principal may set it; an unrelated tag key is unaffected (lockdown scoped to the key)
    • RunInstances denied for a false-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 keys aws: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. SimulateCustomPolicy evaluates 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 is awssim-tagged. Reproduce: AWS_PROFILE=… go test -tags awssim ./policies/ -v.

Refs: #13

…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
@scttfrdmn
scttfrdmn merged commit ce926f7 into main Jun 11, 2026
2 checks passed
@scttfrdmn
scttfrdmn deleted the test/scp-adversarial-sim branch June 11, 2026 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant