Overview
Service identities attached to public-facing workloads increase blast radius.
What this control checks
Identities attached to workloads that are reachable from the public internet.
Why this matters
If a public workload is compromised, over-privileged service identities can accelerate account-wide compromise.
Remediation guidance
Remediation strategy
- Remove unnecessary public exposure from workloads.
- Replace broad identity permissions with least privilege.
- Use dedicated identities per workload.
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/active-directory/managed-identities-azure-resources/overview
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.
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 used by public workloads
Connectors
Covered asset types
Expected check: eq []
{
iamRoles(
where: {
OR: [
{
vms_SOME: {
NOT: { publicIpAddress: null }
networkInterfaces_SOME: {
securityGroups_SOME: {
rules_SOME: {
direction: "Inbound"
action: "Allow"
OR: [
{ sources_INCLUDES: "cidr:0.0.0.0/0" }
{ sources_INCLUDES: "cidr:::/0" }
]
}
}
}
}
}
{ functions_SOME: { NOT: { functionURL: "" }, authType: "NONE" } }
]
}
) {
...AssetFragment
}
}Google Cloud Service Accounts used by public workloads
Connectors
Covered asset types
Expected check: eq []
{
iamServiceAccounts(
where: {
OR: [
{
vms_SOME: {
networkInterfaces_SOME: {
hasNetworkInterfaceAccessConfig_NOT: null
}
firewalls_SOME: {
rules_SOME: {
direction: "Inbound"
OR: [
{ sources_INCLUDES: "cidr:0.0.0.0/0" }
{ sources_INCLUDES: "cidr:::/0" }
]
}
}
}
}
]
}
) {
...AssetFragment
}
}Managed Identities used by publicly accessible workloads
Connectors
Covered asset types
Expected check: eq []
{
managedIdentities(
where: {
OR: [
{
vms_SOME: {
networkInterfaces_SOME: {
publicIp_NOT: null
securityGroups_SOME: {
rules_SOME: {
direction: "Inbound"
action: "Allow"
OR: [
{ sources_INCLUDES: "cidr:0.0.0.0/0" }
{ sources_INCLUDES: "cidr:::/0" }
{ sources_INCLUDES: "tag:Internet" }
{ sources: [] }
]
}
}
}
}
}
{
functions_SOME: {
bindings_SOME: { direction: "in", type: "httpTrigger" }
}
}
{ appServices_SOME: { authSettings: { NOT: { enabled: true } } } }
]
}
) {
...AssetFragment
}
}
Alibaba Cloud
AWS
Google Cloud
Microsoft Azure