IAM
Parity grade: A · SDK aws-sdk-go-v2/service/iam@v1.64.4 · last audited 2026-10-11 (5892fbc9f) · protocol aws-query -> XML
Category: Identity & Access · View PARITY.md on GitHub · All Services
In-memory IAM. Optional policy enforcement on every API call.
Quick start
export AWS_ENDPOINT_URL=http://localhost:8000
aws iam create-role --role-name MyRole --assume-role-policy-document \
'{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"Service":"lambda.amazonaws.com"},"Action":"sts:AssumeRole"}]}'
aws iam create-policy --policy-name MyPolicy --policy-document \
'{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"s3:*","Resource":"*"}]}'
aws iam attach-role-policy --role-name MyRole \
--policy-arn arn:aws:iam::000000000000:policy/MyPolicy
aws iam create-user --user-name alice
aws iam create-access-key --user-name aliceSupported operations
Most families have the usual Create, Get, List, Update, Delete, Tag and Untag operations.
| Area | Operations |
|---|---|
| Users, groups, roles | CreateUser, CreateGroup, CreateRole, AddUserToGroup, RemoveUserFromGroup, ListGroupsForUser, UpdateAssumeRolePolicy, UpdateRoleDescription, Put/DeleteRolePermissionsBoundary, Put/DeleteUserPermissionsBoundary, and their Get/List/Update/Delete counterparts |
| Managed policies | CreatePolicy, CreatePolicyVersion, SetDefaultPolicyVersion, ListPolicyVersions, ListEntitiesForPolicy, Attach/Detach{User,Group,Role}Policy, ListAttached*Policies |
| Inline policies | Put/Get/Delete/List{User,Group,Role}Policy |
| Credentials | CreateAccessKey, UpdateAccessKey, GetAccessKeyLastUsed, CreateLoginProfile, ChangePassword, Upload/Delete/List/UpdateSSHPublicKey, Upload/Delete/List/UpdateSigningCertificate, CreateServiceSpecificCredential, ResetServiceSpecificCredential |
| MFA | CreateVirtualMFADevice, EnableMFADevice, DeactivateMFADevice, ResyncMFADevice, ListMFADevices, ListVirtualMFADevices |
| Instance profiles | CreateInstanceProfile, AddRoleToInstanceProfile, RemoveRoleFromInstanceProfile, ListInstanceProfilesForRole, Get/Delete/List |
| Identity providers | OpenID Connect and SAML providers: Create/Get/Delete/List, AddClientIDToOpenIDConnectProvider, RemoveClientIDFromOpenIDConnectProvider, UpdateOpenIDConnectProviderThumbprint, UpdateSAMLProvider |
| Certificates | UploadServerCertificate, Get/Delete/List/UpdateServerCertificate |
| Service-linked roles | CreateServiceLinkedRole, DeleteServiceLinkedRole, GetServiceLinkedRoleDeletionStatus |
| Account | CreateAccountAlias, DeleteAccountAlias, ListAccountAliases, Get/Update/DeleteAccountPasswordPolicy, GetAccountSummary, GetAccountProperties, PutAccountProperties, GetAccountAuthorizationDetails, SetSecurityTokenServicePreferences |
| Reports | GenerateCredentialReport, GetCredentialReport, GenerateServiceLastAccessedDetails, GetServiceLastAccessedDetails, GetServiceLastAccessedDetailsWithEntities, ListPoliciesGrantingServiceAccess, GenerateOrganizationsAccessReport, GetOrganizationsAccessReport |
| Simulation | SimulateCustomPolicy, SimulatePrincipalPolicy, GetContextKeysForCustomPolicy, GetContextKeysForPrincipalPolicy |
| Organizations integration | Enable/DisableOrganizationsRootCredentialsManagement, Enable/DisableOrganizationsRootSessions, ListOrganizationsFeatures |
| Outbound federation | Enable/DisableOutboundWebIdentityFederation, GetOutboundWebIdentityFederationInfo |
| Delegation requests | Create/Get/List/Update/Accept/Reject/AssociateDelegationRequest, SendDelegationToken, AcquireRole |
| Role templates | GetRoleTemplateVersion |
Policy enforcement
Off by default: every call succeeds regardless of attached policies. Turn it on to evaluate each request against the caller's policies before dispatch.
| Flag | Env | Default | Purpose |
|---|---|---|---|
--enforce-iam | GOPHERSTACK_ENFORCE_IAM, ENFORCE_IAM | false | Evaluate and deny |
--iam-enforce-scps | GOPHERSTACK_IAM_ENFORCE_SCPS | true | With enforcement on, also evaluate Organizations SCPs for member-account principals |
--iam-audit | GOPHERSTACK_IAM_AUDIT, IAM_SOFT_MODE | false | Evaluate and record each request in the IAM Policy Stream, never deny |
Evaluated: Allow/Deny (explicit deny wins), action and resource wildcards, NotAction/NotResource, condition operators (string, Bool, Null, IP address, ARN, numeric, ForAllValues/ForAnyValue, IfExists) and policy variables such as ${aws:username}.
Differences from AWS
WARNING
Enforcement is single-account. The emulator's STS GetSessionToken mints root sessions only for the default (management) account, so a member-account root session cannot be created through the SDK.
- RCPs do not apply to KMS keys and Secrets Manager secrets named by ID or name. Those backends hold one account's resources, owned by the default account. RCPs apply when the request names a member-account ARN.
- Access advisor
Granularity=ACTION_LEVELis not supported: it needs real per-action usage tracking. - Role templates have no create or list operation in the SDK. Property values are untyped.
- The
aws_iam_security_token_service_preferencesTerraform resource fails a Terraform Core state-consistency check with provider v5.100.0. The operation itself works.
Parity & Coverage
| Metric | Value |
|---|---|
| PARITY entries audited | 38 (38 ok) |
| Feature families | 7 (7 ok) |
| Known gaps | 2 |
| Structural gaps (can't be emulated) | 3 |
| Deferred items | 0 |
| Resource leaks | clean |
Known Gaps
- RCP owner for single-account backends: KMS and Secrets Manager hold one account's resources (backend accountID), so a key or secret named by ID/name belongs to the default (management) account and RCPs do not apply to it; RCPs apply when the request names a member-account ARN. SQS (per-account queue scopes), S3 (bucket creator) and STS (role ARN account) resolve real owners. SimulateCustomPolicy does not report OrganizationsDecisionDetail: it takes no principal, so there is no account whose SCPs apply (docs only describe SCP evaluation for principal simulations; unverified for CallerArn).
- Member-account root: SCP/RCP restriction is proven at the middleware level; the emulator's STS GetSessionToken mints root sessions only for the default (management) account, so an SDK-driven member-root session cannot be created.
Structural Gaps
These do not block an A grade — no implementation could produce real data here because the underlying data source cannot exist in an emulator.
- aws_iam_security_token_service_preferences: terraform provider v5.100.0 Put-then-Read singleton trips a Terraform Core state-consistency check (external tooling, gopherstack-101r); the op itself is wire-verified.
- Role templates: the pinned SDK has no Create/Put/List op, so AddRoleTemplateVersionInternal is the only seam; AWS publishes no per-property value registry, so property values are untyped.
- Access advisor Granularity=ACTION_LEVEL: needs real per-action usage tracking; emulating it would fabricate data.
Audited Operations
38 audited operations
| Operation | Wire | Errors | State | Persist |
|---|---|---|---|---|
ListAttachedUserPolicies/ListAttachedGroupPolicies/ListAttachedRolePolicies | fixed | ok | ok | n/a |
ListEntitiesForPolicy | fixed | ok | ok | n/a |
ListRoleTags/ListPolicyTags/ListUserTags/ListInstanceProfileTags/ListMFADeviceTags/ListSAMLProviderTags/ListOpenIDConnectProviderTags/ListServerCertificateTags | ok | ok | ok | n/a |
UpdateAccountPasswordPolicy | ok | ok | ok | ok |
ListInstanceProfilesForRole | ok | ok | ok | ok |
GetAccountAuthorizationDetails | ok | ok | ok | ok |
GetRole/GetRolePolicy/GetUserPolicy/GetGroupPolicy/GetPolicyVersion | ok | — | — | — |
DeleteUser | ok | ok | ok | ok |
DeleteRole | ok | ok | ok | ok |
DeleteGroup | ok | ok | ok | ok |
DeleteInstanceProfile | ok | ok | ok | ok |
UpdateUser/UpdateGroup (rename) | ok | ok | ok | ok |
tag-cleanup-on-delete (5 resource kinds) | ok | — | ok | ok |
UploadServerCertificate | ok | ok | ok | n/a |
GetSSHPublicKey | ok | ok | ok | n/a |
SetSecurityTokenServicePreferences | ok | ok | ok | ok |
ListPoliciesGrantingServiceAccess | fixed | ok | ok | n/a |
CreateDelegationRequest | ok | ok | ok | ok |
GetHumanReadableSummary | ok | ok | ok | n/a |
RejectDelegationRequest | ok | ok | ok | ok |
SendDelegationToken | ok | ok | ok | ok |
UpdateDelegationRequest | ok | ok | ok | ok |
AcceptDelegationRequest | ok | ok | ok | ok |
AssociateDelegationRequest | ok | ok | ok | ok |
GetServiceLastAccessedDetailsWithEntities | fixed | ok | ok | n/a |
UpdateSigningCertificate/DeleteSigningCertificate | fixed | ok | ok | ok |
ListSigningCertificates | fixed | ok | ok | n/a |
ListSSHPublicKeys | fixed | ok | ok | n/a |
GetDelegationRequest | fixed | ok | ok | n/a |
ListDelegationRequests | fixed | ok | ok | n/a |
GetAccountSummary | fixed | ok | ok | n/a |
GenerateCredentialReport/GetCredentialReport | ok | ok | ok | n/a |
GenerateServiceLastAccessedDetails/GetServiceLastAccessedDetails (dead-code documentation only) | n/a | n/a | n/a | n/a |
AcquireRole | ok | ok | ok | ok |
GetRoleTemplateVersion | ok | ok | ok | ok |
GetAccountProperties | ok | ok | ok | ok |
PutAccountProperties | fixed | ok | ok | ok |
ListGroupsForUser/ListServerCertificates/ListServiceSpecificCredentials | fixed | ok | ok | n/a |
Audited Feature Families
| Feature Family | Status |
|---|---|
users_groups_roles | ok |
policies | ok |
access_keys | ok |
providers | ok |
AWSManagedPolicyCatalog | — |
role_manager | ok |
account_properties | ok |
