1.1 Design secure access to AWS resources
Secure access on AWS combines strong identity, least-privilege authorization, temporary credentials, and multi-account governance. Design centralized workforce access, explicit workload identities, separation of duties, and traceable access across accounts.
Security best practices in IAM
Core access concepts
- Multi-account controls: Use AWS Organizations, organizational units (OUs), service control policies (SCPs), and cross-account roles to separate workloads and establish permission guardrails.
- Workforce access: Use AWS IAM Identity Center with an external identity provider when appropriate, permission sets, and short-lived role credentials.
- Workload access: Use IAM roles for AWS services and applications instead of distributing long-lived access keys.
- Least privilege: Grant only required actions on required resources, add applicable conditions, and refine permissions using access evidence.
- Shared responsibility: AWS secures the underlying cloud infrastructure; customers configure identities, permissions, data protection, and account controls.
Root user and human access
- Protect the root user, enable multi-factor authentication (MFA), avoid routine root use, and establish a monitored recovery or emergency-access process.
- Prefer federation and IAM Identity Center for workforce access instead of creating individual IAM users.
- Require MFA for privileged human access and use short-lived sessions appropriate to the task and risk.
- Avoid long-lived access keys. Where a legacy exception exists, protect, monitor, rotate, and remove the key as soon as feasible.
Flexible authorization
- Identity-based policies: Attach permissions to IAM users, groups, or roles. Customer managed policies can be reused; inline policies remain attached to one identity.
- Resource-based policies: Attach permissions to supported resources, including Amazon S3 buckets, AWS Key Management Service keys, Amazon Simple Queue Service queues, and AWS Lambda functions.
- Conditions: Narrow authorization using supported context keys such as principal tags, MFA context, resource tags, source networks, VPC endpoints, and resource ARNs.
- Permissions boundaries: Set the maximum permissions an identity-based policy can grant to an IAM user or role. A boundary grants no permission by itself, and resource-based policy interactions require evaluation of the specific principal and policy context.
- Temporary credentials: Use AWS Security Token Service (AWS STS) role sessions and control session duration according to workload and user requirements.
Cross-account access
For cross-account role access, the target account role trust policy identifies who may assume the role, and permissions policies determine what the resulting role session can do. Both sides of the authorization relationship must be evaluated.
- Map workforce groups to IAM Identity Center permission sets for consistent job-based access across accounts.
- Use
sts:AssumeRoleand temporary credentials for cross-account operations. - Require MFA, approval, or additional conditions for sensitive roles where appropriate.
- Create tightly controlled emergency access with strong monitoring and a tested recovery process.
Multi-account governance
- AWS Control Tower: Establishes and governs a landing zone and applies AWS Control Tower controls. The earlier term guardrails may appear in legacy material.
- AWS Organizations and OUs: Group accounts according to workload, environment, business, and security boundaries.
- SCPs: Limit available permissions for member accounts but do not grant permissions.
- Delegated administration: Assign supported service administration to dedicated accounts while retaining centralized governance.
Identity-based and resource-based policies
| Policy type | Use | Examples |
|---|---|---|
| Identity-based | Grant an IAM principal permissions to act on specified resources. | Workforce roles, application roles, and service roles. |
| Resource-based | Grant specified principals access through a supported resource and express resource-specific constraints. | S3 bucket policies, KMS key policies, SQS queue policies, and Lambda resource policies. |
For cross-account access, evaluate the identity policy, resource policy, trust policy, SCPs, permissions boundaries, session policies, and explicit denies that apply to the request.
Federation and identity lifecycle
- Use IAM Identity Center or supported SAML 2.0 and OpenID Connect federation to centralize workforce identity.
- Map identity-provider groups and attributes to permission sets or roles according to job function.
- Deprovisioning a user at the corporate identity provider prevents or removes future access according to provisioning and assignment behavior, but existing AWS sessions can remain usable until they expire or are otherwise revoked.
- Coordinate identity provisioning, assignment removal, session duration, MFA, and logging to meet the required revocation objective.
Design examples
- Shared S3 data: Combine a bucket policy that identifies approved cross-account roles with restrictive role permissions, KMS key access when applicable, and relevant conditions.
- Human access across accounts: Use IAM Identity Center permission sets, MFA, short sessions, and an elevation process for privileged access.
- Production account controls: Apply SCPs and AWS Control Tower controls to the production OU, and delegate supported security-service administration to a security account.
- Application credentials: Assign instance profiles, task roles, or function execution roles rather than embedding static credentials in hosts or images.