Skip to content

Gate: account quotas and OIDC permissions #19

Closed

Description

@sodre

Parent

#18

What to build

Settle the AWS facts the spec could not verify, before any template changes.

  • Quotas. Read the four vCPU quotas in zeroae-code / us-east-1:

    • EC2 Spot (L-34B43A08)
    • EC2 On-Demand standard (L-1216C47A)
    • Fargate Spot (L-36FBB829)
    • Fargate On-Demand (L-3032A538)

    The Fargate quotas default to 6, so request increases where a quota doesn't cover the default budgets (24 / 8 / 24 / 8 vCPUs) plus what other workloads use.

  • OIDC permissions. Find out which permission set can create what the image push needs: GitHub's IAM OIDC provider, a role trusted by it, and an ECR repo.

    • Check the three ZAE permission sets the owner named: ZAEFederation, ZAEKeyManagement and ZAEPowerUserAccess. Only zeroae-code/ZAEPowerUserAccess has a profile in the owner's AWS config today, so add profiles for the other two.
    • Also record each one's naming and permissions-boundary rules for roles, as the PowerUserPB-* rule is recorded for AWSPowerUserAccess.
    • Check whether zeroae-code already has a provider for token.actions.githubusercontent.com.
  • Prior art. For the OIDC setup, use zeroae/foresight's infra/cloudformation/github-deploy-zae.json: it creates the provider only when ExistingOidcProviderArn is empty.

Acceptance criteria

  • The four quota values and any increase requests (with case ids) are recorded on this ticket and in the runbook's "Measured numbers".
  • For each ZAE permission set: whether it can create an OIDC provider, a role and an ECR repo, and its naming and boundary rules. Recorded on this ticket.
  • Whether zeroae-code already has GitHub's OIDC provider, and its ARN if so.
  • A recommendation, recorded here, of which permission set deploys the stack from ticket "Image to ECR" on. The owner confirms it before that ticket starts.
  • Read-only apart from the quota requests. Log in through aws sso login --use-device-code, which the owner approves.

