Skip to content

Cloud Native Security 06: Identity, Secrets and Data

A password in an environment variable was the last step in the theft that opened this series. The attackers were already inside the cluster, and the database password was sitting in the container's settings, ready to read.

Access is what attackers are really after. This post covers who gets it, how long it lasts, and what protects the data when everything else has failed.


Make access short-lived

A key that works for a year gives a thief a year. A key that expires in an hour is barely worth stealing. That's the idea behind almost everything here.

Who needs access Old way Better way
People A shared admin file Company login with MFA, and extra rights only when needed
Apps in the cluster A cloud key in a secret The cloud gives the pod its own identity
Pipelines A stored cloud key A short-lived key through OIDC
AI agents The developer's own login An identity of their own, with fewer rights

People: one login, extra rights on request

When someone leaves, you want to switch off one account. Connect Kubernetes, the cloud, Git and your dashboards to the company login. Kubernetes has supported this through a settings file since version 1.34.

Nobody needs to be an administrator all day. "Just-in-time" access lets people ask for admin rights for an hour, with a reason that gets logged. Use your identity provider's feature if it has one, such as Entra PIM. Teleport is an alternative.

Keep one emergency admin account for the day the login system is down. Lock it away, and alert on every use.


Apps: identity instead of keys

Your cloud can recognise a pod and give it a temporary key. Nothing gets stored, so there's nothing to leak.

Where you run Use
AWS EKS Pod Identity
Google Cloud Workload Identity Federation
Azure Entra Workload ID
Several clouds, or your own servers SPIRE, which gives every workload a certificate

Give each app its own identity. If five apps share one, a break-in at any of them reaches all the data the others can see.

Inside your own application, you also decide which user may do what. Put those rules in one place, with OpenFGA or Cedar, so they aren't copied across services.


Secrets: one safe place, delivered when needed

Some passwords can't be avoided. Keep them in a secrets manager that controls access, logs every read and can change them for you.

Situation Store them in Deliver them with
You're on a cloud The cloud's secret manager External Secrets Operator
You run your own OpenBao Its own agent, or the Secrets Store CSI driver
A small team that keeps everything in Git Git, encrypted with SOPS Flux or your pipeline

HashiCorp Vault still works well. Its licence changed in 2023 and limits offering it to others as a competing service. OpenBao is the open source version that continued from before the change.

External Secrets Operator supports only its newest minor version, so plan to upgrade often.

Give apps secrets as files, not environment variables. Environment variables end up in crash reports, debug pages and child processes.

Kubernetes keeps its own secrets in plain text until you turn on encryption, which post 4 covers. For your most important keys, use a key service backed by a hardware security module, a device the key never leaves.


Data: encrypt it, and know what that protects against

Protection Stops Doesn't stop
Disk encryption Someone taking the disk or a copy of it Someone logged in to the database
TLS connections Someone listening on the network A stolen password
Encrypting single columns A database administrator reading them A compromised app that can decrypt them

Turn on the first two everywhere, with keys you control. Use the third for the few fields that would hurt the most, such as ID numbers.

Copies need the same rules as the original. Check caches, snapshots, replicas and test databases, because that's where protection usually goes missing. When you retire a disk, wipe it or destroy its key.

Shared storage has its own trap. NFS usually sends data unencrypted and trusts the machine that connects. Use its TLS option, or keep sensitive data off it.


Backups: make one copy nobody can delete

Ransomware attackers look for the backups first. If they can delete them, you pay.

  • Keep a copy in a separate account, with separate logins
  • Lock it, so it can't be changed or deleted for a set time
  • Back up the cluster's settings as well as the data
  • Practise restoring, and write down how long it took

On an Amazon S3 bucket with versioning turned on, this locks every new backup for 30 days. In this mode even the account owner can't undo it, so test with GOVERNANCE first:

aws s3api put-object-lock-configuration --bucket my-backups \
  --object-lock-configuration '{"ObjectLockEnabled":"Enabled","Rule":{"DefaultRetention":{"Mode":"COMPLIANCE","Days":30}}}'

Velero is the usual tool for backing up Kubernetes. Its documentation says it doesn't fully support locked storage, though it works with S3 and Azure within limits1. If locked backups are a hard requirement, look at Veeam Kasten.


Get ready for quantum computers

A future quantum computer could break today's encryption. Attackers can record traffic now and read it later, so data that must stay secret for ten years is already at risk.

For most teams, the work today is upgrading. Kubernetes 1.33 and OpenSSL 3.5 already use a protected key exchange by default. If either side is older, the connection quietly falls back to the old kind.

NIST plans to phase out today's common public-key methods after 2030 and stop allowing them after 20352. Start a list of your certificates and long-lived data.


Summary

If you're worried about... Do this
A stolen key Short-lived access everywhere
Someone leaving One company login for every system
Passwords leaking A secrets manager, delivered as files
Ransomware A locked backup in a separate account
Data recorded today and read later Upgrade to versions with the new key exchange
  • Find every long-lived cloud key, and replace one this week
  • Move one app to a cloud identity
  • Lock one backup copy, then restore from it
  • Turn off the accounts of people who've left

Next: Respond, comply and a 90-day plan


  1. Velero, backup reference, and AWS, S3 Object Lock. ↩

  2. NIST, IR 8547, October 2026. The Kubernetes default is described in Post-quantum cryptography in Kubernetes. ↩

Discussion

Have thoughts on this post? Share them below — questions, corrections, or your own experience are all welcome.