Skip to content

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 ​

bash
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 alice

Supported operations ​

Most families have the usual Create, Get, List, Update, Delete, Tag and Untag operations.

AreaOperations
Users, groups, rolesCreateUser, CreateGroup, CreateRole, AddUserToGroup, RemoveUserFromGroup, ListGroupsForUser, UpdateAssumeRolePolicy, UpdateRoleDescription, Put/DeleteRolePermissionsBoundary, Put/DeleteUserPermissionsBoundary, and their Get/List/Update/Delete counterparts
Managed policiesCreatePolicy, CreatePolicyVersion, SetDefaultPolicyVersion, ListPolicyVersions, ListEntitiesForPolicy, Attach/Detach{User,Group,Role}Policy, ListAttached*Policies
Inline policiesPut/Get/Delete/List{User,Group,Role}Policy
CredentialsCreateAccessKey, UpdateAccessKey, GetAccessKeyLastUsed, CreateLoginProfile, ChangePassword, Upload/Delete/List/UpdateSSHPublicKey, Upload/Delete/List/UpdateSigningCertificate, CreateServiceSpecificCredential, ResetServiceSpecificCredential
MFACreateVirtualMFADevice, EnableMFADevice, DeactivateMFADevice, ResyncMFADevice, ListMFADevices, ListVirtualMFADevices
Instance profilesCreateInstanceProfile, AddRoleToInstanceProfile, RemoveRoleFromInstanceProfile, ListInstanceProfilesForRole, Get/Delete/List
Identity providersOpenID Connect and SAML providers: Create/Get/Delete/List, AddClientIDToOpenIDConnectProvider, RemoveClientIDFromOpenIDConnectProvider, UpdateOpenIDConnectProviderThumbprint, UpdateSAMLProvider
CertificatesUploadServerCertificate, Get/Delete/List/UpdateServerCertificate
Service-linked rolesCreateServiceLinkedRole, DeleteServiceLinkedRole, GetServiceLinkedRoleDeletionStatus
AccountCreateAccountAlias, DeleteAccountAlias, ListAccountAliases, Get/Update/DeleteAccountPasswordPolicy, GetAccountSummary, GetAccountProperties, PutAccountProperties, GetAccountAuthorizationDetails, SetSecurityTokenServicePreferences
ReportsGenerateCredentialReport, GetCredentialReport, GenerateServiceLastAccessedDetails, GetServiceLastAccessedDetails, GetServiceLastAccessedDetailsWithEntities, ListPoliciesGrantingServiceAccess, GenerateOrganizationsAccessReport, GetOrganizationsAccessReport
SimulationSimulateCustomPolicy, SimulatePrincipalPolicy, GetContextKeysForCustomPolicy, GetContextKeysForPrincipalPolicy
Organizations integrationEnable/DisableOrganizationsRootCredentialsManagement, Enable/DisableOrganizationsRootSessions, ListOrganizationsFeatures
Outbound federationEnable/DisableOutboundWebIdentityFederation, GetOutboundWebIdentityFederationInfo
Delegation requestsCreate/Get/List/Update/Accept/Reject/AssociateDelegationRequest, SendDelegationToken, AcquireRole
Role templatesGetRoleTemplateVersion

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.

FlagEnvDefaultPurpose
--enforce-iamGOPHERSTACK_ENFORCE_IAM, ENFORCE_IAMfalseEvaluate and deny
--iam-enforce-scpsGOPHERSTACK_IAM_ENFORCE_SCPStrueWith enforcement on, also evaluate Organizations SCPs for member-account principals
--iam-auditGOPHERSTACK_IAM_AUDIT, IAM_SOFT_MODEfalseEvaluate 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_LEVEL is 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_preferences Terraform resource fails a Terraform Core state-consistency check with provider v5.100.0. The operation itself works.

Parity & Coverage ​

MetricValue
PARITY entries audited38 (38 ok)
Feature families7 (7 ok)
Known gaps2
Structural gaps (can't be emulated)3
Deferred items0
Resource leaksclean

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
OperationWireErrorsStatePersist
ListAttachedUserPolicies/ListAttachedGroupPolicies/ListAttachedRolePoliciesfixedokokn/a
ListEntitiesForPolicyfixedokokn/a
ListRoleTags/ListPolicyTags/ListUserTags/ListInstanceProfileTags/ListMFADeviceTags/ListSAMLProviderTags/ListOpenIDConnectProviderTags/ListServerCertificateTagsokokokn/a
UpdateAccountPasswordPolicyokokokok
ListInstanceProfilesForRoleokokokok
GetAccountAuthorizationDetailsokokokok
GetRole/GetRolePolicy/GetUserPolicy/GetGroupPolicy/GetPolicyVersionok———
DeleteUserokokokok
DeleteRoleokokokok
DeleteGroupokokokok
DeleteInstanceProfileokokokok
UpdateUser/UpdateGroup (rename)okokokok
tag-cleanup-on-delete (5 resource kinds)ok—okok
UploadServerCertificateokokokn/a
GetSSHPublicKeyokokokn/a
SetSecurityTokenServicePreferencesokokokok
ListPoliciesGrantingServiceAccessfixedokokn/a
CreateDelegationRequestokokokok
GetHumanReadableSummaryokokokn/a
RejectDelegationRequestokokokok
SendDelegationTokenokokokok
UpdateDelegationRequestokokokok
AcceptDelegationRequestokokokok
AssociateDelegationRequestokokokok
GetServiceLastAccessedDetailsWithEntitiesfixedokokn/a
UpdateSigningCertificate/DeleteSigningCertificatefixedokokok
ListSigningCertificatesfixedokokn/a
ListSSHPublicKeysfixedokokn/a
GetDelegationRequestfixedokokn/a
ListDelegationRequestsfixedokokn/a
GetAccountSummaryfixedokokn/a
GenerateCredentialReport/GetCredentialReportokokokn/a
GenerateServiceLastAccessedDetails/GetServiceLastAccessedDetails (dead-code documentation only)n/an/an/an/a
AcquireRoleokokokok
GetRoleTemplateVersionokokokok
GetAccountPropertiesokokokok
PutAccountPropertiesfixedokokok
ListGroupsForUser/ListServerCertificates/ListServiceSpecificCredentialsfixedokokn/a

Audited Feature Families ​

Feature FamilyStatus
users_groups_rolesok
policiesok
access_keysok
providersok
AWSManagedPolicyCatalog—
role_managerok
account_propertiesok

Released under the MIT License.