// 23 · architecture
Identity and access: people, workloads and keyless CI
Let people, pipelines and applications reach the cloud with federated identities and short-lived credentials, with no static keys stored anywhere, temporary privileges and everything audited.
Code and layout on GitHub ↗What it must guarantee
- No person, pipeline or application uses long-lived access keys.
- People sign in through SSO with MFA and get permissions by group; production privileges are temporary.
- The pipeline only gets credentials for its repository, branch and workflow, and the deploy identity cannot widen its own permissions.
- Every workload has its own identity with the permissions it uses, and secrets are read at runtime.
- There is a tested emergency access path that does not depend on the IdP, and using it raises an alert.
- Every action on resources lands in an audit log that workload administrators cannot delete.
On-premises Keycloak is the IdP with MFA, groups map to Kubernetes RBAC, OpenBao accepts GitHub Actions OIDC tokens and issues dynamic secrets, SPIFFE/SPIRE gives workloads an identity and Wazuh centralises the audit trail.
- OpenBao (the open fork of Vault) validates the GitHub token with its
jwtauth method against thetoken.actions.githubusercontent.comissuer; conditions go inbound_claims(repository, branch, environment). - Dynamic secrets (database engine, PKI) expire on their own: a leaked credential stops working in minutes or hours, not months.
- SPIRE issues X.509 or JWT SVIDs per workload; OpenBao can accept JWT-SVIDs to hand out secrets with no bootstrap secret in the container.
- There is no native just-in-time access: approximate it with Keycloak groups granted for a limited time and short-TTL OpenBao credentials.
- The cost is operations: Keycloak and OpenBao in high availability, OpenBao unsealing, SPIRE CA rotation and someone maintaining the policies.
AWS IAM Identity Center federates with the corporate IdP and assigns permission sets by group, GitHub Actions assumes IAM roles through the OIDC provider, EKS Pod Identity gives each pod a role and an organisation CloudTrail records everything.
- Permission sets are standing assignments, not temporary access. For time-bound elevation with approval, AWS points to partners integrated with Identity Center or its open-source TEAM solution (Temporary Elevated Access Management).
- The
planrole trusts only the repository'spull_requestevent (by name and immutable ID) and only reads; theapplyrole requires the protected environment, themainbranch and the workflow file (job_workflow_ref), and carries a permissions boundary that stops it from touching the CI roles, the OIDC provider and the state bucket. - EKS Pod Identity needs no per-cluster OIDC provider and one trust policy serves several clusters; it does not work on Fargate, Windows, Outposts or EKS Anywhere, where IRSA is still the answer.
- Centralised root access management lets you remove root credentials from member accounts; emergency access is left to a few identities with hardware MFA and an alarm on every use.
- Identity Center and IAM roles cost nothing; Secrets Manager bills per secret and per call, and CloudTrail beyond the first copy of management events and for data events.
Azure Microsoft Entra ID is the IdP with Conditional Access, Entra PIM makes Azure roles eligible with time-bound activation, GitHub Actions signs in with federated credentials on managed identities and AKS uses Workload Identity with Key Vault.
- PIM requires Microsoft Entra ID P2 or Entra ID Governance licences for the people who elevate or approve; it supports maximum duration, justification, approval and MFA on activation.
- Each federated credential matches one specific
subject(repo:org/repo:pull_request,repo:org/repo:environment:prod), so plan and apply are two separate managed identities with different roles. - The apply identity should not hold unrestricted
OwnerorUser Access Administrator: if it must assign roles, useRole Based Access Control Administratorwith conditions that limit which roles it can assign and to whom. - AKS Workload Identity federates the Kubernetes service account with a managed identity; the pod gets Entra tokens with no mounted secrets.
- The Activity Log is kept for 90 days at no cost; sending it to Log Analytics or Storage for longer retention is billed by ingestion and storage.
Google Cloud Cloud Identity (or federation with the corporate IdP) authenticates people, Privileged Access Manager grants temporary roles, Workload Identity Federation exchanges the GitHub token for a service account and GKE gives each pod its own identity.
- Privileged Access Manager works with entitlements at organisation, folder or project level: a grant adds a conditional IAM binding that expires on its own, with optional approval and a record in Cloud Audit Logs.
- The Workload Identity Federation provider must carry an attribute condition on
repository_idandrepository_owner_id; without it, any GitHub repository could present a valid token. - Workload Identity Federation for GKE (formerly GKE Workload Identity) lets you grant roles directly to the Kubernetes service account principal, with no intermediate Google service account.
- To stop apply from widening itself, the CI service accounts live in a separate project where apply has no IAM roles; an IAM deny policy reinforces the boundary.
- Admin Activity logs are free and always on; Data Access logs are off by default (except BigQuery) and billed by volume once enabled.
Options by cost and scope
From the cheapest option to the most resilient. The "How it is built" column follows the selected platform.
| Option | Cost | Operations | How it is built | What you give up |
|---|---|---|---|---|
| Small teamOne or two accounts or subscriptions, one infrastructure repository and a handful of administrators. | €€€€ | On-premisesKeycloak with WebAuthn, groups mapped to Kubernetes RBAC and a single-node OpenBao with JWT auth for GitHub Actions.AWSIAM Identity Center with two or three permission sets, the GitHub OIDC provider with plan and apply roles, and task roles or Pod Identity for workloads.AzureEntra ID with Conditional Access and MFA, two managed identities with federated credentials for plan and apply, and Key Vault.Google CloudCloud Identity with groups, one Workload Identity Federation pool with two service accounts, and Secret Manager. | Administrators hold standing privileges and audit stays in the native service without correlation; acceptable while the team is small and everyone knows each other. | |
| Organisation with separate environmentsSeveral teams, production in its own accounts or subscriptions, and a duty to prove who changed what. | €€€€ | On-premisesHighly available Keycloak federated with the directory, clustered OpenBao with dynamic secrets and SPIRE for workloads.AWSIdentity Center with IdP groups through SCIM, temporary access with TEAM or a partner, CI roles per account and an organisation CloudTrail in the log archive account.AzureEntra PIM for production roles, Workload Identity on AKS and the Activity Log of every subscription in a central Log Analytics workspace.Google CloudPrivileged Access Manager for production, Workload Identity Federation per environment and an organisation log sink. | More moving parts and licences (PIM needs P2 or Governance); temporary access adds friction during incidents if approvals are not well designed. | |
| Regulated environmentSensitive data, external audits and mandatory phishing-resistant MFA and access reviews. | €€€€ | On-premisesMandatory passkeys or FIDO2 keys in Keycloak, OpenBao backed by an HSM, SPIRE federated across clusters and Wazuh shipping to a SIEM with immutable retention.AWSAll of the above plus FIDO2 keys at the IdP, IAM Access Analyzer for unused permissions, GuardDuty and logs in S3 with Object Lock.AzureAll of the above plus mandatory passkeys, ID Governance Access Reviews, Entra ID Protection and Microsoft Sentinel.Google CloudAll of the above plus mandatory security keys, IAM recommendations, Security Command Center and log buckets with a retention lock. | Licence and SIEM costs, and a review process someone has to run every quarter; in return, audit stops being a manual search. |
Extensions
Pieces you add to the base design when you need them.
| Extension | When | Service | Cost impact |
|---|---|---|---|
| Approval-based temporary access | When nobody should hold write permissions in production outside a change or an incident. | On-premisesTemporary groups + OpenBao TTLsAWSTEAM or partner with Identity CenterAzureEntra PIM with approvalGoogle CloudPrivileged Access Manager | Medium |
| Phishing-resistant MFA | Always for administrators; for everyone once there is sensitive data. | On-premisesKeycloak WebAuthn / passkeysAWSFIDO2 at the IdP or Identity CenterAzurePasskeys (FIDO2) in Entra IDGoogle CloudSecurity keys / passkeys | Low |
| Passwordless database credentials | When applications currently keep a database username and password in a secret. | On-premisesOpenBao database engineAWSIAM authentication on AuroraAzureEntra auth on PostgreSQLGoogle CloudIAM authentication on Cloud SQL | Low |
| Identity for machines outside the cloud | Servers in the data centre or another cloud that use static keys to call the cloud today. | On-premisesSPIRE agents on the VMsAWSIAM Roles AnywhereAzureAzure Arc-enabled serversGoogle CloudWorkload Identity Fed. with X.509 | Low |
| Identity abuse detection | When you need to hear about an impossible-travel sign-in or a role used from an odd IP without reading logs by hand. | On-premisesWazuh rules + SIEMAWSAmazon GuardDutyAzureEntra ID ProtectionGoogle CloudSecurity Command Center | Medium |
| Unused permission review | When roles grow by accretion and nobody knows which permissions are still needed. | On-premisesKeycloak group reportAWSIAM Access AnalyzerAzureAccess Reviews (ID Governance)Google CloudIAM recommendations | Low |
How to save
- Centralise human access in IAM Identity Center, Entra ID or Cloud Identity and remove IAM users and local accounts: SSO is not billed separately and every local user is one more secret to rotate.
- Assign Entra ID P2 or ID Governance licences only to people with eligible PIM roles or who approve them, not to the whole workforce.
- Use workload identity against the target service (IAM database authentication, managed identity to Storage) instead of storing secrets: Secrets Manager and Secret Manager bill per secret and per access, Key Vault per operation.
- Cache secrets in the application or with the OpenBao agent instead of reading them on every request; per-call cost and latency drop together.
- Enable only the CloudTrail data events and Cloud Audit Logs Data Access logs you will actually look at (state buckets, secrets, sensitive data); turning them on for everything multiplies the volume.
- Move old audit logs to cold storage (S3 Glacier, Blob Storage archive tier, Cloud Storage Archive class) and keep only the investigation window in the SIEM.
Equivalents by platform
| Piece | On-premises | AWS | Azure | Google Cloud |
|---|---|---|---|---|
| IdP + SSO | Keycloak | IAM Identity Center | Microsoft Entra ID | Cloud Identity |
| Just-in-time access | Grupos + RBAC | Identity Center + TEAM | Entra PIM | Privileged Access Mgr |
| OIDC federation | OpenBao JWT auth | IAM OIDC provider | Federated credentials | Workload Identity Fed. |
| Plan / apply identities | OpenBao policies | IAM roles | Managed identities | Service accounts |
| Workload | Pod · function · VM | Pod · function · VM | Pod · function · VM | Pod · function · VM |
| Workload identity | SPIFFE / SPIRE | EKS Pod Identity | Workload Identity | GKE Workload Identity |
| Secrets | OpenBao (dynamic) | Secrets Manager | Key Vault | Secret Manager |
| Resources | Kubernetes / VMs | AWS accounts | Subscriptions | Projects |
| Audit | Wazuh | AWS CloudTrail | Activity Log | Cloud Audit Logs |
In depth
When you need it
When someone finds an access key in a .env file, in a GitHub secret nobody remembers creating or on a former employee’s laptop. Long-lived keys do not expire, do not say who is using them and usually carry more permissions than needed. This case replaces all of them with three flows using credentials that last minutes or hours: people through SSO with MFA, pipelines through OIDC federation and workloads through the platform’s own identity.
It is also the piece that makes every other case safe: if the identity that deploys can grant itself more permissions, any change merged to main can make itself administrator.
Scenarios
- Startup with one account and one repository. Start with what removes the most risk: SSO with MFA for the team and OIDC for GitHub Actions. One plan role and one apply role are enough; temporary access can wait while there are three administrators who know each other.
- Company with several teams and separate production. Each environment lives in its own account, subscription or project, with its own pair of CI identities. Production permissions become eligible (PIM, Privileged Access Manager or TEAM on AWS) and the SOC receives the audit trail of every environment.
- Regulated sector with data in the EU. Mandatory phishing-resistant MFA, quarterly access reviews, logs with immutable retention and an emergency account that is tested and documented. The auditor will want to see who approved each elevation.
- Customer who requires on-premises. Keycloak, OpenBao and SPIRE cover the same three flows. OpenBao validates the GitHub Actions OIDC token just as AWS would, as long as it can reach the issuer’s public keys.
- Workloads outside the cloud calling the cloud. Data centre servers that upload files to S3 or Blob Storage stop using keys with IAM Roles Anywhere, Azure Arc or Workload Identity Federation with X.509 certificates.
How it fits together
The diagram has three rows, one per identity type, and they all end at the same resources and the same audit trail.
- People. The user signs in to the IdP with MFA. The IdP grants read access by group and, when they need to write to production, they request a temporary elevation: an eligible permission activated with a justification (and approval, if policy requires it) that expires on its own.
- CI. The GitHub Actions job asks GitHub for a signed OIDC token that describes repository, branch, event, environment and workflow. Federation validates it against its conditions and returns credentials for the matching identity: plan, read-only, for pull requests; apply, only for the protected branch and the environment with reviewers. The apply identity has a boundary (permissions boundary, RBAC conditions or a separate project) that prevents it from changing the CI identities, its own trust and the protection of the state storage. A person creates those identities with a separate bootstrap stack.
- Workloads. The pod, function or VM gets a token from the platform (projected service account, managed identity, metadata server) and exchanges it for cloud credentials or for a secret from the secret store. No bootstrap secret travels in the image.
Every access to resources, allowed or denied, ends up in the central audit log, out of reach of the people who administer the workloads.
Deployment: Docker, Kubernetes or serverless
Workload identity is what changes most depending on where things run:
- Docker Compose on one host. No platform issues a per-container identity. The usual answer is an OpenBao agent (or a SPIRE agent with the Docker workload attestor) on the host that authenticates once and writes secrets to a
tmpfsvolume the container mounts read-only. The host is the root of trust: if it is compromised, all its containers fall with it. - Kubernetes on-premises (k3s, RKE2). Service accounts with projected tokens are the identity. OpenBao validates them with its
kubernetesauth method, or SPIRE issues an SVID per pod. External Secrets Operator or the OpenBao injector deliver secrets to the pod, and cert-manager issues internal certificates. - Cloud without Kubernetes. The simplest option: the ECS task role, the Container Apps managed identity, the Cloud Run service account or the Lambda execution role already are workload identity. Just give each service its own identity and do not reuse the platform’s (the ECS execution role is not the task role).
- Managed Kubernetes. EKS Pod Identity, AKS Workload Identity and Workload Identity Federation for GKE bind a Kubernetes service account to cloud permissions. EKS on Fargate still needs IRSA.
| Option | Workload identity | Operations | When |
|---|---|---|---|
| Compose on one host | OpenBao or SPIRE agent on the host | Medium | On-premises product or a single server |
| Self-managed Kubernetes | Service accounts + OpenBao or SPIRE | High | Many services outside the cloud |
| PaaS / functions | Built into the service | Low | Default choice in the cloud |
| Managed Kubernetes | Pod Identity / Workload Identity | Medium | You already run EKS, AKS or GKE |
Key decisions
- One CI identity or two. Splitting plan and apply costs little and changes a lot: a malicious pull request can edit the workflow, so the only thing that makes it harmless is that the plan identity can only read. Apply relies on the branch and environment being protected with reviewers.
- Which claims to check. Checking only
audlets any GitHub repository in. The minimum issubwith repository and branch or environment; better to add the immutable repository and organisation IDs (they survive a rename and stop someone recreating a repository with the same name) and the workflow file. - Temporary elevation or standing privileges. Elevation shrinks the window in which a stolen session is useful, but adds friction. Use short durations, approval only for the most critical roles and a fast path for incidents.
- Dynamic secrets or rotation. A dynamic secret is created per request and expires on its own; scheduled rotation leaves the secret valid for weeks. If the database supports identity-based authentication, you do not need a secret at all.
- Emergency account. Two cloud-only identities, outside federation, with a FIDO2 key kept in a safe, excluded only from the policies that depend on the IdP and with an alert on every sign-in. Test them every few months.
Common pitfalls
- Trusting the OIDC provider with no condition on the repository, or with wildcards such as
repo:org/*. - Giving the apply identity unrestricted administrator permissions: it can create a new role with more privileges and assume it.
- Using
pull_request_targetwith a checkout of the pull request’s code: it runs someone else’s code with the base branch’s secrets and permissions. - Keeping old keys “just in case” after moving to OIDC.
- An emergency account that depends on the same IdP or the same Conditional Access that fails during the emergency.
- Not enabling or reviewing data access logs on sensitive resources (Terraform state, secrets): management audit does not tell you who read the state.
These are starting points, not recipes: size, cost and compliance requirements change the choice.