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
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.
Ask an engineer facts checked 2026-10-20 · 6 sources
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 and Delinea Server Suite zones to modern server identity

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
Read the diagram as text
  1. CI pipeline job → CI OIDC issuer: request token
  2. Kubernetes pod → Projected SA token: projected token
  3. Kubernetes pod → SPIRE server: workload attestation
  4. CI OIDC issuer → Federated credential: OIDC token exchange
  5. Projected SA token → Federated credential: token exchange
  6. On-premises server → IAM Roles Anywhere: X.509 certificate
  7. Federated credential → Cloud APIs: short-lived token
  8. IAM Roles Anywhere → Cloud APIs: temporary credentials
  9. SPIRE server → Peer services: SVID for mTLS
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
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.

sources 6 sources linked last checked 2026-10-20 content fingerprint d9aa8786
  1. 01GitHub Docs: OpenID Connect in GitHub Actionsdocs.github.com ↗
  2. 02Microsoft Learn: Workload identity federationlearn.microsoft.com ↗
  3. 03Microsoft Learn: Microsoft Entra Workload ID on AKSlearn.microsoft.com ↗
  4. 04Microsoft Learn: Federate a SPIFFE/SPIRE workload identitylearn.microsoft.com ↗
  5. 05CNCF: SPIFFE and SPIRE graduate (20 Sep 2022)cncf.io ↗
  6. 06AWS: IAM Roles Anywhere, mapping identities to workloadsdocs.aws.amazon.com ↗
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