mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-07 00:17:13 +00:00
21 lines
No EOL
694 B
YAML
21 lines
No EOL
694 B
YAML
apiVersion : kyverno.io/v1alpha1
|
|
kind: ClusterPolicy
|
|
metadata:
|
|
name: validate-disallow-automoutingapicred
|
|
annotations:
|
|
policies.kyverno.io/category: API Server Access Control
|
|
policies.kyverno.io/description: Kubernetes automounts default service account credentials in each pod.
|
|
To restrict access, opt out of automounting credentials by setting 'automountServiceAccountToken' to 'false'.
|
|
spec:
|
|
rules:
|
|
- name: disallow-automoutingapicred
|
|
match:
|
|
resources:
|
|
kinds:
|
|
- Pod
|
|
validate:
|
|
message: "Deny automounting API credentials"
|
|
pattern:
|
|
spec:
|
|
=(serviceAccountName): "*"
|
|
automountServiceAccountToken: false |