Skip to content

Commit

Permalink
Merge pull request #88 from nirmata/final-1.11.1
Browse files Browse the repository at this point in the history
Final 1.11.1
  • Loading branch information
pns-nirmata committed Jan 18, 2024
2 parents 721d0b0 + 1c1bd14 commit e5cb1c5
Show file tree
Hide file tree
Showing 85 changed files with 654 additions and 380 deletions.
6 changes: 4 additions & 2 deletions charts/kyverno-policies/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v2
type: application
name: kyverno-policies
version: 3.1.0
appVersion: v1.11.0
version: 3.1.1
appVersion: v1.11.1
icon: https://github.com/kyverno/kyverno/raw/main/img/logo.png
description: Kubernetes Pod Security Standards implemented as Kyverno policies
keywords:
Expand Down Expand Up @@ -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
3 changes: 2 additions & 1 deletion charts/kyverno-policies/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Kubernetes Pod Security Standards implemented as Kyverno policies

![Version: 3.1.0](https://img.shields.io/badge/Version-3.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v1.11.0](https://img.shields.io/badge/AppVersion-v1.11.0-informational?style=flat-square)
![Version: 3.1.1](https://img.shields.io/badge/Version-3.1.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v1.11.1](https://img.shields.io/badge/AppVersion-v1.11.1-informational?style=flat-square)

## About

Expand Down Expand Up @@ -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`. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions charts/kyverno-policies/values.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 3 additions & 5 deletions charts/kyverno/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v2
type: application
name: kyverno
version: 3.1.0
appVersion: v1.11.0
version: 3.1.1
appVersion: v1.11.1
icon: https://github.com/kyverno/kyverno/raw/main/img/logo.png
description: Kubernetes Native Policy Management
keywords:
Expand Down Expand Up @@ -35,8 +35,6 @@ annotations:
artifacthub.io/changes: |
- kind: added
description: support for GrafanaDashboard custom resource
- kind: changed
description: only create ServiceMonitor if cluster supports it
- kind: fixed
description: rbac templating issues
- kind: added
Expand Down Expand Up @@ -82,5 +80,5 @@ dependencies:
version: "0.0.0"
condition: grafana.enabled
- name: crds
version: "3.1.0"
version: "3.1.1"
condition: crds.install
13 changes: 10 additions & 3 deletions charts/kyverno/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Kubernetes Native Policy Management

![Version: 3.1.0](https://img.shields.io/badge/Version-3.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v1.11.0](https://img.shields.io/badge/AppVersion-v1.11.0-informational?style=flat-square)
![Version: 3.1.1](https://img.shields.io/badge/Version-3.1.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v1.11.1](https://img.shields.io/badge/AppVersion-v1.11.1-informational?style=flat-square)

## About

Expand Down Expand Up @@ -715,6 +715,13 @@ The chart values are organised per component.
| imagePullSecrets | object | `{}` | Image pull secrets for image verification policies, this will define the `--imagePullSecrets` argument |
| existingImagePullSecrets | list | `[]` | Existing Image pull secrets for image verification policies, this will define the `--imagePullSecrets` argument |
| customLabels | object | `{}` | Additional labels |
| policyReportsCleanup.enabled | bool | `true` | Create a helm post-upgrade hook to cleanup the old policy reports. |
| policyReportsCleanup.image.registry | string | `nil` | Image registry |
| policyReportsCleanup.image.repository | string | `"bitnami/kubectl"` | Image repository |
| policyReportsCleanup.image.tag | string | `"1.28.4"` | Image tag Defaults to `latest` if omitted |
| policyReportsCleanup.image.pullPolicy | string | `nil` | Image pull policy Defaults to image.pullPolicy if omitted |
| policyReportsCleanup.podSecurityContext | object | `{}` | Security context for the pod |
| policyReportsCleanup.securityContext | object | `{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"privileged":false,"readOnlyRootFilesystem":true,"runAsGroup":65534,"runAsNonRoot":true,"runAsUser":65534,"seccompProfile":{"type":"RuntimeDefault"}}` | Security context for the hook containers |

## TLS Configuration

Expand Down Expand Up @@ -756,7 +763,7 @@ Please consult the [values.yaml](./values.yaml) file before overriding `config.r

Running a highly-available Kyverno installation is crucial in a production environment.

In order to run Kyverno in high availability mode, you should set `replicaCount` to `3` or more.
In order to run Kyverno in high availability mode, you should set `replicas` to `3` or more for desired components.
You should also pay attention to anti affinity rules, spreading pods across nodes and availability zones.

Please see https://kyverno.io/docs/installation/#security-vs-operability for more informations.
Expand All @@ -771,7 +778,7 @@ Kubernetes: `>=1.25.0-0`

| Repository | Name | Version |
|------------|------|---------|
| | crds | 3.1.0 |
| | crds | 3.1.1 |
| | grafana | 0.0.0 |

## Maintainers
Expand Down
2 changes: 1 addition & 1 deletion charts/kyverno/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ Please consult the [values.yaml](./values.yaml) file before overriding `config.r

Running a highly-available Kyverno installation is crucial in a production environment.

In order to run Kyverno in high availability mode, you should set `replicaCount` to `3` or more.
In order to run Kyverno in high availability mode, you should set `replicas` to `3` or more for desired components.
You should also pay attention to anti affinity rules, spreading pods across nodes and availability zones.

Please see https://kyverno.io/docs/installation/#security-vs-operability for more informations.
Expand Down
2 changes: 1 addition & 1 deletion charts/kyverno/charts/crds/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
apiVersion: v2
name: crds
version: 3.1.0
version: 3.1.1
2 changes: 1 addition & 1 deletion charts/kyverno/charts/crds/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# crds

![Version: 3.1.0](https://img.shields.io/badge/Version-3.1.0-informational?style=flat-square)
![Version: 3.1.1](https://img.shields.io/badge/Version-3.1.1-informational?style=flat-square)

## Values

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if and .Values.admissionController.serviceMonitor.enabled (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") }}
{{- if .Values.admissionController.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.backgroundController.enabled -}}
{{- if and .Values.backgroundController.serviceMonitor.enabled (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") -}}
{{- if .Values.backgroundController.serviceMonitor.enabled -}}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.cleanupController.enabled -}}
{{- if and .Values.cleanupController.serviceMonitor.enabled (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") -}}
{{- if .Values.cleanupController.serviceMonitor.enabled -}}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
Expand Down
58 changes: 58 additions & 0 deletions charts/kyverno/templates/hooks/post-upgrade.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{{- if .Values.policyReportsCleanup.enabled -}}
{{- if not .Values.templating.enabled -}}
apiVersion: batch/v1
kind: Job
metadata:
name: {{ template "kyverno.fullname" . }}-hook-post-upgrade
namespace: {{ template "kyverno.namespace" . }}
labels:
{{- include "kyverno.hooks.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": post-upgrade
"helm.sh/hook-delete-policy": hook-succeeded,hook-failed
spec:
backoffLimit: 2
template:
spec:
serviceAccount: {{ template "kyverno.admission-controller.serviceAccountName" . }}
{{- with .Values.policyReportsCleanup.podSecurityContext }}
securityContext:
{{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
restartPolicy: Never
containers:
- name: kubectl
image: {{ (include "kyverno.image" (dict "globalRegistry" ((.Values.global).image).registry "image" .Values.policyReportsCleanup.image "defaultTag" (default .Chart.AppVersion .Values.policyReportsCleanup.image.tag))) | quote }}
imagePullPolicy: {{ .Values.policyReportsCleanup.image.pullPolicy }}
command:
- /bin/bash
- -c
- |
NAMESPACES=$(kubectl get namespaces --no-headers=true | awk '{print $1}')
for ns in ${NAMESPACES[@]};
do
COUNT=$(kubectl get policyreports.wgpolicyk8s.io -n $ns --no-headers=true | awk '/pol/{print $1}' | wc -l)
if [ $COUNT -gt 0 ]; then
echo "deleting $COUNT policyreports in namespace $ns"
kubectl get policyreports.wgpolicyk8s.io -n $ns --no-headers=true | awk '/pol/{print $1}' | xargs kubectl delete -n $ns policyreports.wgpolicyk8s.io
else
echo "no policyreports in namespace $ns"
fi
done
COUNT=$(kubectl get clusterpolicyreports.wgpolicyk8s.io --no-headers=true | awk '/pol/{print $1}' | wc -l)
if [ $COUNT -gt 0 ]; then
echo "deleting $COUNT clusterpolicyreports"
kubectl get clusterpolicyreports.wgpolicyk8s.io --no-headers=true | awk '/pol/{print $1}' | xargs kubectl delete clusterpolicyreports.wgpolicyk8s.io
else
echo "no clusterpolicyreports"
fi
{{- with .Values.policyReportsCleanup.securityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end -}}
{{- end -}}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.reportsController.enabled -}}
{{- if and .Values.reportsController.serviceMonitor.enabled (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") -}}
{{- if .Values.reportsController.serviceMonitor.enabled -}}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
Expand Down
Loading

0 comments on commit e5cb1c5

Please sign in to comment.