Activity

  1. sodre commented on Nov 14, 2026

    @sodre
    MemberAuthor

    Gate passed (2026-11-13), with one recommendation for the owner to confirm. All checks were read-only, in zeroae-code (733153035800) / us-east-1, on the live SSO session. Nothing was created. The only change outside this repo: profiles zeroae-code/ZAEFederation and zeroae-code/ZAEKeyManagement were added to the owner's ~/.aws/config, in the same shape as zeroae-code/ZAEPowerUserAccess. All four permission sets are assigned to the account, and each profile's sts get-caller-identity works.

    Quotas: no increase needed

    Quota Code Value AWS default Default budget Account peak, last 14 days
    EC2 Spot L-34B43A08 256 5 24 32
    EC2 On-Demand standard L-1216C47A 384 5 8 4
    Fargate Spot L-36FBB829 140 6 24 0
    Fargate On-Demand L-3032A538 140 6 8 0

    The Fargate quotas were already raised to 140, not left at the default of 6. The peak is the AWS/Usage ResourceCount daily maximum, and it includes this stack's own runners. The account has three other ECS clusters (load-test-load, securevector-dev, svdb-qps-fargate), with no tasks running today. Neither service has a quota request in its history, and no request was filed, so there are no case ids. The numbers are in the runbook's "Measured numbers" (branch ticket/19-gate).

    GitHub's OIDC provider: it already exists

    arn:aws:iam::733153035800:oidc-provider/token.actions.githubusercontent.com. Its client id is sts.amazonaws.com, and it is tagged Application=zae-limiter, Purpose=github-e2e.

    Caveat: another stack owns it. It is the resource GitHubOIDCProvider of the CloudFormation stack zael-github-e2e, which CloudTrail shows was created 2026-11-07 under AWSAdministratorAccess. If that stack is ever deleted, the provider goes with it, and the ci-runner image push breaks. Pass this ARN as ExistingOidcProviderArn. The owner may also want to retain that resource (DeletionPolicy: Retain) in zae-limiter's template.

    The three ZAE permission sets, plus AWSPowerUserAccess

    I read each set's inline policy (AwsSSOInlinePolicy) on its AWSReservedSSO_* role, then confirmed it with iam simulate-principal-policy against that role, with the iam:PermissionsBoundary context key set.

    Permission set Managed policy OIDC provider (create / tag / delete) Role PowerUserPB-* with boundary iam:UpdateAssumeRolePolicy ECR repo, lifecycle, repo policy CloudFormation
    ZAEFederation none yes, on oidc-provider/* (also SAML providers) no no no no
    ZAEKeyManagement none no no no no no
    ZAEPowerUserAccess PowerUserAccess no (read only) yes yes yes yes
    AWSPowerUserAccess (today's) PowerUserAccess no (read only) yes no yes yes

    Naming and boundary rules:

    • ZAEFederation: it can't create roles or policies at all, so it has no naming rule. It manages OIDC and SAML providers on any name, and reads IAM (iam:Get*, iam:List*).
    • ZAEKeyManagement: it has no IAM write access. It manages KMS keys, aliases and key policies, and explicitly denies every use of a key (encrypt, decrypt, sign, data keys, grants).
    • ZAEPowerUserAccess: roles, managed policies and instance profiles must be named PowerUserPB*. iam:CreateRole, iam:PutRolePolicy, iam:AttachRolePolicy, iam:PutRolePermissionsBoundary and iam:UpdateAssumeRolePolicy require a permissions boundary of either arn:aws:iam::aws:policy/PowerUserAccess or arn:aws:iam::<account>:policy/ZAEPowerUserBoundary. That second policy exists in zeroae-code (v1, no attachments). Removing a boundary is denied, and so is changing either boundary policy. iam:PassRole is allowed on PowerUserPB*.
    • AWSPowerUserAccess: the same PowerUserPB* names. The boundary must be exactly PowerUserAccess. It also explicitly denies iam:PutRolePermissionsBoundary, and it has no iam:UpdateAssumeRolePolicy.

    No one set can create all three things. That doesn't matter here, because the provider already exists.

    Recommendation for #27: deploy with zeroae-code/ZAEPowerUserAccess

    • It can create the image-push role PowerUserPB-${stack}-image-push, with boundary arn:aws:iam::aws:policy/PowerUserAccess, and the ECR repo with its lifecycle rule.
    • It can also update the push role's trust policy later. CloudFormation changes a role's trust in place with iam:UpdateAssumeRolePolicy, which AWSPowerUserAccess lacks. Under AWSPowerUserAccess, the first deploy would work, but any later change to the role's trust (the sub pin, say) would fail.
    • It is a strict superset of AWSPowerUserAccess: the same managed PowerUserAccess, plus the inline statements above. So the existing stack keeps deploying under it. Keep the existing boundary, PowerUserAccess, on every role; nothing needs ZAEPowerUserBoundary.
    • Deploy with ExistingOidcProviderArn=arn:aws:iam::733153035800:oidc-provider/token.actions.githubusercontent.com. The stack then creates no provider, and needs no ZAEFederation.
    • If the provider is ever missing (for instance, zael-github-e2e deleted), create it once with ZAEFederation, outside the stack, and pass its ARN. Don't deploy the stack under ZAEFederation: it can't touch CloudFormation, roles or ECR.

    The runbook's AWS= line and make deploy's PROFILE default name AWSPowerUserAccess today. #27 should switch them to ZAEPowerUserAccess, once the owner confirms.

    Unverified

    • SCPs. simulate-principal-policy doesn't evaluate Organizations SCPs, and organizations:ListPoliciesForTarget is denied to this set. The account already holds 16+ ECR repos, and Gate: AWS deploy permissions and EC2 vCPU quotas #2's live probe created a PowerUserPB-* role, so no SCP blocks those. iam:UpdateAssumeRolePolicy under ZAEPowerUserAccess is unproven live.
    • Peak usage. The usage peak covers 14 days only.
  2. added a commit that references this issue on Nov 14, 2026
  3. sodre commented on Nov 14, 2026

    @sodre
    MemberAuthor

    Owner decisions (2026-11-13): #27 onward deploys the stack with zeroae-code/ZAEPowerUserAccess, which becomes make deploy's default profile. Reuse the existing GitHub OIDC provider through ExistingOidcProviderArn, and record in the runbook's traps table that the provider is owned by the zael-github-e2e stack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentFully specified, ready for an AFK agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions