CloudMock emulates AWS IAM as an embedded engine within the gateway, managing users, access keys, and policies with full policy evaluation when running in enforce mode.
Operation Status Notes CreateUser Supported Creates an IAM user (via seed file or admin API) GetUser Supported Returns user details CreateAccessKey Supported Creates an access key pair for a user AttachUserPolicy Supported Attaches a policy to a user GetUserPolicies Supported Returns policies attached to a user
# Check caller identity (uses root credentials by default)
curl -X POST " http://localhost:4566/?Action=GetCallerIdentity&Version=2011-06-15 " \
-H " Authorization: AWS4-HMAC-SHA256 Credential=test/20260101/us-east-1/sts/aws4_request "
import { STSClient, GetCallerIdentityCommand } from ' @aws-sdk/client-sts ' ;
const sts = new STSClient ( {
endpoint: ' http://localhost:4566 ' ,
credentials: { accessKeyId: ' test ' , secretAccessKey: ' test ' },
const identity = await sts . send ( new GetCallerIdentityCommand ( {} ));
console . log (identity . Arn ); // arn:aws:iam::000000000000:root
sts = boto3. client ( ' sts ' , endpoint_url = ' http://localhost:4566 ' ,
aws_access_key_id = ' test ' , aws_secret_access_key = ' test ' ,
identity = sts. get_caller_identity ()
print ( identity [ ' Arn ' ]) # arn:aws:iam::000000000000:root
mode : enforce # none | authenticate | enforce
seed_file : ./iam-seed.json
Mode Behavior noneSkip all authentication and authorization authenticateVerify credentials exist, skip policy evaluation enforceFull policy evaluation on every request
Bulk-load users, access keys, and policies at startup:
"access_key_id" : " AKIAIOSFODNN7EXAMPLE " ,
"secret_access_key" : " wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY " ,
{ "Effect" : " Allow " , "Action" : " * " , "Resource" : " * " }
IAM is embedded in the gateway , not exposed as a standalone HTTP service.
The root user (root_access_key credential) bypasses all policy checks.
Roles, groups, and instance profiles are not implemented.
Managed policies (AWS-managed policy ARNs) are not available.
Policy conditions (Condition block) are not evaluated.
Wildcard matching supports * in Action and Resource fields.
Code HTTP Status Description AccessDenied 403 The request was denied by policy evaluation InvalidClientTokenId 403 The access key ID does not exist SignatureDoesNotMatch 403 The secret key does not match IncompleteSignature 400 The request signature is incomplete