Skip to content

Cloud identity scans

An Azure DevOps scan shows which pipelines can use a service connection. A cloud identity scan shows what the identity behind that connection can do in the cloud.

The scanner sweeps a Microsoft Entra ID tenant, or a Google Cloud project, folder or organisation, with the identity resolver built into observes (laughing-lamp). The swept tenant becomes its own platform in Observes. When an Azure DevOps service connection, variable group or secure file references an identity from that tenant, Observes links the two. Each identity lists every platform that has seen it.

In the app

Select Add platform, then Azure (Entra ID) or Google Cloud. Run the scan with the command below, then upload the results the same way as any other scan. The tenant appears on the Dashboard once its scan is ingested.

Run a scan

Cloud identity scans use -t entra or -t gcp. They don't need Azure DevOps credentials or --organization. They need cloud credentials with the permissions below: DefaultAzureCredential (such as az login, a service principal's AZURE_* environment variables or a managed identity) for Entra ID, and Application Default Credentials, --gcp-credentials-file or --gcp-impersonate-service-account for Google Cloud.

# Every service principal and managed identity in the tenant
observes -t entra -j <job-id> --tenant-id <tenant-guid> --sweep-all

# ...plus directory users, and each identity's history
observes -t entra -j <job-id> --tenant-id <tenant-guid> --sweep-all --include-users --historic

# Specific identities only
observes -t entra -j <job-id> --tenant-id <tenant-guid> --identity-ids <object-id>,<app-id>

--tenant-id must be the tenant GUID, not a domain name, so identities match the ones Azure DevOps service connections reference.

# Every service account in every project of an organisation
observes -t gcp -j <job-id> --tenant-id <org-id> --tenant-scope organizations --sweep-all

# One project
observes -t gcp -j <job-id> --tenant-id <project-id> --sweep-all

Service accounts are recorded against their own project, whatever scope you sweep. That's how Azure DevOps GCP connections name them.

Options

Flag Description
-t, --target-platform entra or gcp. The default, azure_devops, runs an Azure DevOps scan.
--tenant-id The Entra tenant GUID, or the Google Cloud project, folder or organisation ID.
--tenant-scope The kind of ID --tenant-id is. Entra: subscription (default) or management_group. Google Cloud: projects (default), folders or organizations.
--sweep-all Resolve every identity: every service principal and managed identity in Entra, or every service account in Google Cloud.
--identity-ids Comma-separated identity IDs to resolve, instead of --sweep-all.
--identity-ids-file <PATH> A file of identity IDs, one per line (# comments allowed) or a JSON array. Combines with --identity-ids.
--include-users With --sweep-all, also resolve users: Entra directory users, or Google Cloud user and group principals that hold IAM bindings.
--historic Entra only. Include each identity's permission, credential and sign-in history. Needs AuditLog.Read.All.
--audit-wif Also audit workload identity federation. See below.
--platform-name The platform's display name in Observes. Defaults to one derived from --tenant-id.
--gcp-credentials-file, --gcp-impersonate-service-account Google Cloud credentials to use instead of Application Default Credentials. See the CLI reference.

The upload options, --observes-platform-url and --observes-platform-api-key, work the same as for any scan.

Workload identity federation audit

--audit-wif adds a workload identity federation audit to the scan:

  • Entra ID: app registrations' federated credentials and service principal lock, service principals holding credentials their app doesn't, and managed identities' federated credentials.
  • Google Cloud: workload identity pools, their providers, and the IAM bindings they grant. Needs iam.workloadIdentityPools.list and iam.workloadIdentityPoolProviders.list.

The results appear in Observes under Identity & Credentials → Workload identity federation.

Output

Besides the scan_<job-id>.jsonl file, the scanner writes an identity HTML report to identity_report_<job-id>/ in the results directory.

Permissions

The scan only reads. These permissions also apply to --resolve-identities in an Azure DevOps scan.

Permission Why
Microsoft Graph User.Read.All, Directory.Read.All (application permissions, with admin consent) Service principals, managed identities, app registrations and their credentials
Azure Reader on each subscription (or management group) in scope Azure role assignments
Microsoft Graph AuditLog.Read.All Optional. --historic: permission, credential and sign-in history
Microsoft Graph UserAuthenticationMethod.Read.All Optional. Users' registered authentication methods, with --include-users
Microsoft Graph RoleManagement.Read.Directory Optional, Entra ID P2. Lists PIM-eligible holders of credential-admin roles. Without it, only active holders are listed.

Create a custom role and bind it to the scanner's service account, at the project, or at the organisation or folder you sweep:

gcloud iam roles create observesScanner --organization=<org-id> \
  --title="Observes scanner" --stage=GA \
  --permissions=cloudasset.assets.searchAllResources,cloudasset.assets.searchAllIamPolicies,cloudasset.assets.analyzeIamPolicy,iam.roles.get,resourcemanager.projects.get,iam.workloadIdentityPools.list,iam.workloadIdentityPools.get,iam.workloadIdentityPoolProviders.list,iam.serviceAccounts.list,iam.serviceAccounts.getIamPolicy,iam.serviceAccountKeys.list

gcloud organizations add-iam-policy-binding <org-id> \
  --member="serviceAccount:<scanner-service-account-email>" \
  --role="organizations/<org-id>/roles/observesScanner"

For a single project, use --project=<project-id> and gcloud projects add-iam-policy-binding instead. You can leave out the permissions for options you don't use:

Permission Needed for
cloudasset.assets.searchAllResources --tenant-scope folders or organizations. It only takes effect when bound at that folder or organisation.
iam.serviceAccounts.list --sweep-all
iam.workloadIdentityPools.list, iam.workloadIdentityPoolProviders.list --audit-wif
iam.serviceAccounts.getIamPolicy, iam.workloadIdentityPools.get Inbound workload identity federation trust on each service account. Without them, that check is skipped with a warning.

Only these scans create cloud platforms

An Azure DevOps scan that references a cloud identity records it against the Azure DevOps organisation only. The Entra ID or Google Cloud platform is created by its own cloud identity scan.