delivered for clients · names withheldmodernization Security operations

Service account, API key and non-human identity cleanup

Cohash cleans up non-human identities. Active Directory service accounts, Entra ID app registrations, cloud roles and keys, SaaS OAuth grants, API keys, AI agents. We build one inventory, give every identity an owner and remove what's unused. Then we move workloads to federation and managed identities, rotate or vault whatever has to stay static, and add the survivors to access reviews in SailPoint, Saviynt or Entra ID Governance.

  1. 01Inventory
  2. 02Owners and dead weight
  3. 03Federate first
  4. 04Rotate or vault the rest
  5. 05Governance
case-study / service-account-and-nhi-cleanup delivered
beforeUnowned service accounts, keys and app registrations afterOwned, federated, short-lived machine identities
01 · WORKLOADS 02 · IDENTITY AND SECRETS 03 · GOVERNANCE CI/CD pipelines: no stored secret CI/CDpipelines no stored secret Azure workloads: VMs · App Service · Functions Azureworkloads VMs · AppService ·Functions Kubernetes pods: service account tokens Kubernetespods service accounttokens AI agents: sponsor and expiry AI agents sponsor andexpiry Windows services: dependencies mapped Windowsservices dependenciesmapped Entra workload identities: OIDC federation · managed identity Entra workloadidentities OIDC federation ·managed identity Entra Agent ID: blueprints · sponsors Entra Agent ID blueprints · sponsors Vault or PAM: rotated static passwords Vault or PAM rotated staticpasswords NHI inventory: owner · last use · permissions NHI inventory owner · last use ·permissions SailPoint or Saviynt: owner certifications SailPoint or Saviynt owner certifications
01 · WORKLOADS02 · IDENTITY AND SECRETS03 · GOVERNANCE CI/CD pipelines: no stored secret CI/CDpipelines no storedsecret Azure workloads: VMs · App Service · Functions Azureworkloads VMs · AppService ·Functions Kubernetes pods: service account tokens Kubernetespods service accounttokens AI agents: sponsor and expiry AI agents sponsor and expiry Windows services: dependencies mapped Windowsservices dependenciesmapped Entra workload identities: OIDC federation · managed identity Entraworkloadidentities OIDC federation· managedidentity Entra Agent ID: blueprints · sponsors Entra AgentID blueprints ·sponsors Vault or PAM: rotated static passwords Vault or PAM rotated staticpasswords NHI inventory: owner · last use · permissions NHI inventory owner · last use ·permissions SailPoint or Saviynt: owner certifications SailPoint orSaviynt ownercertifications © Cohash · cohash.com
case file

The story

Told without the client's name or anything that could identify them.

what happened

A healthcare company's identity team had more service accounts than people in Active Directory, most with no owner, and app registrations holding client secrets that never expired. It became urgent when Microsoft's mandatory MFA for Azure sign-ins reached phase 2 and scripts that still signed in as users began to break. We pulled service accounts, app registrations, cloud keys, SaaS OAuth grants and agents into one inventory and joined them on owner, last use and permissions. Unowned and unused identities went through disable, wait, then delete. Workloads moved to federation and managed identities, and the few static credentials that had to stay went into the vault with rotation.

why it was urgent

Scripts signing in to Azure as a user have started to break. That's phase 2 of Microsoft's mandatory MFA for Azure sign-ins, in effect from 1 October 2025. Workload identities are exempt. OWASP's 2025 Non-Human Identities Top 10 names improper offboarding and secret leakage among its top risks, along with long-lived secrets. Entra stops auto-granting AgentIdentity.CreateAsManager on 4 November 2026.

problem statement
  • openService accounts outnumber people in Active Directory and most have no owner.
  • recurringApp registrations hold client secrets that never expire.
  • blockedThere's still a script that signs in to Azure as a user, with a password and an MFA exclusion.
  • openNobody can say which SaaS apps hold OAuth grants to the tenant.
  • recurringSomebody's AI agents are running on ordinary app registrations with broad Graph permissions.
architecture

The estate, before and after

before
before

Before: unowned accounts, static secrets and user sign-ins

Scripts signed in to Azure as a user with an MFA exclusion, pipelines and agents used app registrations with long-lived secrets, and Windows services ran on service accounts nobody owned. SaaS OAuth grants were not listed anywhere.

