If you have been using AWS for any length of time, then you will be most familiar with this type of policy. Identity-based IAM policies in AWS are a way to manage permissions and control access for individual users, groups, or roles within your AWS accounts. You can attach these policies to identities created within the IAM service. These policies then define what actions those identities can perform and what resources they can access.
For example, suppose a group had a policy attached to it that allows full Amazon S3 access. The group users would be granted permissions based on this and any other policies bound to the group, which makes the policy an identity-based policy. By using identity-based IAM policies, you can ensure that each user, group, or role in your AWS account has the appropriate level of access to AWS resources.
They help enforce security, control resource usage, and adhere to the principle of least privilege. In the case of an identity-based policy that would help enforce security, control resource usage, and adhere to the principle of least privilege, consider the following scenario. Your company hosts multiple Amazon S3 buckets for different purposes, ranging from marketing assets to sensitive financial reports.
By crafting specific identity-based policies, the organization ensures that access permissions align with team roles. For instance, the marketing team is granted read-only access to the Marketing bucket, the finance team receives read and write permissions for the FinancialReports bucket, and the sales team gains full access to the OrderStatements bucket. IAM groups are created associating these policies with corresponding teams, facilitating easy management and modification of permissions as the organization evolves. This approach not only enhances security by adhering to the principle of least privilege but also allows efficient resource usage, adaptability to changing roles, and streamlined auditing for compliance purposes.
Identity-based policies can be AWS managed, customer managed, or inline policies. The three types of identity-based policies are discussed in detail here:
- AWS-managed policies: These are predefined, ready-to-use policies that can be found within IAM. AWS-managed IAM policies are created and maintained by AWS experts and thus adhere to the best security and access control practices. These policies are designed to provide secure and granular access to AWS services and resources. They are automatically updated by AWS when new services or actions are added or when security best practices change. This means you don’t have to spend time and effort manually managing and updating the policy versions.
You can filter out only the AWS-managed policies from the IAM service from the AWS Management Console. Navigate to Policies and use the search bar to select the filter options.
Then choose the AWS managed policy type.
- Customer-managed policies: These are policies that you have customized to fit your specific need for a user, group, or role. For instance, there might not be an AWS-managed policy that specifically meets your organization’s needs. As a result, you may need to either copy and customize an existing managed policy or create your policy from scratch. You can use the visual editor to do so or write it yourself using the JavaScript Object Notation (JSON) format. Customer-managed identity-based policies give you much more granular control over how you want to manage identity access than AWS-managed policies.
- Inline policies: These are different from both AWS and customer-managed policies in the sense that inline policies are embedded directly into the identity object. For example, customer-managed policies are stored in IAM as separate objects and can then be assigned to multiple identities, such as groups, roles, and users. Inline policies are not stored as individual objects; they only exist within the entity that they are created in—users or roles. Show in the figure presents a diagrammatic representation of the differences between managed and inline policies.