mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-28 10:28:36 +00:00
Add policyKind option to kyverno-policies chart (#8827)
Fixes #4317 #8568 Signed-off-by: Trey Dockendorf <tdockendorf@osc.edu> Co-authored-by: shuting <shuting@nirmata.com>
This commit is contained in:
parent
de0308dbb9
commit
871d8ed3ca
21 changed files with 25 additions and 18 deletions
|
@ -31,3 +31,5 @@ annotations:
|
|||
description: "Walk back change in PSS policy to send to to_upper"
|
||||
- kind: fixed
|
||||
description: Skip DELETE requests on policies using deny statements
|
||||
- kind: added
|
||||
description: Add policyKind to allow changing ClusterPolicy to Policy for all policies
|
||||
|
|
|
@ -63,6 +63,7 @@ The command removes all the Kubernetes components associated with the chart and
|
|||
|
||||
| Key | Type | Default | Description |
|
||||
|-----|------|---------|-------------|
|
||||
| policyKind | string | `"ClusterPolicy"` | Policy kind (`ClusterPolicy`, `Policy`) Set to `Policy` if you need namespaced policies and not cluster policies |
|
||||
| podSecurityStandard | string | `"baseline"` | Pod Security Standard profile (`baseline`, `restricted`, `privileged`, `custom`). For more info https://kyverno.io/policies/pod-security. |
|
||||
| podSecuritySeverity | string | `"medium"` | Pod Security Standard (`low`, `medium`, `high`). |
|
||||
| podSecurityPolicies | list | `[]` | Policies to include when `podSecurityStandard` is `custom`. |
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{{- if eq (include "kyverno-policies.podSecurityBaseline" (merge (dict "name" $name) .)) "true" }}
|
||||
{{- include "kyverno-policies.supportedKyvernoCheck" (dict "top" . "ver" ">= 1.6.0-0") }}
|
||||
apiVersion: kyverno.io/v1
|
||||
kind: ClusterPolicy
|
||||
kind: {{ .Values.policyKind }}
|
||||
metadata:
|
||||
name: {{ $name }}
|
||||
annotations:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{{- $name := "disallow-host-namespaces" }}
|
||||
{{- if eq (include "kyverno-policies.podSecurityBaseline" (merge (dict "name" $name) .)) "true" }}
|
||||
apiVersion: kyverno.io/v1
|
||||
kind: ClusterPolicy
|
||||
kind: {{ .Values.policyKind }}
|
||||
metadata:
|
||||
name: {{ $name }}
|
||||
annotations:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{{- $name := "disallow-host-path" }}
|
||||
{{- if eq (include "kyverno-policies.podSecurityBaseline" (merge (dict "name" $name) .)) "true" }}
|
||||
apiVersion: kyverno.io/v1
|
||||
kind: ClusterPolicy
|
||||
kind: {{ .Values.policyKind }}
|
||||
metadata:
|
||||
name: {{ $name }}
|
||||
annotations:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{{- $name := "disallow-host-ports" }}
|
||||
{{- if eq (include "kyverno-policies.podSecurityBaseline" (merge (dict "name" $name) .)) "true" }}
|
||||
apiVersion: kyverno.io/v1
|
||||
kind: ClusterPolicy
|
||||
kind: {{ .Values.policyKind }}
|
||||
metadata:
|
||||
name: {{ $name }}
|
||||
annotations:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{{- $name := "disallow-host-process" }}
|
||||
{{- if eq (include "kyverno-policies.podSecurityBaseline" (merge (dict "name" $name) .)) "true" }}
|
||||
apiVersion: kyverno.io/v1
|
||||
kind: ClusterPolicy
|
||||
kind: {{ .Values.policyKind }}
|
||||
metadata:
|
||||
name: {{ $name }}
|
||||
annotations:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{{- $name := "disallow-privileged-containers" }}
|
||||
{{- if eq (include "kyverno-policies.podSecurityBaseline" (merge (dict "name" $name) .)) "true" }}
|
||||
apiVersion: kyverno.io/v1
|
||||
kind: ClusterPolicy
|
||||
kind: {{ .Values.policyKind }}
|
||||
metadata:
|
||||
name: {{ $name }}
|
||||
annotations:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{{- $name := "disallow-proc-mount" }}
|
||||
{{- if eq (include "kyverno-policies.podSecurityBaseline" (merge (dict "name" $name) .)) "true" }}
|
||||
apiVersion: kyverno.io/v1
|
||||
kind: ClusterPolicy
|
||||
kind: {{ .Values.policyKind }}
|
||||
metadata:
|
||||
name: {{ $name }}
|
||||
annotations:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{{- $name := "disallow-selinux" }}
|
||||
{{- if eq (include "kyverno-policies.podSecurityBaseline" (merge (dict "name" $name) .)) "true" }}
|
||||
apiVersion: kyverno.io/v1
|
||||
kind: ClusterPolicy
|
||||
kind: {{ .Values.policyKind }}
|
||||
metadata:
|
||||
name: {{ $name }}
|
||||
annotations:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{{- $name := "restrict-apparmor-profiles" }}
|
||||
{{- if eq (include "kyverno-policies.podSecurityBaseline" (merge (dict "name" $name) .)) "true" }}
|
||||
apiVersion: kyverno.io/v1
|
||||
kind: ClusterPolicy
|
||||
kind: {{ .Values.policyKind }}
|
||||
metadata:
|
||||
name: {{ $name }}
|
||||
annotations:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{{- $name := "restrict-seccomp" }}
|
||||
{{- if eq (include "kyverno-policies.podSecurityBaseline" (merge (dict "name" $name) .)) "true" }}
|
||||
apiVersion: kyverno.io/v1
|
||||
kind: ClusterPolicy
|
||||
kind: {{ .Values.policyKind }}
|
||||
metadata:
|
||||
name: {{ $name }}
|
||||
annotations:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{{- $name := "restrict-sysctls" }}
|
||||
{{- if eq (include "kyverno-policies.podSecurityBaseline" (merge (dict "name" $name) .)) "true" }}
|
||||
apiVersion: kyverno.io/v1
|
||||
kind: ClusterPolicy
|
||||
kind: {{ .Values.policyKind }}
|
||||
metadata:
|
||||
name: {{ $name }}
|
||||
annotations:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{{- $name := "require-non-root-groups" }}
|
||||
{{- if eq (include "kyverno-policies.podSecurityOther" (merge (dict "name" $name) .)) "true" }}
|
||||
apiVersion: kyverno.io/v1
|
||||
kind: ClusterPolicy
|
||||
kind: {{ .Values.policyKind }}
|
||||
metadata:
|
||||
name: {{ $name }}
|
||||
annotations:
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{{- if eq (include "kyverno-policies.podSecurityRestricted" (merge (dict "name" $name) .)) "true" }}
|
||||
{{- include "kyverno-policies.supportedKyvernoCheck" (dict "top" . "ver" ">= 1.6.0-0") }}
|
||||
apiVersion: kyverno.io/v1
|
||||
kind: ClusterPolicy
|
||||
kind: {{ .Values.policyKind }}
|
||||
metadata:
|
||||
name: {{ $name }}
|
||||
annotations:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{{- $name := "disallow-privilege-escalation" }}
|
||||
{{- if eq (include "kyverno-policies.podSecurityRestricted" (merge (dict "name" $name) .)) "true" }}
|
||||
apiVersion: kyverno.io/v1
|
||||
kind: ClusterPolicy
|
||||
kind: {{ .Values.policyKind }}
|
||||
metadata:
|
||||
name: {{ $name }}
|
||||
annotations:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{{- $name := "require-run-as-non-root-user" }}
|
||||
{{- if eq (include "kyverno-policies.podSecurityRestricted" (merge (dict "name" $name) .)) "true" }}
|
||||
apiVersion: kyverno.io/v1
|
||||
kind: ClusterPolicy
|
||||
kind: {{ .Values.policyKind }}
|
||||
metadata:
|
||||
name: {{ $name }}
|
||||
annotations:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{{- $name := "require-run-as-nonroot" }}
|
||||
{{- if eq (include "kyverno-policies.podSecurityRestricted" (merge (dict "name" $name) .)) "true" }}
|
||||
apiVersion: kyverno.io/v1
|
||||
kind: ClusterPolicy
|
||||
kind: {{ .Values.policyKind }}
|
||||
metadata:
|
||||
name: {{ $name }}
|
||||
annotations:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{{- $name := "restrict-seccomp-strict" }}
|
||||
{{- if eq (include "kyverno-policies.podSecurityRestricted" (merge (dict "name" $name) .)) "true" }}
|
||||
apiVersion: kyverno.io/v1
|
||||
kind: ClusterPolicy
|
||||
kind: {{ .Values.policyKind }}
|
||||
metadata:
|
||||
name: {{ $name }}
|
||||
annotations:
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{{- if eq (include "kyverno-policies.podSecurityRestricted" (merge (dict "name" $name) .)) "true" }}
|
||||
{{- include "kyverno-policies.supportedKyvernoCheck" (dict "top" . "ver" ">= 1.6.0-0") }}
|
||||
apiVersion: kyverno.io/v1
|
||||
kind: ClusterPolicy
|
||||
kind: {{ .Values.policyKind }}
|
||||
metadata:
|
||||
name: {{ $name }}
|
||||
annotations:
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
# -- Policy kind (`ClusterPolicy`, `Policy`)
|
||||
# Set to `Policy` if you need namespaced policies and not cluster policies
|
||||
policyKind: ClusterPolicy
|
||||
|
||||
# -- Pod Security Standard profile (`baseline`, `restricted`, `privileged`, `custom`).
|
||||
# For more info https://kyverno.io/policies/pod-security.
|
||||
podSecurityStandard: baseline
|
||||
|
|
Loading…
Add table
Reference in a new issue