An IAM principal represents an entity that is allowed or denied access to AWS resources. It can be any of the following:
- IAM User: A human user with AWS credentials.
- IAM Role: An identity that trusts another authenticated identity to assume its permissions.
- AWS Service: A service within AWS that interacts with resources.
- Anonymous User: In specific cases, access can be granted to anonymous users.
How It Works
- Principals are specified in policy statements, granting or denying permissions to specific entities.
- Resource-based policies (e.g., S3 bucket policies) use the
Principal element.
- Identity-based policies (attached to IAM users, groups, or roles) implicitly use the identity as the principal.
Benefits:
- Granular Access Control: Fine-tune permissions for different entities.
- Cross-Account Access: Enable trusted accounts to assume roles.
- Temporary Permissions: Roles allow temporary access via session tokens.
- Least Privilege: Assign only necessary permissions to each principal.
Limitations:
- No User Groups as Principals: Groups relate to permissions, not authentication.
- No Wildcards in Principal Names: Cannot match part of a principal name or ARN.
Features:
- Role Trust Policies: Specify who can assume an IAM role.