You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See [Secrets design document](https://git.k8s.io/community/contributors/design-proposals/auth/secrets.md) for more information.
21
-
22
15
A Secret is an object that contains a small amount of sensitive data such as
23
16
a password, a token, or a key. Such information might otherwise be put in a
24
-
Pod specification or in an image. Users can create Secrets and the system
25
-
also creates some Secrets.
17
+
{{< glossary_tooltip term_id="pod" >}} specification or in a
18
+
{{< glossary_tooltip text="container image" term_id="image" >}}. Using a
19
+
Secret means that you don't need to include confidential data in your
20
+
application code.
21
+
22
+
Because Secrets can be created independently of the Pods that use them, there
23
+
is less risk of the Secret (and its data) being exposed during the workflow of
24
+
creating, viewing, and editing Pods. Kubernetes, and applications that run in
25
+
your cluster, can also take additional precautions with Secrets, such as
26
+
avoiding writing confidential data to nonvolatile storage.
27
+
28
+
Secrets are similar to {{< glossary_tooltip text="ConfigMaps" term_id="configmap" >}}
29
+
but are specifically intended to hold confidential data.
26
30
27
31
{{< caution >}}
28
-
Kubernetes Secrets are, by default, stored as unencrypted base64-encoded
29
-
strings. By default they can be retrieved - as plain text - by anyone with API
30
-
access, or anyone with access to Kubernetes' underlying data store, etcd. In
31
-
order to safely use Secrets, it is recommended you (at a minimum):
32
+
Kubernetes Secrets are, by default, stored unencrypted in the API server's underlying data store (etcd). Anyone with API access can retrieve or modify a Secret, and so can anyone with access to etcd.
33
+
Additionally, anyone who is authorized to create a Pod in a namespace can use that access to read any Secret in that namespace; this includes indirect access such as the ability to create a Deployment.
34
+
35
+
In order to safely use Secrets, take at least the following steps:
32
36
33
37
1.[Enable Encryption at Rest](/docs/tasks/administer-cluster/encrypt-data/) for Secrets.
34
-
2.[Enable or configure RBAC rules](/docs/reference/access-authn-authz/authorization/) that restrict reading and writing the Secret. Be aware that secrets can be obtained implicitly by anyone with the permission to create a Pod.
38
+
2. Enable or configure [RBAC rules](/docs/reference/access-authn-authz/authorization/) that
39
+
restrict reading data in Secrets (including via indirect means).
40
+
3. Where appropriate, also use mechanisms such as RBAC to limit which principals are allowed to create new Secrets or replace existing ones.
41
+
35
42
{{< /caution >}}
36
43
37
44
<!-- body -->
@@ -47,6 +54,10 @@ A Secret can be used with a Pod in three ways:
47
54
- As [container environment variable](#using-secrets-as-environment-variables).
48
55
- By the [kubelet when pulling images](#using-imagepullsecrets) for the Pod.
49
56
57
+
The Kubernetes control plane also uses Secrets; for example,
58
+
[bootstrap token Secrets](#bootstrap-token-secrets) are a mechanism to
0 commit comments