Skip to content

Commit

Permalink
feature/global-policy-set : upgrade version for test
Browse files Browse the repository at this point in the history
  • Loading branch information
krishbajaj1609 committed Jun 6, 2024
1 parent 48670f1 commit f8a789b
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 46 deletions.
2 changes: 1 addition & 1 deletion charts/test-krish-globalps/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: test-krish
description: Pod Security Standards (baseline) policy set
type: application
version: 0.6.28
version: 0.6.29
appVersion: 0.1.0
keywords:
- kubernetes
Expand Down
44 changes: 0 additions & 44 deletions charts/test-krish-globalps/pols/disallow-host-process.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ metadata:
Privileged mode disables most security mechanisms and must not be allowed. This policy
ensures Pods do not call for privileged mode.
spec:
validationFailureAction: Audit
validationFailureAction: Enforce
background: true
rules:
- name: privileged-containers
Expand Down
46 changes: 46 additions & 0 deletions charts/test-krish-globalps/pols/test-disallow-capabilities.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: test-disallow-capabilities
annotations:
policies.kyverno.io/title: Disallow Capabilities
policies.kyverno.io/category: Pod Security Standards (Baseline)
policies.kyverno.io/severity: medium
policies.kyverno.io/minversion: 1.6.0
kyverno.io/kubernetes-version: "1.22-1.23"
policies.kyverno.io/subject: Pod
policies.nirmata.io/remediation-docs: "https://docs.nirmata.io/policysets/podsecurity/baseline/disallow-capabilities/"
policies.kyverno.io/description: >-
Adding capabilities beyond those listed in the policy must be disallowed.
spec:
validationFailureAction: Audit
background: true
rules:
- name: adding-capabilities
match:
any:
- resources:
kinds:
- Pod
validate:
message: >-
Adding capabilities beyond those listed in the policy rule is disallowed.
deny:
conditions:
all:
- key: "{{ request.object.spec.[ephemeralContainers, initContainers, containers][].securityContext.capabilities.add[] }}"
operator: AnyNotIn
value:
- AUDIT_WRITE
- CHOWN
- DAC_OVERRIDE
- FOWNER
- FSETID
- KILL
- MKNOD
- NET_BIND_SERVICE
- SETFCAP
- SETGID
- SETPCAP
- SETUID
- SYS_CHROOT

0 comments on commit f8a789b

Please sign in to comment.