AWS Identity and Access Management (IAM) is the service that defines access to AWS resources. One of the core components of IAM is the policy
which, when attached to an identity or a resource, defines its permissions. Policies granting permission to an identity (a user, a group or a role)
are called identity-based policies. They add the ability to an identity to perform a predefined set of actions on a list of resources.
For such policies, it is easy to define very broad permissions (by using wildcard "*"
permissions for example.) This is especially
true if it is not yet clear which permissions will be required for a specific workload or use case. However, it is important to limit the amount of
permissions that are granted and the amount of resources to which these permissions are granted. Doing so ensures that there are no users or roles
that have more permissions than they need.
If this is not done, it can potentially carry security risks in the case that an attacker gets access to one of these identities.
What is the potential impact?
AWS IAM policies that contain overly broad permissions can lead to privilege escalation by granting users more access than necessary. They may be
able to perform actions beyond their intended scope.
Privilege escalation
When IAM policies are too permissive, they grant users more privileges than necessary, allowing them to perform actions that they should not be
able to. This can be exploited by attackers to gain unauthorized access to sensitive resources and perform malicious activities.
For example, if an IAM policy grants a user unrestricted access to all S3 buckets in an AWS account, the user can potentially read, write, and
delete any object within those buckets. If an attacker gains access to this user’s credentials, they can exploit this overly permissive policy to
exfiltrate sensitive data, modify or delete critical files, or even launch further attacks within the AWS environment. This can have severe
consequences, such as data breaches, service disruptions, or unauthorized access to other resources within the AWS account.