Overview
Inline policies are policies that are embedded directly into a single user, group, or role.
It is recommended to use managed policies instead of inline policies because they provide reusability, central change management, versioning and more capabilities.
Remediation guidance
AWS remediation
Console
- Locate identities with inline policies.
- Create equivalent customer-managed policies.
- Attach managed policies.
- Remove inline policies.
AWS CLI
aws iam create-policy --policy-name <policy-name> --policy-document file://policy.json
aws iam attach-role-policy --role-name <role-name> --policy-arn arn:aws:iam::<account-id>:policy/<policy-name>
aws iam delete-role-policy --role-name <role-name> --policy-name <inline-policy-name>
References
- https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-vs-inline.html
- https://docs.aws.amazon.com/cli/latest/reference/iam/
Service-wide remediation
Recommended when many resources are affected: fix the platform baseline first so new resources inherit the secure setting, then remediate the existing flagged resources in batches.
AWS
Use AWS Organizations guardrails, AWS Config rules or conformance packs where they fit, approved account baselines, and IaC modules so new resources inherit the secure setting.
Operational rollout
- Fix the baseline first at the account, subscription, project, cluster, or tenant scope that owns this control.
- Remediate the currently affected resources in batches, starting with internet-exposed and production assets.
- Re-scan and track approved exceptions with an owner and expiry date.
Query logic
These are the stored checks tied to this control.
Managed IAM Policies are used instead of Inline Policies
Connectors
Covered asset types
Expected check: eq []
{AWSIAM8{...AssetFragment}}
AWS