future technology security and identification con 2025 10 03 18 41 48 utc
Automating identity governance
Summary

Identity governance used to be a manual spreadsheet activity that most teams dreaded. Cloud environments changed those expectations. Administrators can now automate access reviews, privilege lifecycle checks, credential audits, and policy evaluations with native tools or simple scripts.

This article focuses on building automation for AWS, Azure, and GCP; and it ends with a cross-platform workflow any team can adopt.

Why automate identity governance

Manual access reviews are slow and error-prone. Automation reduces risk by: 

Modern IAM systems produce structured logs and APIs. This makes governance a predictable automation task that can be executed daily or weekly.

AWS: Automated access evaluation

Key services:

Automating access review

A simple script can retrieve Access Analyzer findings and email or send them to a ticketing system

Example of AWS CLI automation:

				
					aws accessanalyzer list-findings \
  --analyzer-name org-analyzer \
  --filter status=ACTIVE \
  --query "findings[*].{id:id, policy:resourcePolicy, action:action}"

				
			

Combine this with a scheduled Lambda to create weekly reports.

Detecting unused IAM permissions

				
					aws iam list-service-last-accessed-details \
  --arn arn:aws:iam::111122223333:user/someuser
				
			

Inactive permissions are your first candidates for removal.

Automated key rotation

Use EventBridge and Lambda to flag keys older than your policy threshold.

				
					aws iam list-access-keys \
  --user-name someuser \
  --query 'AccessKeyMetadata[?CreateDate<`2024-01-01`]'
				
			
Azure: PIM, Graph API, and Role audit automation

Key services: 

Automating PIM reviews

Azure provides an API endpoint to retrieve who has eligible or active privileged roles.

Example of Graph API call: 

				
					GET <a href="https://negativepid.blog/the-edward-snowden-leaks/">https</a>://graph.microsoft.com/beta/roleManagement/directory/roleAssignments
				
			

You can wrap this in a scheduled Logic App for a weekly export.

Detecting orphaned accounts

Use PowerShell automation:

				
					Get-AzureADUser -All $true |
  Where-Object { $_.AccountEnabled -eq $false -or $_.SignInActivity.LastSignInDate -lt (Get-Date).AddDays(-90) }

				
			

Rotating Built-in Admin Roles

Use PIM to enforce just-in-time access where privileged roles automatically expire. Configure a Logic App to notify or remove standing privileges that do not have an expiry set.

GCP: permissions usage analysis and IAM recommender

Key services:

Automating permission pruning

GCP’s recommender can be queried programmatically.

				
					gcloud recommender recommendations list \
  --project my-project \
  --recommender <a href="https://negativepid.blog/a-global-map-of-mass-surveillance-programs/">google</a>.iam.policy.Recommender
				
			

You can trigger this process on a schedule and export the recommendations for review.

Finding inactive accounts

				
					gcloud logging read "protoPayload.methodName:google.iam.admin.v1" \
  --limit 1000
				
			

Filter for accounts without activity over a defined period.

Cross-cloud governance with Policy-As-Code

For multi-cloud environments, consistency is the challenge. The best approach is policy-as-code. Here’s a Terraform Example to define a baseline identity policy for all clouds:

				
					variable "allowed_actions" {
  type = list(string)
  default = ["read", "list"]
}

locals {
  iam_baseline = {
    aws = {
      actions = ["ec2:Describe*", "s3:Get*", "s3:List*"]
    }
    azure = {
      actions = ["Microsoft.Storage/storageAccounts/read"]
    }
    gcp = {
      permissions = ["<a href="https://negativepid.blog/understanding-the-windows-os/">storage</a>.objects.get", "storage.objects.list"]
    }
  }
}

				
			

Centralising baseline roles reduces drift.

Automated identity review dashboards

A simple governance dashboard can aggregate: 

This dashboard can be built using R, Python, or Power BI.

For example, R with jsonlite and dplyr can ingest IAM exports and produce quick summaries. Here’s a small R example using AWS IAM data

				
					library(jsonlite)
library(dplyr)

data <- fromJSON("iam_access.json")

unused <- data %>% 
  filter(lastAccessed == "N/A") %>% 
  select(principal, service)

unused
				
			

Scheduled scripts can publish updated dashboards to a Quarto page or an internal SharePoint site.

A practical weekly automation cycle

You can implement the following with scheduled functions or cron jobs:

This removes the manual burden from administrators and keeps the environment aligned with security policy.

Identity governance improves once you bring structure, schedules, and automation. Every cloud platform provides the tools. Administrators only need consistent workflows to unify the process.

Share this post :

PID Perspectives is migrating to European Servers. Please, let us know if you experience a slow response or technical issues.