Skip to content

iam: CreateUser mints ARNs under account 000000000000 while authorization uses 123456789012 #734

Closed

Description

@scttfrdmn

Found in the live SDK runs for milestone 92 (v0.107.0). Two paths disagree about which account
substrate is:

$ aws iam create-user --user-name alice
{ "User": { "Arn": "arn:aws:iam::000000000000:user/alice", … } }

$ aws ec2 run-instances …            # as alice, denied
An error occurred (AccessDenied) … User: arn:aws:iam::123456789012:user/alice is not authorized
to perform: ec2:RunInstances on resource: arn:aws:ec2:us-east-1:123456789012:instance/*

The IAM plugin mints ARNs under 000000000000; the authorization path builds resource ARNs and
the principal ARN under 123456789012. Both are "the account", and a consumer cannot write a
policy that names one and is enforced against the other — which is the practical damage: an
identity policy whose Resource is arn:aws:iam::000000000000:user/*, copied from what
CreateUser returned, matches nothing at the gate.

That the enforcement path still works is an accident of resolveIAMEntity parsing the entity
name out of the ARN rather than matching the account, so the split is invisible until a policy
names an account explicitly.

123456789012 is AWS's documented example account and is what the rest of the emulator uses
(ec2AuthzAccount, the CFN deployer, the STS GetCallerIdentity response). 000000000000 is
not a valid AWS account ID shape in practice.

Acceptance criteria

  • One account ID, resolved from one place, used by the IAM plugin's ARN minting and by the
    authorization path alike.
  • sts:GetCallerIdentity, the CFN deployer and every plugin that stamps an account are
    shown to agree with it — a test that greps for a second hardcoded account, or an
    equivalent tripwire.
  • Whether the account is configurable is decided explicitly; if it is, the default is stated
    in docs/.
  • ## Compatibility: any consumer asserting on 000000000000 in a returned ARN sees a
    changed value, so this needs naming in the release notes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions