While we’re not fans of allowing Resource “*”, this is just an example to demonstrate Permission Boundaries, and we don’t want to make it unnecessarily complicated.
The policy could be attached to any user or role. It could be used by a data analyst, but it could also be used by an application that needs to have access to S3 and Athena. The credentials can be used within an EC2 instance (using a IAM instance role), or can be issued by an external identity provider. Both approaches end up with the same credentials somewhere accessible on an EC2 instance (through the metadata URL), or within the ~/.aws directory on an analysts’ machine.
Even though these credentials have a limited lifetime, they can still be leaked, copied, or stolen in numerous ways. What we want to achieve is to reduce the impact when credentials are used outside our network. We can do this by attaching a Permission Boundary policy to our users and roles.
A new Permission Boundary policy to reduce our attack surface could look like this: