non-human identities · workload identity

Your deploy pipeline shouldn't hold a cloud key that works forever.

An access key pasted into a CI variable years ago is still one of the easiest ways into a cloud account. We move pipelines, containers and servers to workload identity federation, where each job gets a short-lived token tied to what it is, and then we delete the old key.

platforms
cybersecurity / machine-workload-identity 3 platforms
01 · WORKLOADS 02 · WORKLOAD IDENTITY 03 · TRUST AND EXCHANGE 04 · RESOURCES CI pipeline job: GitHub Actions · GitLab CI CI pipeline job GitHub Actions ·GitLab CI Kubernetes pod: AKS · EKS · GKE Kubernetes pod AKS · EKS · GKE On-premises server: certificate from your CA On-premises server certificate from yourCA CI OIDC issuer: repo · branch · environment claims CI OIDC issuer repo · branch ·environment claims Projected SA token: one service account per app Projected SA token one service accountper app SPIRE server: node and workload attestation SPIRE server node and workloadattestation Federated credential: Entra Workload ID · AWS IAM role Federated credential Entra Workload ID ·AWS IAM role IAM Roles Anywhere: X.509 for temporary AWS creds IAM Roles Anywhere X.509 for temporaryAWS creds Cloud APIs: Azure · AWS · Google Cloud Cloud APIs Azure · AWS · GoogleCloud Peer services: mTLS across clusters Peer services mTLS across clusters
01 · WORKLOADS02 · WORKLOAD IDENTITY03 · TRUST AND EXCHANGE04 · RESOURCES CI pipeline job: GitHub Actions · GitLab CI CI pipelinejob GitHub Actions· GitLab CI Kubernetes pod: AKS · EKS · GKE Kubernetespod AKS · EKS · GKE On-premises server: certificate from your CA On-premisesserver certificatefrom your CA CI OIDC issuer: repo · branch · environment claims CI OIDCissuer repo · branch ·environmentclaims Projected SA token: one service account per app Projected SAtoken one serviceaccount per app SPIRE server: node and workload attestation SPIRE server node andworkloadattestation Federated credential: Entra Workload ID · AWS IAM role Federatedcredential Entra Workload ID· AWS IAM role IAM Roles Anywhere: X.509 for temporary AWS creds IAM RolesAnywhere X.509 fortemporary AWS… Cloud APIs: Azure · AWS · Google Cloud Cloud APIs Azure · AWS ·Google Cloud Peer services: mTLS across clusters Peer services mTLS acrossclusters © Cohash · cohash.com
TerraformMicrosoft Entra IDHashiCorp Vault
in short·15-second read

Machine and workload identity gives software its own verifiable identity.

Pipelines, containers and servers can then authenticate without stored passwords or keys. Cohash replaces static cloud credentials with federation. We use GitHub Actions OIDC for AWS, Azure and Google Cloud, and Microsoft Entra Workload ID for Kubernetes. SPIFFE and SPIRE cover services that span clouds, and AWS IAM Roles Anywhere covers servers outside AWS.

you probably need this if
  • Deploy pipelines hold cloud access keys that never expire.
  • Kubernetes workloads in one namespace share a single service account.
  • Entra app registrations still authenticate with client secrets.
terms on this page ActionsdefinitionThe replacement for both. Each one is a small JavaScript function you attach to a trigger such as post-login. It carries its own secrets, and other Actions can't read them.explained in a field note →Workload identity federationdefinitionA trust set up so a pipeline outside Azure, such as GitHub Actions, can swap its own short-lived token for an Azure token without storing any secret.explained in a field note →federationdefinitionMirroring the Hive metastore as a foreign catalog in Unity Catalog, so Unity Catalog permissions apply to old tables before they move.explained in a field note →workload identitydefinitionAn identity for software rather than a person. The Entra provisioning service uses one to prove who it is with a short-lived token, so nobody has to store a password for it.explained in a field note →
Ask an engineer facts checked 2026-10-20
how it runs
  1. 01Inventory static credentials
  2. 02Pick a pattern per workload
  3. 03Migrate and verify
  4. 04Add guardrails
you keep
  • Static credential inventory mapped to workloads
  • Federation trust configuration as Terraform
  • Workload identity pattern guide per platform
+ 2 more documents
who does it
Workload identity engineerKubernetes platform engineerVault engineer Vault Associate (003)
platforms
the story · machine & workload identity

From the first call to a setup your own team can run.

Here's what usually prompts a call about your Machine & Workload Identity, what we do about it and in which order, and where you end up.

  1. chapter 01 · where it hurts

    Why teams reach out

    • Deploy pipelines hold cloud access keys that never expire.
    • Kubernetes workloads in one namespace share a single service account.
    • Entra app registrations still authenticate with client secrets.
  2. chapter 02 · what we change

    How we solve it

    • CI/CD federation
    • Kubernetes workload identity
    • SPIFFE and SPIRE
    • Servers outside the cloud
    • Static credential retirement
    • Least-privilege role design
  3. chapter 03 · how it runs

    Our approach

    • Inventory static credentials
    • Pick a pattern per workload
    • Migrate and verify
    • Add guardrails
  4. chapter 04 · where you end up

    What changes

    • Production deploys get short-lived credentials only from the protected environment, the admin IAM user is gone, and a fork or feature branch can't assume the prod role.
    • Pods get tokens tied to their own service account, no client secret sits in the cluster, and the subscription-wide grant is gone.
    • The servers now get temporary AWS credentials based on their machine certificate.
    • Static credential inventory mapped to workloads
what we do

Where we spend the hours

6 areas of work, each one done by an engineer who has run it in production.

  1. Pipelines trade their OIDC token for cloud credentials scoped to one repository, branch or environment. We write the trust conditions tightly enough that a fork or a feature branch can't deploy to production.

  2. Pods on AKS use Microsoft Entra Workload ID through projected service account tokens, and we apply the equivalent native pattern on other clusters. One Kubernetes service account per workload, never one shared per namespace.

  3. Services that talk mTLS across clusters and clouds get SPIFFE identities from SPIRE, which attests both the node and the workload first. Both projects graduated from the CNCF in 2022. Entra can federate with SPIFFE identities.

  4. IAM Roles Anywhere trades an X.509 certificate from your own CA for temporary AWS credentials. Entra federated identity credentials do the same thing for tokens from an outside issuer. No long-lived key either way.

  5. Entra app registrations with client secrets. AWS access keys nobody uses. Google service account keys. We find them, match each to its workload, and retire them once federation is working.

  6. Roles shaped from the API calls each workload actually makes in cloud audit logs, with permission boundaries or deny policies that stop privileges creeping back.

capability 01 / 06in production

CI/CD federation

Pipelines trade their OIDC token for cloud credentials scoped to one repository, branch or environment. We write the trust conditions tightly enough that a fork or a feature branch can't deploy to production.

capability 02 / 06in production

Kubernetes workload identity

Pods on AKS use Microsoft Entra Workload ID through projected service account tokens, and we apply the equivalent native pattern on other clusters. One Kubernetes service account per workload, never one shared per namespace.

capability 03 / 06in production

SPIFFE and SPIRE

Services that talk mTLS across clusters and clouds get SPIFFE identities from SPIRE, which attests both the node and the workload first. Both projects graduated from the CNCF in 2022. Entra can federate with SPIFFE identities.

capability 04 / 06in production

Servers outside the cloud

IAM Roles Anywhere trades an X.509 certificate from your own CA for temporary AWS credentials. Entra federated identity credentials do the same thing for tokens from an outside issuer. No long-lived key either way.

capability 05 / 06in production

Static credential retirement

Entra app registrations with client secrets. AWS access keys nobody uses. Google service account keys. We find them, match each to its workload, and retire them once federation is working.

capability 06 / 06in production

Least-privilege role design

Roles shaped from the API calls each workload actually makes in cloud audit logs, with permission boundaries or deny policies that stop privileges creeping back.

typical situations

Situations we walk into

We pieced these together from Machine & Workload Identity situations that come up a lot. They're patterns. You won't find a specific client in them.

case file 01

GitHub Actions deploying to AWS with an admin access key per environment

composite · not a client story
  1. Beforethe situation

    Every repository keeps AWS access keys for dev, staging and prod as secrets. The prod key belongs to an IAM user with AdministratorAccess that someone created years ago. Any workflow on any branch can read it.

  2. What we dothe work

    Add GitHub as an IAM OIDC identity provider, then create one role per repository and environment whose trust policy matches the sub claim on both. Switch workflows to configure-aws-credentials with role-to-assume, check CloudTrail for the old key's last use, then deactivate it.

  3. Afterwhere you end up

    Production deploys get short-lived credentials only from the protected environment, the admin IAM user is gone, and a fork or feature branch can't assume the prod role.

case file 02

AKS pods sharing one service principal secret with subscription Contributor

composite · not a client story
  1. Beforethe situation

    Every pod in an AKS namespace mounts the same client secret from a Kubernetes secret. The service principal behind it has Contributor on the whole subscription, and rotation happens when someone remembers.

  2. What we dothe work

    Turn on the cluster's OIDC issuer and workload identity, create a user-assigned managed identity per workload with a federated credential bound to its Kubernetes service account, and grant each only the Key Vault or storage scope it uses. Delete the shared secret after the last pod moves.

  3. Afterwhere you end up

    Pods get tokens tied to their own service account, no client secret sits in the cluster, and the subscription-wide grant is gone.

case file 03

Data center servers uploading to S3 with a key in a config file

composite · not a client story
  1. Beforethe situation

    Linux servers in a colocation facility push files to S3 with an IAM user's access key sitting in a config file. Meanwhile the internal PKI already issues machine certificates to those same servers.

  2. What we dothe work

    Register the internal CA as an IAM Roles Anywhere trust anchor, create a profile and role scoped to the bucket prefix each server writes, and wire the credential helper into the SDK's credential process. Retire the IAM user once CloudTrail shows no further use.

  3. Afterwhere you end up

    The servers now get temporary AWS credentials based on their machine certificate. When one is decommissioned, you revoke the certificate. No one goes looking for an access key in a config file.

case studies

Machine & Workload Identity case studies

All case studies
modernization Privileged access

Centrify alternatives, and how we untangle Server Suite zones

Untangling Centrify and Delinea Server Suite zones, UID maps and dzdo roles, and moving Linux and Windows servers to a server identity model you can run.

read the case study
modernization Cloud and infrastructure

Hand-built cloud to Terraform or OpenTofu

Bringing console-built AWS, Azure and Google Cloud resources under Terraform or OpenTofu with import blocks, clean state and pipelines, without rebuilding.

read the case study
modernization Privileged access

Secrets in code, pipelines and config files to HashiCorp Vault

We track down passwords, API keys and tokens in repositories, CI variables and config files and move them into HashiCorp Vault, with short-lived credentials.

read the case study
modernization Security operations

Service account, API key and non-human identity cleanup

Tracking down every service account, app registration, API key and AI agent, putting an owner on each and moving them to short-lived, federated credentials.

read the case study
migration Identity and access

On-premises Active Directory to cloud-first Microsoft Entra ID

We shrink on-premises Active Directory one application at a time, moving groups, users and app authentication to Microsoft Entra ID as each app is ready.

read the case study
migration Identity and access

AD FS federation to Entra ID authentication

Converting federated domains from AD FS to Entra ID cloud authentication, moving relying parties app by app and retiring the AD FS farm.

read the case study
architecture

How a workload trades its own identity for a short-lived cloud token

Each CI job, pod and server gets a token or certificate saying what it is. It trades that for short-lived cloud credentials through a federated trust. Where workloads span clouds, SPIRE handles service-to-service mTLS.

How a workload trades its own identity for a short-lived cloud token Each CI job, pod and server gets a token or certificate saying what it is. It trades that for short-lived cloud credentials through a federated trust. Where workloads span clouds, SPIRE handles service-to-service mTLS. 01 · WORKLOADS 02 · WORKLOAD IDENTITY 03 · TRUST AND EXCHANGE 04 · RESOURCES request token projected token workload attestation OIDC token exchange token exchange X.509 certificate short-lived token temporary credentials SVID for mTLS CI pipeline job GitHub Actions · GitLab CI Kubernetes pod AKS · EKS · GKE On-premises server certificate from your CA CI OIDC issuer repo · branch ·environment claims Projected SA token one service account perapp SPIRE server node and workloadattestation Ex Federatedcredential Entra Workload ID ·AWS IAM role IAM Roles Anywhere X.509 for temporary AWScreds Cloud APIs Azure · AWS · Google Cloud Peer services mTLS across clusters © Cohash · cohash.com
01 · WORKLOADS02 · WORKLOAD IDENTITY03 · TRUST AND EXCHANGE04 · RESOURCES CI pipeline job: GitHub Actions · GitLab CI CI pipelinejob GitHub Actions· GitLab CI Kubernetes pod: AKS · EKS · GKE Kubernetespod AKS · EKS · GKE On-premises server: certificate from your CA On-premisesserver certificatefrom your CA CI OIDC issuer: repo · branch · environment claims CI OIDCissuer repo · branch ·environmentclaims Projected SA token: one service account per app Projected SAtoken one serviceaccount per app SPIRE server: node and workload attestation SPIRE server node andworkloadattestation Federated credential: Entra Workload ID · AWS IAM role Federatedcredential Entra Workload ID· AWS IAM role IAM Roles Anywhere: X.509 for temporary AWS creds IAM RolesAnywhere X.509 fortemporary AWS… Cloud APIs: Azure · AWS · Google Cloud Cloud APIs Azure · AWS ·Google Cloud Peer services: mTLS across clusters Peer services mTLS acrossclusters request token projected token workload attestation OIDC token exchange token exchange X.509 certificate short-lived token temporary credentials SVID for mTLS © Cohash · cohash.com
how it runs

A typical engagement

We don't start a step until the last one has produced something you can check.

  1. step 01

    Inventory static credentials

    Cloud access keys, client secrets and service account keys, each matched to the workload that uses it.

  2. step 02

    Pick a pattern per workload

    Federation for CI and cloud-native workloads, SPIFFE for mesh traffic, and vault-issued credentials for the rest.

  3. step 03

    Migrate and verify

    New trust configured, workload switched, old key disabled and watched before it's deleted.

  4. step 04

    Add guardrails

    New long-lived keys are blocked by policy. If you need an exception, it's tracked and gets an end date.

you keep

What you're left with

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

  • inventory01

    Static credential inventory mapped to workloads

    yours to keep
  • code02

    Federation trust configuration as Terraform

    yours to keep
  • guide03

    Workload identity pattern guide per platform

    yours to keep
  • document04

    Key retirement log with disable and delete dates

    yours to keep
  • guide05

    Preventive policies for new long-lived keys

    yours to keep
talent and delivery · machine & workload identity

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
certifications our engineers hold
  • Vault Associate (003)HashiCorp
roles we staff
  • Workload identity engineer
  • Kubernetes platform engineer
  • Vault engineer
  • Cloud IAM engineer
  • PKI engineer
01Can we get rid of every static credential?

Not every one. Many SaaS APIs and older databases only accept API keys or passwords. Those move into a vault with rotation, which our secrets and certificate page covers. CI-to-cloud and cloud-to-cloud access can almost always use federation.

02Do we need SPIRE if we're on a single cloud?

Usually not. The cloud's own workload identity handles single-cloud estates well. SPIRE earns its operating cost when you need one identity scheme across several clouds, on-premises clusters, or a service mesh with mTLS everywhere.

03What breaks when we turn off an old access key?

Whatever still uses it, which is why we disable before we delete. We check cloud audit logs for the key's last use, disable it, wait through at least one full business cycle including month-end jobs, then delete it.

04How do we stop a pull request from a fork deploying to production?

With narrow trust conditions on the federated credential. Match the repository, the branch or environment, and ideally the workflow, rather than the organization alone. We review every trust policy for wildcards before go-live.

05How long does a move to workload identity federation take?

It depends on how many static credentials you have and how many workloads share each one. A single pipeline can move in a day. A key shared by many consumers takes longer, because every one has to switch before the key is disabled. We size it after the credential inventory.

related

Often paired with

Projects on Machine & Workload Identity usually end up touching one of these, so they're worth a look.

fact-checked Checked against vendor and official documentation last checked 2026-10-20 content fingerprint d9aa8786
  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

Tell us what you're running. We'll tell you what we'd do first.

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