Overview
Overview
Service identities with permissions to access every resource in the given environment. It is almost never the case that an identity used by a workload requires access to everything.
Remediation guidance
Remediation strategy
Reduce service identity permissions to minimum required.
AWS
aws iam detach-role-policy --role-name <role-name> --policy-arn arn:aws:iam::aws:policy/AdministratorAccess
aws iam attach-role-policy --role-name <role-name> --policy-arn arn:aws:iam::<account-id>:policy/<least-privilege-policy>
GCP
gcloud projects remove-iam-policy-binding <project-id> --member="serviceAccount:<sa>@<project-id>.iam.gserviceaccount.com" --role="roles/editor"
Azure
az role assignment delete --assignee <principal-id> --role Owner --scope /subscriptions/<sub-id>
References
- https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html
- https://cloud.google.com/iam/docs/using-iam-securely
- https://learn.microsoft.com/en-us/azure/role-based-access-control/best-practices
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.
Alibaba Cloud
Use Resource Directory guardrails, account baselines, and IaC modules so the secure setting is applied consistently across environments.
Google Cloud
Use organization or folder policies where available, shared project templates, logs and alerting baselines, and IaC modules so new resources inherit the secure setting.
Kubernetes
Use admission policies, baseline cluster configuration, GitOps templates, and namespace or workload guardrails so new deployments follow the control by default.
Azure
Use management group or subscription Azure Policy assignments, remediation tasks where supported, landing-zone standards, and IaC modules so drift is prevented at scale.
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.
AWS/Alibaba roles granting access to everything
Connectors
Covered asset types
Expected check: eq []
{
iamRoles(
where: {
cloudProvider_IN: ["alibaba", "aws"]
iamPolicies_SOME: {
iamPolicyStatements_SOME: {
actions_INCLUDES: "*"
resources_INCLUDES: "*"
}
}
}
) {
...AssetFragment
}
}Google Cloud Service Accounts with access to everything
Connectors
Covered asset types
Expected check: eq []
{
iamServiceAccounts(
where: { hasIAMRole_SOME: { name_IN: ["roles/owner", "roles/editor"] } }
) {
...AssetFragment
}
}K8s Service Accounts granting access to everything
Connectors
Covered asset types
Expected check: eq []
{
serviceAccounts(
where: {
OR: [
{
podIdentityAssociations_SOME: {
role: {
iamPolicies_SOME: {
iamPolicyStatements_SOME: {
actions_INCLUDES: "*"
resources_INCLUDES: "*"
}
}
}
}
}
{
annotations_SOME: {
awsRole: {
iamPolicies_SOME: {
iamPolicyStatements_SOME: {
actions_INCLUDES: "*"
resources_INCLUDES: "*"
}
}
}
}
}
]
}
) {
...AssetFragment
}
}Azure Managed Identities with access to everything
Connectors
Covered asset types
Expected check: eq []
{
managedIdentities(
where: {
servicePrincipals_SOME: { roles_SOME: { permissions_INCLUDES: "*" } }
}
) {
...AssetFragment
}
}
Alibaba Cloud
AWS
Google Cloud
Kubernetes
Microsoft Azure