Check provider logo

IAM role does not grant ReadOnlyAccess to external AWS accounts

iam_role_cross_account_readonlyaccess_policy

Severityhigh
Serviceiam
by Prowler

IAM roles are assessed for the AWS-managed ReadOnlyAccess policy combined with a trust policy that allows external AWS principals or *. This identifies roles that expose broad read permissions to other accounts.

Risk

Granting cross-account read access can expose sensitive data and metadata, impacting confidentiality. External principals can read S3/DynamoDB contents and enumerate resources, policies, and logs, enabling targeted recon and easier privilege escalation paths.

Run this check with Prowler CLI

prowler aws --checks iam_role_cross_account_readonlyaccess_policy

Recommendation

Avoid attaching ReadOnlyAccess to roles trusted by other accounts. Apply least privilege with custom, tightly scoped policies. Restrict trust to explicit principals, avoid *, and use conditions like aws:PrincipalOrgID and sts:ExternalId for defense in depth.

Remediation

CLI

aws iam detach-role-policy --role-name <ROLE_NAME> --policy-arn arn:aws:iam::aws:policy/ReadOnlyAccess

Native IaC
Terraform
Other
  1. Open the AWS Management Console > IAM > Roles
  2. Select the role granting external access
  3. On the Permissions tab, locate the policy ReadOnlyAccess
  4. Click Detach policy and confirm
  5. Verify the role no longer lists ReadOnlyAccess

Source Code

Resource Type

AwsIamRole

References