IAM basics
IAM is global, not regional. It controls who (authentication) can do what (authorisation) on AWS resources.
- Root user should never be used day-to-day — lock it down with MFA and avoid its access keys.
- Users, groups and roles are IAM identities. Groups cannot be nested and cannot be logged into.
- Roles are the secure way to grant temporary access — used by EC2 instances, Lambda, cross-account access, and federated users (via STS, Security Token Service).
- Policies are JSON documents attached to identities or resources. Evaluation logic: explicit Deny always wins, then explicit Allow, then implicit Deny (default with no Allow).
- Use the principle of least privilege — grant only the permissions needed.
- IAM Policy Simulator and Access Analyzer help test and audit permissions before deploying.
Policy types
- Identity-based policies attach to users/groups/roles.
- Resource-based policies attach to resources (e.g. S3 bucket policies, KMS key policies) and can grant cross-account access without a role.
- Permissions boundaries set the maximum permissions an identity can ever have — a guardrail, not a grant.
- Service Control Policies (SCPs) live in AWS Organizations and cap permissions across whole accounts — even the root user in a member account cannot exceed an SCP.
Common exam mistake
Don't confuse permissions boundaries (per-identity ceiling) with SCPs (per-account/OU ceiling) — both are 'maximum' controls, neither grants access on its own; you still need an Allow.
KMS (Key Management Service)
KMS manages encryption keys for data at rest across AWS services (S3, EBS, RDS, etc).
- Customer Master Keys (CMKs), now called KMS keys, never leave the KMS service unencrypted.
- AWS-managed keys (aws/service-name) are free and rotate automatically every year; you cannot control their policy.
- Customer-managed keys give full control over the key policy and rotation, and can be rotated automatically every year or on demand.
- Envelope encryption is how KMS handles large data: a data key encrypts the actual data, and the KMS key encrypts the data key.
- Symmetric KMS keys are used for most encrypt/decrypt use cases; asymmetric keys support signing or encryption where the public key must be shared.
- KMS API calls (Encrypt, Decrypt, GenerateDataKey) are logged to CloudTrail, giving an audit trail of key use.
- Key policies are the primary access-control mechanism for KMS keys — even with an IAM Allow, the key policy must also permit the action (or delegate to IAM via 'enable IAM policies').
Common exam mistake
Remember KMS keys are regional, unlike IAM. A key created in eu-west-2 cannot be used to decrypt data in us-east-1 directly — you'd need cross-region key replication (multi-Region keys) or re-encryption.
Is IAM a global or regional service?
Global — IAM identities and policies apply across all AWS Regions.
tap to reveal
In IAM policy evaluation, what always wins?
An explicit Deny always overrides any Allow.
tap to reveal
What is the default access decision when no policy explicitly allows an action?
Implicit Deny.
tap to reveal
How do EC2 instances and Lambda functions securely get AWS permissions without hard-coded keys?
By assuming an IAM role, which provides temporary credentials via STS.
tap to reveal
What does a permissions boundary do?
Sets the maximum permissions an IAM identity can have — it does not grant permissions itself.
tap to reveal
What is a Service Control Policy (SCP) and where does it apply?
A policy in AWS Organizations that caps the maximum permissions for an entire account or OU, including the root user.
tap to reveal
Can IAM groups be nested inside other groups?
No — IAM groups cannot be nested, and you cannot log in directly as a group.
tap to reveal
How often do AWS-managed KMS keys rotate, and can you control this?
Automatically every year; you cannot change or disable this for AWS-managed keys.
tap to reveal
What rotation options exist for customer-managed KMS keys?
Automatic annual rotation (can be enabled) or manual rotation on demand.
tap to reveal
What is envelope encryption in KMS?
A data key encrypts the actual data; the KMS key then encrypts that data key, avoiding sending large data to KMS directly.
tap to reveal
Are KMS keys global or regional?
Regional — a key in one Region cannot decrypt data tied to another Region unless you use a multi-Region key.
tap to reveal
Where are KMS API calls like Encrypt and Decrypt logged?
Automatically in CloudTrail, giving a full audit trail of key usage.
tap to reveal
What type of policy can grant cross-account access without using a role?
A resource-based policy, such as an S3 bucket policy or a KMS key policy.
tap to reveal
What is the difference between an identity-based and a resource-based policy?
Identity-based policies attach to users, groups or roles; resource-based policies attach directly to a resource, such as an S3 bucket or KMS key.
tap to reveal
Why should the AWS root user be avoided for daily tasks?
It has unrestricted access to the whole account, so best practice is to secure it with MFA, avoid access keys, and use IAM roles/users instead.
tap to reveal