Skip to content

Commit 93bedf2

Browse files
committed
fix: refactor and tune kyverno for HA
1 parent ed66920 commit 93bedf2

File tree

11 files changed

+64
-65
lines changed

11 files changed

+64
-65
lines changed

applications/base/services/kyverno/default-ruleset/disallow-host-path.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ metadata:
1515
HostPath volumes let Pods use host directories and volumes in containers.
1616
Using host resources can be used to access shared data or escalate privileges
1717
and should not be allowed. This policy ensures no hostPath volumes are in use.
18-
19-
labels:
18+
19+
labels:
2020
app.kubernetes.io/component: kyverno
2121
app.kubernetes.io/instance: kyverno-policies
2222
app.kubernetes.io/managed-by: Helm
@@ -31,9 +31,9 @@ spec:
3131
- name: host-path
3232
match:
3333
any:
34-
- resources:
35-
kinds:
36-
- Pod
34+
- resources:
35+
kinds:
36+
- Pod
3737
validate:
3838
failureAction: Audit
3939
allowExistingViolations: true

applications/base/services/kyverno/default-ruleset/disallow-host-ports.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ metadata:
1515
Access to host ports allows potential snooping of network traffic and should not be
1616
allowed, or at minimum restricted to a known list. This policy ensures the `hostPort`
1717
field is unset or set to `0`.
18-
19-
labels:
18+
19+
labels:
2020
app.kubernetes.io/component: kyverno
2121
app.kubernetes.io/instance: kyverno-policies
2222
app.kubernetes.io/managed-by: Helm
@@ -31,9 +31,9 @@ spec:
3131
- name: host-ports-none
3232
match:
3333
any:
34-
- resources:
35-
kinds:
36-
- Pod
34+
- resources:
35+
kinds:
36+
- Pod
3737
validate:
3838
failureAction: Audit
3939
allowExistingViolations: true

applications/base/services/kyverno/default-ruleset/disallow-host-process.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ metadata:
1616
access to the Windows node. Privileged access to the host is disallowed in the baseline
1717
policy. HostProcess pods are an alpha feature as of Kubernetes v1.22. This policy ensures
1818
the `hostProcess` field, if present, is set to `false`.
19-
20-
labels:
19+
20+
labels:
2121
app.kubernetes.io/component: kyverno
2222
app.kubernetes.io/instance: kyverno-policies
2323
app.kubernetes.io/managed-by: Helm
@@ -32,9 +32,9 @@ spec:
3232
- name: host-process-containers
3333
match:
3434
any:
35-
- resources:
36-
kinds:
37-
- Pod
35+
- resources:
36+
kinds:
37+
- Pod
3838
validate:
3939
failureAction: Audit
4040
allowExistingViolations: true

applications/base/services/kyverno/default-ruleset/disallow-privileged-containers.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ metadata:
1414
policies.kyverno.io/description: >-
1515
Privileged mode disables most security mechanisms and must not be allowed. This policy
1616
ensures Pods do not call for privileged mode.
17-
18-
labels:
17+
18+
labels:
1919
app.kubernetes.io/component: kyverno
2020
app.kubernetes.io/instance: kyverno-policies
2121
app.kubernetes.io/managed-by: Helm
@@ -30,9 +30,9 @@ spec:
3030
- name: privileged-containers
3131
match:
3232
any:
33-
- resources:
34-
kinds:
35-
- Pod
33+
- resources:
34+
kinds:
35+
- Pod
3636
validate:
3737
failureAction: Audit
3838
allowExistingViolations: true

applications/base/services/kyverno/default-ruleset/disallow-proc-mount.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ metadata:
1616
ensures nothing but the default procMount can be specified. Note that in order for users
1717
to deviate from the `Default` procMount requires setting a feature gate at the API
1818
server.
19-
20-
labels:
19+
20+
labels:
2121
app.kubernetes.io/component: kyverno
2222
app.kubernetes.io/instance: kyverno-policies
2323
app.kubernetes.io/managed-by: Helm
@@ -32,9 +32,9 @@ spec:
3232
- name: check-proc-mount
3333
match:
3434
any:
35-
- resources:
36-
kinds:
37-
- Pod
35+
- resources:
36+
kinds:
37+
- Pod
3838
validate:
3939
failureAction: Audit
4040
allowExistingViolations: true

