feat(proof): least-privilege proof that runs as orgseed-ci through the real chain - #19
Merged
Merged
Conversation
…e real chain prove_ci_negatives.py makes real calls as the CI role and checks each got the RIGHT kind of denial: the self-escalation calls (rewrite its own or the admin role's permissions, touch the bootstrap stacks) must hit an explicit identity-policy deny, so they stay closed even if the allow statements are ever broadened; calls outside its remit must fail because nothing allows them; the calls it exists for must work. Only the right kind of denial counts for each group. Every call expected to be denied is harmless if it is wrongly allowed - a nonexistent policy ARN, a deliberately malformed document, a nonexistent stack - so a broken deny fails a check and does no damage. A test enforces that no probe makes a destructive call and that the mutating ones are inert. The design was checked against the IAM policy simulator for the deployed role: all 16 probes predicted as expected. prove.yml runs it through the shared session action in the orgseed environment, so it runs as orgseed-ci after a human approval; it has no || true and writes its summary even on failure.
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.
What
The least-privilege half of "prove orgseed works", with real calls made as the
orgseed-cirole through the real OIDC -> hub ->orgseed-cichain. So far that claim was supported by the IAM policy simulator only.cli/prove_ci_negatives.py- 17 probes in three groups, each of which must get the right kind of answer:self_escalation(7): edit the CI role's own permissions, rewriteOrgSeedAdmin's trust, touch the bootstrap stacks. Must hit an explicit deny in an identity-based policy - the belt-and-braces statement that keeps these closed even if the allow statements are ever broadened. A merely implicit denial fails: it would mean that guard is missing or unused.outside_scope(6): things never granted (read EC2, list IAM users, other buckets, move accounts). Must fail because no policy allows them.control(4): what the role is for (read the org, its SCPs, its state bucket,whoami). Must work, so a dead session can't masquerade as "everything denied". Expired-token/throttling errors are classified as errors, never as verdicts.prove.yml- runs it in theorgseedEnvironment via the shared session action, so it runs asorgseed-ci, after a human approval. No|| true; the summary is written even on failure; the evidence artifact (verdicts only) lives 7 days.Safety (this runs against a live management account)
Every call expected to be denied is harmless if wrongly allowed: nonexistent policy ARNs, deliberately malformed documents (
{}- IAM rejects them before applying), nonexistent stack names, fake OU/account IDs. A broken deny therefore fails a check and does no damage. Tests enforce it: no probe may call any of a list of destructive operations, and every mutating probe is checked to be inert.Verification
orgseed-cirole answers for each probe's exact action and resource. All 16 simulatable probes matched the script's expectation (explicitDeny/implicitDeny/allowed).Not verified yet
The workflow has not run. Simulator prediction is not the same as the live API's answer (resource ARN forms differ per API); the first run is the real test, and if a probe disagrees that's a finding about either the role or the probe.