Before: unowned accounts, static secrets and user sign-ins Scripts signed in to Azure as a user with an MFA exclusion, pipelines and agents used app registrations with long-lived secrets, and Windows services ran on service accounts nobody owned. SaaS OAuth grants were not listed anywhere. 01 · WORKLOADS 02 · CREDENTIALS 03 · TARGETS password sign-in MFA excluded stored secret borrowed identity client credentials OAuth grant hardcoded password Kerberos · NTLM Scheduled scripts sign in as a user CI/CD pipelines stored client secret AI agents on ordinary appregistrations Windows services app pools · scheduled tasks User account + MFAexclusion password in a script App registration secrets never expire AD service accounts no owner · static password Ex Azure and MicrosoftGraph broad Graphpermissions SaaS apps OAuth grants nobody lists On-premises apps file shares · databases © Cohash · cohash.com
01 · WORKLOADS02 · CREDENTIALS03 · TARGETS Scheduled scripts: sign in as a user Scheduledscripts sign in as a user CI/CD pipelines: stored client secret CI/CD pipelines stored clientsecret AI agents: on ordinary app registrations AI agents on ordinary appregistrations Windows services: app pools · scheduled tasks Windowsservices app pools ·scheduled tasks User account + MFA exclusion: password in a script User account+ MFAexclusion password in ascript App registration secrets: never expire Appregistrationsecrets never expire AD service accounts: no owner · static password AD serviceaccounts no owner ·static password Azure and Microsoft Graph: broad Graph permissions Azure andMicrosoftGraph broad Graphpermissions SaaS apps: OAuth grants nobody lists SaaS apps OAuth grantsnobody lists On-premises apps: file shares · databases On-premisesapps file shares ·databases password sign-in MFA excluded stored secret borrowed identity client credentials OAuth grant hardcoded password Kerberos · NTLM © Cohash · cohash.com
after
after

After: owned, federated machine identities under review

We moved workloads to federation and managed identities and gave agents their own identity type. The service accounts that had to stay rotate in the vault. One inventory feeds the certification campaigns, where owners review what their identities can reach.

After: owned, federated machine identities under review We moved workloads to federation and managed identities and gave agents their own identity type. The service accounts that had to stay rotate in the vault. One inventory feeds the certification campaigns, where owners review what their identities can reach. 01 · WORKLOADS 02 · IDENTITY AND SECRETS 03 · GOVERNANCE OIDC federation managed identity workload identity agent identity rotation SP and app data agents and sponsors vaulted accounts certification campaigns CI/CD pipelines no stored secret Azure workloads VMs · App Service ·Functions Kubernetes pods service account tokens AI agents sponsor and expiry Windows services dependencies mapped Ex Entra workloadidentities OIDC federation ·managed identity Entra Agent ID blueprints · sponsors Vault or PAM rotated staticpasswords NHI inventory owner · last use ·permissions SP SailPoint or Saviynt owner certifications © Cohash · cohash.com
01 · WORKLOADS02 · IDENTITY AND SECRETS03 · GOVERNANCE CI/CD pipelines: no stored secret CI/CDpipelines no storedsecret Azure workloads: VMs · App Service · Functions Azureworkloads VMs · AppService ·Functions Kubernetes pods: service account tokens Kubernetespods service accounttokens AI agents: sponsor and expiry AI agents sponsor and expiry Windows services: dependencies mapped Windowsservices dependenciesmapped Entra workload identities: OIDC federation · managed identity Entraworkloadidentities OIDC federation· managedidentity Entra Agent ID: blueprints · sponsors Entra AgentID blueprints ·sponsors Vault or PAM: rotated static passwords Vault or PAM rotated staticpasswords NHI inventory: owner · last use · permissions NHI inventory owner · last use ·permissions SailPoint or Saviynt: owner certifications SailPoint orSaviynt ownercertifications OIDC federation managed identity workload identity agent identity rotation SP and app data agents and sponsors vaulted accounts © Cohash · cohash.com
results

What the client got

What changed for the client once the work was done. Described, not scored: we don't publish client figures.

  1. result 01

    Every machine identity has an accountable owner

    We assigned owners using HR data and change records, and agreed escalation to application owners before the review started. Identities nobody claimed were put on a disable list with a date.

  2. result 02

    Pipelines and Azure workloads sign in without stored secrets

    OIDC federation, managed identities and Kubernetes workload identity replaced client secrets and scripts that signed in as a user, so nothing depends on an MFA exclusion any more.

  3. result 03

    Unused identities are disabled before they are deleted

    Nothing is deleted straight away. It's disabled, left for the waiting period, then deleted, and the rollback steps are written down, so a quarterly job that last-sign-in data missed comes back quickly.

  4. result 04

    Static passwords that remain rotate in the vault

    The accounts that still need passwords are in PAM or Vault, and they rotate. We mapped each one's scheduled tasks, app pools and Windows services before onboarding it.

  5. result 05

    Machine identities and agents go through access reviews

    Owners now certify their identities in campaigns. We made an owner and expiry mandatory at creation, and moved agents off app registrations and onto agent identity types.

what can go wrong

Risks we plan for

  1. Disabling something critical

    Last-sign-in data can miss a job that runs once a quarter. So we disable first and delete later, with a waiting period and a quick way to turn things back on.

  2. Owners who don't answer

    Without accountable owners, the inventory just sits there. We agree escalation paths to application owners and their managers before the review begins.

  3. Rotation outages

    A service account behind scheduled tasks, app pools and Windows services breaks if its password changes in one place but not the others. We map where it's used first.

  4. Agents built on borrowed identities

    Agents running on app registrations or personal tokens look like everything else in the inventory, so they're easy to miss. Each needs its own identity type and a sponsor.

ai in this move

Where AI helps, and where it needs guardrails

We move agents off app registrations and onto proper agent identities. Microsoft Entra Agent ID, now generally available, gives them identity blueprints, sponsors and access packages. Okta for AI Agents covers registration and certification. We do use AI agents ourselves, to draft owner suggestions and dependency maps from logs. But a person makes every disable, delete and rotation call.

forward deployed engineers →
you keep

What you're left with

We write these for your setup, and they're working documents. Your team should be able to keep things running from them long after we've gone.

  • inventory01

    Unified non-human identity inventory with owner, last use and permissions

    yours to keep
  • plan02

    Disable and delete schedule with rollback steps

    yours to keep
  • plan03

    Federation and managed identity migration plan per workload

    yours to keep
  • plan04

    Rotation onboarding plan with dependency maps

    yours to keep
  • design05

    Certification campaign design for machine identities and agents

    yours to keep
field notes

Learn the background

Terms from this page in plain English. If you want the why, the field note behind it is right there.

01sponsor
Whoever in the business answers for an agent. If it misbehaves, they're the one you call, and they decide whether it keeps running. Technical settings stay with the owner.in context →
02Service account
A non-human account that software signs in with. Shared ones tend to pick up years of extra permissions.in context →
03Rules
The JavaScript snippets Auth0 used to run at login. Someone would write one to add a role to the token or block a sign-in, and each one ran after the last.in context →
04PAM
PAM is privileged access management: the vault for admin and service account passwords, which also rotates them and checks who's asking.in context →
05dependencies
Services, scheduled tasks or app pools that use a vaulted account. The vault updates them when the password changes, but only if it knows about them.in context →
06Rotation
Changing privileged passwords automatically, on a timer or after each checkout. If one leaks, it soon stops working.in context →
01 Inventory 02 Mapconcepts safes to… 03 Rebuildrotation 04 Load inwaves 05 Retire oldvault
field note · 12 min · 3-question check CyberArk to Delinea (and back): what a PAM migration really involves the ideaGet rotation working on the new side first. Then move passwords a wave at a time. read the note
talent and delivery · owned, federated, short-lived machine identities

Certified engineers, wherever you need them.

Some clients want a project team, some want a couple of engineers on theirs. Either works. Onsite, nearshore or offshore, with handovers across time zones that keep things moving.

Onsite

Engineers at your sites in the US

Nearshore

Overlapping hours with US teams

Offshore

Overnight progress on your backlog

All time zones

Coverage handed over across time zones

24-hour coverage · US Central time
OnsiteUS business hours
Nearshoreoverlapping US hours
Offshoreovernight progress
Combinedhandover, not hand-off
01Do we need a dedicated NHI tool?

Not always. Entra ID, your IGA platform and the cloud IAM reports can produce a first inventory between them. A dedicated tool earns its cost when SaaS OAuth grants and secrets are spread over many platforms. We begin with the tools you already own and show you where they fall short.

02How many identities can we safely remove?

You can't tell until last-use data is in the inventory. Plenty of estates hold identities that stopped authenticating long ago. We still put every one through disable, wait, then delete.

03What drives the effort?

The number of systems to pull from, how many identities have no clear owner, and how many workloads need code or pipeline changes to use federation.

fact-checked Checked against vendor and official documentation last checked 2026-10-20 content fingerprint 567a66d4
  1. 01Book a 30-minute working sessionsenior engineer
  2. 02Talk to an engineer about your setupreply within 24 hours
  3. 03See how similar projects wentcase studies
Reviewed by the Cohash team Product names are trademarks of their owners. how we handle facts and data →
next step

Planning this move?

A 30-minute working session with a senior engineer. No slides.

useful to bring
  • The platform and the version you're on
  • Where you need to get to, and by when
  • What's custom: rules, plugins, integrations
  • Any audit finding or deadline driving it