Kubernetes Secret
A Kubernetes object for small sensitive values such as passwords and tokens, which pods can use as files or environment variables.
In more detail
Access to Secrets is controlled with RBAC, and a pod can only use Secrets from its own namespace. Secret data is only Base64-encoded, so without encryption at rest anyone who can read etcd or its backups reads the values.
Example
kubectl get secret web-secret -o jsonpath='{.type}'Related terms
- etcd — The distributed key-value store where Kubernetes keeps all cluster data, including every Secret.
- EncryptionConfiguration — The API server configuration file that decides how resources such as Secrets are encrypted before being written to etcd.
- Base64 — A way to write any bytes using only 64 safe text characters, so binary data can travel in places that expect text.
- secret — Any value that grants access, such as a password, access token or private key, and must be kept out of code and version control.
- encryption at rest — Protecting stored data, such as files on disk or in a repository, by keeping it encrypted while it is not being used.
- ConfigMap — The Kubernetes object that holds non-secret settings as key and value pairs, for pods to read as environment variables or files.
- role-based access control — An authorization model where permissions are grouped into named roles, such as reader or editor, and people or services are given roles.
- service account — An identity for a program rather than a person; in Kubernetes each pod runs as one and gets a signed token for it.
Taught in
- Securing the Kubernetes Control Plane & Node Components — Cloud Security & DevSecOps Engineering
- CloudTrail Logging, Integrity Validation & Athena — Cloud Security & DevSecOps Engineering
- ConfigMaps, Secrets And Configuration Updates — Kubernetes: Production-Grade Container Orchestration
- Least Privilege In IAM And RBAC — Application Security & Threat Modeling for Engineers
- The Environment Variable Trap — Application Security & Threat Modeling for Engineers