How to Reduce Overprivileged Kubernetes Service Accounts
Kubernetes ServiceAccounts end up with cluster-admin as quick workarounds, and the bindings spread through Terraform modules, Helm charts, GitOps repos and bootstrap scripts. A workload's effective permissions are the union of Kubernetes RBAC and any cloud IAM role it reaches via workload identity federation, so auditing each layer separately misses real risk. Remediation comes in steps: audit cluster-admin bindings and legacy pre-1.24 token secrets with kubectl/jq, disable token automount for pods that don't call the API, and replace ClusterRoleBindings with namespace-scoped Roles. Static credentials should give way to OIDC SSO, workload identity federation or SPIFFE/SPIRE short-lived certificates.
Related posts
- Kubernetes v1.37: Pod Certificates and Cluster Trust Bundles
Kubernetes Blog mediumAdeptKubernetes 1.37 graduates Pod Certificates and Cluster Trust Bundles to GA, building X.509 certificate issuance for TLS and mTLS into core Kubernetes as a proof-of-possession alternative to bearer-token service account JWTs. Kubelet generates private keys, creates PodCertificateRequest objects for a pluggable signer controller, writes keys and chains (optionally as a single credential bundle file) to projected volumes, and rotates them at the signer-specified beginRefreshAt time, while node restriction admission prevents cross-node certificate requests. Applications must reload credentials via inotify or polling; core signers will cap lifetimes at 24 hours and third-party signers at 91 days. Since no signers ship in core yet, the Tinycert toy signer offers service DNS and SPIFFE certificates plus a Go library for SPIFFE Filesystem Delivery.
- How to Tie Kubernetes Audit Logs to Individual Engineers
Teleport mediumAdept
Kubernetes audit events record whatever identity the API server authenticates, so shared client certificates, proxies that send only their own ServiceAccount token, or cloud IAM mappings that collapse engineers into one username all make attribution to a person impossible. Per-engineer credentials with group-based RBAC keep individual usernames, and proxies can preserve them through impersonation, where the audit event shows the proxy under `user` and the engineer under `impersonatedUser`. On managed clusters such as EKS, access entries and per-person STS session names carry the individual into the Kubernetes username. The audit log also stops at the `kubectl exec` connection and never sees commands typed in the shell, so a session recorder is needed to review terminal activity.
- How Hugging Face Scaled Secrets Management for AI Infrastructure
Hugging Face mediumAdeptHugging Face moved secrets management to Infisical as its infrastructure grew from AWS-only to multi-cloud (Azure, GCP), choosing it over HashiCorp Vault for developer workflows and multi-cloud abstraction. In Kubernetes, the Infisical Operator syncs secrets via an InfisicalSecret CRD into native Kubernetes secrets and can auto-reload Deployments. Engineers still prefer manual redeploys for control at over 10 million requests per minute. RBAC is mapped from Okta groups, the CLI replaces local .env files, and CI/CD uses GitHub Actions with OIDC, Terraform and self-hosted runners.
- How we built Render OIDC
Render mediumAdept
Render issues per-service OIDC tokens so workloads can authenticate to AWS, GCP, OpenAI and Anthropic without long-lived API keys. Tokens expire after 60 minutes as a tradeoff between leak exposure and tolerance for issuer outages. Per-workspace issuer URLs protect against providers misconfigured to skip subject checks, and per-provider audience claims block token replay across providers. Because SDKs mostly expect a token file, an external OIDC Daemon writes and refreshes tokens into a read-only bind mount backed by /dev/shm, and Render sets provider-specific env vars such as AWS_WEB_IDENTITY_TOKEN_FILE.
- Security Disclosure Recommendation: Redeploy Buckets and Reconnect GitHub After the Credential Reset
Railway mediumAdeptAfter a security disclosure, Railway invalidated and regenerated S3 access keys for every storage bucket and removed the GitHub tokens it held, including GHCR registry tokens stored on services. These resets show in the audit log under the Railway Staff actor type. Services pick up new bucket credentials only on redeploy because containers read variables at startup, so each service using a bucket needs a redeploy. Any pasted key values should be replaced with reference variables, and external tools need updating. Users must also reconnect their GitHub account and repo sources, revoke and recreate GHCR personal access tokens with read:packages, then check bucket files and audit logs for misuse during the exposure window.