Skip to content

Commit 01eccc6

Browse files
authored
Merge pull request #48771 from ritazh/deprecate-EnforceMountableSecretsAnnotation
Add deprecation warnings for enforce-mountable-secrets annotation
2 parents 45b62d8 + 3b8c927 commit 01eccc6

File tree

5 files changed

+16
-14
lines changed

5 files changed

+16
-14
lines changed

content/en/docs/concepts/configuration/secret.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -666,10 +666,7 @@ Therefore, one Pod does not have access to the Secrets of another Pod.
666666

667667
### Configure least-privilege access to Secrets
668668

669-
To enhance the security measures around Secrets, Kubernetes provides a mechanism: you can
670-
annotate a ServiceAccount as `kubernetes.io/enforce-mountable-secrets: "true"`.
671-
672-
For more information, you can refer to the [documentation about this annotation](/docs/concepts/security/service-accounts/#enforce-mountable-secrets).
669+
To enhance the security measures around Secrets, use separate namespaces to isolate access to mounted secrets.
673670

674671
{{< warning >}}
675672
Any containers that run with `privileged: true` on a node can access all

content/en/docs/concepts/security/secrets-good-practices.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,8 @@ recommendations include:
6262
* Implement audit rules that alert on specific events, such as concurrent
6363
reading of multiple Secrets by a single user
6464

65-
#### Additional ServiceAccount annotations for Secret management
66-
67-
You can also use the `kubernetes.io/enforce-mountable-secrets` annotation on
68-
a ServiceAccount to enforce specific rules on how Secrets are used in a Pod.
69-
For more details, see the [documentation on this annotation](/docs/reference/labels-annotations-taints/#enforce-mountable-secrets).
65+
#### Restrict Access for Secrets
66+
Use separate namespaces to isolate access to mounted secrets.
7067

7168
### Improve etcd management policies
7269

content/en/docs/concepts/security/service-accounts.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,13 @@ or using a custom mechanism such as an [authentication webhook](/docs/reference/
197197
You can also use TokenRequest to obtain short-lived tokens for your external application.
198198
{{< /note >}}
199199

200-
### Restricting access to Secrets {#enforce-mountable-secrets}
200+
### Restricting access to Secrets (deprecated) {#enforce-mountable-secrets}
201+
202+
{{< feature-state for_k8s_version="v1.32" state="deprecated" >}}
203+
204+
{{< note >}}
205+
`kubernetes.io/enforce-mountable-secrets` is deprecated since Kubernetes v1.32. Use separate namespaces to isolate access to mounted secrets.
206+
{{< /note >}}
201207

202208
Kubernetes provides an annotation called `kubernetes.io/enforce-mountable-secrets`
203209
that you can add to your ServiceAccounts. When this annotation is applied,

content/en/docs/reference/access-authn-authz/admission-controllers.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -785,9 +785,7 @@ The Kubernetes project strongly recommends enabling this admission controller.
785785
You should enable this admission controller if you intend to make any use of Kubernetes
786786
`ServiceAccount` objects.
787787

788-
Regarding the annotation `kubernetes.io/enforce-mountable-secrets`: While the annotation's name suggests it only concerns the mounting of Secrets,
789-
its enforcement also extends to other ways Secrets are used in the context of a Pod.
790-
Therefore, it is crucial to ensure that all the referenced secrets are correctly specified in the ServiceAccount.
788+
To enhance the security measures around Secrets, use separate namespaces to isolate access to mounted secrets.
791789

792790
### StorageObjectInUseProtection
793791

content/en/docs/reference/labels-annotations-taints/_index.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,14 +804,18 @@ Used on: All Objects
804804

805805
This annotation is used for describing specific behaviour of given object.
806806

807-
### kubernetes.io/enforce-mountable-secrets {#enforce-mountable-secrets}
807+
### kubernetes.io/enforce-mountable-secrets (deprecated) {#enforce-mountable-secrets}
808808

809809
Type: Annotation
810810

811811
Example: `kubernetes.io/enforce-mountable-secrets: "true"`
812812

813813
Used on: ServiceAccount
814814

815+
{{< note >}}
816+
`kubernetes.io/enforce-mountable-secrets` is deprecated since Kubernetes v1.32. Use separate namespaces to isolate access to mounted secrets.
817+
{{< /note >}}
818+
815819
The value for this annotation must be **true** to take effect.
816820
When you set this annotation to "true", Kubernetes enforces the following rules for
817821
Pods running as this ServiceAccount:

0 commit comments

Comments
 (0)