Back to controls

Unused Service Identities

Unused service identities are unnecessary attack surface.

Category

Controls

Medium

Applies to

Alibaba CloudAWSGoogle CloudKubernetesMicrosoft Azure

Coverage

5 queries

Asset types

4 covered

Overview

Unused service identities are unnecessary attack surface.

What this control checks

Service identities with no observed usage during the evaluation window.

Why this matters

Removing unused identities reduces privilege sprawl and risk.

Remediation guidance

Remediation strategy

  1. Confirm identity is unused with owners and logs.
  2. Disable or remove permissions first.
  3. Delete identity after validation window.

GCP

gcloud iam service-accounts disable <sa>@<project-id>.iam.gserviceaccount.com

Azure

az identity list --query "[].{name:name,resourceGroup:resourceGroup,principalId:principalId}" -o table
az role assignment list --assignee <principal-id> -o table

References

  • https://cloud.google.com/iam/docs/service-accounts-manage
  • https://learn.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/manage-user-assigned-managed-identities-azure-cli

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.

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.

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.

Alibaba Cloud

Use Resource Directory guardrails, account baselines, and IaC modules so the secure setting is applied consistently across environments.

Operational rollout

  1. Fix the baseline first at the account, subscription, project, cluster, or tenant scope that owns this control.
  2. Remediate the currently affected resources in batches, starting with internet-exposed and production assets.
  3. Re-scan and track approved exceptions with an owner and expiry date.

Query logic

These are the stored checks tied to this control.

Unused AWS IAM Roles

Connectors

AWS

Covered asset types

IAMRole

Expected check: eq []

{
  UnusedAWSIAMRoles {
    ...AssetFragment
  }
}
Unused Azure Managed Identities

Connectors

Microsoft Azure

Covered asset types

ManagedIdentity

Expected check: eq []

{
  UnusedAzureManagedIdentities {
    ...AssetFragment
  }
}
Unused Google Cloud Service Accounts

Connectors

Google Cloud

Covered asset types

IAMServiceAccount

Expected check: eq []

{
  UnusedGoogleCloudIAMServiceAccounts {
    ...AssetFragment
  }
}
Unused Kubernetes Service Accounts

Connectors

Kubernetes

Covered asset types

ServiceAccount

Expected check: eq []

{
  UnusedK8sServiceAccounts {
    ...AssetFragment
  }
}
Unused Alibaba RAM Roles

Connectors

Alibaba Cloud

Covered asset types

IAMRole

Expected check: eq []

{
  UnusedAlibabaIAMRoles {
    ...AssetFragment
  }
}
Cyscale Logo
Cyscale is an agentless cloud-native application protection platform (CNAPP) that automates the contextual analysis of cloud misconfigurations, vulnerabilities, access, and data, to provide an accurate and actionable assessment of risk.

Stay connected

Receive new blog posts and product updates from Cyscale

By clicking Subscribe, I agree to Cyscale’s Privacy Policy


© 2026 Cyscale Limited

LinkedIn icon
Twitter icon
Facebook icon
crunch base icon
angel icon