applications/base/services/kyverno/default-ruleset/disallow-selinux.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ metadata:
1414
policies.kyverno.io/description: >-
1515
SELinux options can be used to escalate privileges and should not be allowed. This policy
1616
ensures that the `seLinuxOptions` field is undefined.
17-
18-
labels:
17+
18+
labels:
1919
app.kubernetes.io/component: kyverno
2020
app.kubernetes.io/instance: kyverno-policies
2121
app.kubernetes.io/managed-by: Helm
@@ -30,9 +30,9 @@ spec:
3030
- name: selinux-type
3131
match:
3232
any:
33-
- resources:
34-
kinds:
35-
- Pod
33+
- resources:
34+
kinds:
35+
- Pod
3636
validate:
3737
failureAction: Audit
3838
allowExistingViolations: true
@@ -61,9 +61,9 @@ spec:
6161
- name: selinux-user-role
6262
match:
6363
any:
64-
- resources:
65-
kinds:
66-
- Pod
64+
- resources:
65+
kinds:
66+
- Pod
6767
validate:
6868
failureAction: Audit
6969
allowExistingViolations: true

applications/base/services/kyverno/default-ruleset/kustomization.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ resources:
1414
- "disallow-selinux.yaml"
1515
- "require-run-as-non-root-user.yaml"
1616
- "require-run-as-nonroot.yaml"
17-
- "require-run-as-nonroot.yaml"
1817
- "restrict-apparmor-profiles.yaml"
1918
- "restrict-seccomp-strict.yaml"
2019
- "restrict-seccomp.yaml"

applications/base/services/kyverno/default-ruleset/restrict-apparmor-profiles.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ metadata:
1717
The default policy should prevent overriding or disabling the policy, or restrict
1818
overrides to an allowed set of profiles. This policy ensures Pods do not
1919
specify any other AppArmor profiles than `runtime/default` or `localhost/*`.
20-
21-
labels:
20+
21+
labels:
2222
app.kubernetes.io/component: kyverno
2323
app.kubernetes.io/instance: kyverno-policies
2424
app.kubernetes.io/managed-by: Helm
@@ -33,9 +33,9 @@ spec:
3333
- name: app-armor
3434
match:
3535
any:
36-
- resources:
37-
kinds:
38-
- Pod
36+
- resources:
37+
kinds:
38+
- Pod
3939
validate:
4040
failureAction: Audit
4141
allowExistingViolations: true

applications/base/services/kyverno/default-ruleset/restrict-seccomp.yaml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ metadata:
1515
The seccomp profile must not be explicitly set to Unconfined. This policy,
1616
requiring Kubernetes v1.19 or later, ensures that seccomp is unset or
1717
set to `RuntimeDefault` or `Localhost`.
18-
19-
labels:
18+
19+
labels:
2020
app.kubernetes.io/component: kyverno
2121
app.kubernetes.io/instance: kyverno-policies
2222
app.kubernetes.io/managed-by: Helm
@@ -31,9 +31,9 @@ spec:
3131
- name: check-seccomp
3232
match:
3333
any:
34-
- resources:
35-
kinds:
36-
- Pod
34+
- resources:
35+
kinds:
36+
- Pod
3737
validate:
3838
failureAction: Audit
3939
allowExistingViolations: true
@@ -50,14 +50,14 @@ spec:
5050
=(seccompProfile):
5151
=(type): "RuntimeDefault | Localhost"
5252
=(ephemeralContainers):
53-
- =(securityContext):
54-
=(seccompProfile):
55-
=(type): "RuntimeDefault | Localhost"
53+
- =(securityContext):
54+
=(seccompProfile):
55+
=(type): "RuntimeDefault | Localhost"
5656
=(initContainers):
57-
- =(securityContext):
58-
=(seccompProfile):
59-
=(type): "RuntimeDefault | Localhost"
57+
- =(securityContext):
58+
=(seccompProfile):
59+
=(type): "RuntimeDefault | Localhost"
6060
containers:
61-
- =(securityContext):
62-
=(seccompProfile):
63-
=(type): "RuntimeDefault | Localhost"
61+
- =(securityContext):
62+
=(seccompProfile):
63+
=(type): "RuntimeDefault | Localhost"

applications/base/services/kyverno/default-ruleset/restrict-sysctls.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ metadata:
1818
Pod, and it is isolated from other Pods or processes on the same Node.
1919
This policy ensures that only those "safe" subsets can be specified in
2020
a Pod.
21-
22-
labels:
21+
22+
labels:
2323
app.kubernetes.io/component: kyverno
2424
app.kubernetes.io/instance: kyverno-policies
2525
app.kubernetes.io/managed-by: Helm
@@ -34,9 +34,9 @@ spec:
3434
- name: check-sysctls
3535
match:
3636
any:
37-
- resources:
38-
kinds:
39-
- Pod
37+
- resources:
38+
kinds:
39+
- Pod
4040
validate:
4141
failureAction: Audit
4242
allowExistingViolations: true

0 commit comments

Comments
 (0)