Skip to content

Commit 31416af

Browse files
committed
Clarify handling of projected SA token permissions
1 parent a02de94 commit 31416af

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

content/en/docs/concepts/storage/projected-volumes.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,24 @@ A container using a projected volume source as a [`subPath`](/docs/concepts/stor
7171
volume mount will not receive updates for those volume sources.
7272
{{< /note >}}
7373

74-
## SecurityContext interactions
74+
### serviceAccountToken and securityContext
7575

7676
The [proposal](https://github.com/kubernetes/enhancements/tree/master/keps/sig-storage/2451-service-account-token-volumes#proposal) for file permission handling in projected service account volume enhancement introduced the projected files having the the correct owner permissions set.
7777

78-
### Linux
78+
#### Linux
7979

80-
In Linux pods that have a projected volume and `RunAsUser` set in the Pod
81-
[`SecurityContext`](/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context),
82-
the projected files have the correct ownership set including container user
83-
ownership.
80+
Kubernetes will improve security for serviceAccountToken files when all containers
81+
have the same `runAsUser` set in
82+
[`PodSecurityContext`](/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context)
83+
or container
84+
[`SecurityContext`](/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context-1)
85+
by setting the file owner to the `runAsUser` and the file mode to `0600`.
8486

85-
### Windows
87+
Note that {{< glossary_tooltip text="ephemeral containers" term_id="ephemeral-container" >}}
88+
aren't present when the pod is created. Adding an ephemeral container to a pod
89+
will not change the permissions that were set when the pod was created.
90+
91+
#### Windows
8692

8793
In Windows pods that have a projected volume and `RunAsUsername` set in the
8894
Pod `SecurityContext`, the ownership is not enforced due to the way user

0 commit comments

Comments
 (0)