iam-roles-policies
Identity and Access Management (IAM) roles and policies are crucial in AWS for managing access to AWS services and resources securely. Here are 20 key points you should know:
IAM Roles
Role Definition: IAM roles are a set of permissions that define what actions are allowed and not allowed to be performed in AWS.
No Long-term Credentials: Unlike IAM users, roles do not have long-term credentials (like a password or access keys).
Assumable Identities: IAM roles can be assumed by authorized entities, such as IAM users, applications, or AWS services.
Temporary Security Tokens: When a role is assumed, AWS provides temporary security credentials for the session.
Cross-Account Access: Roles can be used to delegate access to users or services in other AWS accounts.
Service Roles: Roles can be assumed by AWS services to perform actions on your behalf.
Role Trust Policy: This policy defines who or what is allowed to assume the role.
Role Permissions Policy: This policy defines what actions the role is allowed to perform.
Secure Delegation: Using roles is a secure way of delegation, as it avoids sharing security credentials.
Role Chaining: Limiting privilege escalation by allowing a role to be assumed only if the requesting entity already has certain permissions.
IAM Policies
Policy Definition: IAM policies are JSON documents that define permissions.
Resource-Based Policies: Attached directly to AWS resources, controlling what actions are allowed or denied on that resource.
User-Based Policies: Attached to users, groups, or roles to manage permissions across multiple resources.
Policy Types: Managed policies (created and managed by AWS) and inline policies (created and managed by the user).
Policy Evaluation Logic: AWS evaluates policies when a request is made, starting with a default "deny", then evaluating for any "allow" and "deny" conditions.
Policy Elements: Include
Effect
,Action
,Resource
, andCondition
.Condition Operators: Policies can include conditions for when permissions are in effect, such as IP range, date/time, etc.
Versioning and Aliases: Managed policies support versioning and aliasing, helping in maintaining and rolling back policies.
Policy Simulator: AWS provides a policy simulator tool to test and validate IAM policies.
Least Privilege Principle: Always follow the principle of least privilege, granting only the permissions necessary to perform a task.
Understanding these concepts is crucial for effectively managing access and security in AWS. IAM roles and policies are powerful tools that, when used correctly, help secure your AWS environment while maintaining flexibility and scalability.