Skip to content

Commit

Permalink
Merge pull request #74 from anusha94/add-remediation-to-chart
Browse files Browse the repository at this point in the history
Revert pols
  • Loading branch information
anusha94 authored Jun 12, 2023
2 parents d642d96 + 3cedb3c commit 314a1e2
Show file tree
Hide file tree
Showing 22 changed files with 59 additions and 51 deletions.
2 changes: 1 addition & 1 deletion charts/pod-security-baseline/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: pss-baseline-policies
description: Pod Security Standards (baseline) policy set
type: application
version: 0.2.0
version: 0.2.1
appVersion: 0.1.0
keywords:
- kubernetes
Expand Down
49 changes: 49 additions & 0 deletions charts/pod-security-baseline/pols/disallow-capabilities.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: disallow-capabilities
annotations:
policies.kyverno.io/title: Disallow Capabilities
policies.kyverno.io/category: Pod Security Standards (Baseline)
policies.kyverno.io/severity: medium
kyverno.io/kyverno-version: 1.6.0
policies.kyverno.io/minversion: 1.6.0
kyverno.io/kubernetes-version: "1.22-1.23"
policies.kyverno.io/subject: Pod
policies.nirmata.io/remediation: "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: >-
Any capabilities added beyond the allowed list (AUDIT_WRITE, CHOWN, DAC_OVERRIDE, FOWNER,
FSETID, KILL, MKNOD, NET_BIND_SERVICE, SETFCAP, SETGID, SETPCAP, SETUID, SYS_CHROOT)
are 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
4 changes: 4 additions & 0 deletions charts/pod-security-baseline/templates/club-pols.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{{ range $path, $_ := .Files.Glob "pols/**.yaml" }}
{{ $.Files.Get $path }}
---
{{ end }}
49 changes: 0 additions & 49 deletions charts/pod-security-baseline/templates/disallow-capabilities.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion charts/pod-security-restricted/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: pss-restricted-policies
description: Pod Security Standards (restricted) policy set
type: application
version: 0.2.0
version: 0.2.1
appVersion: 0.1.0
keywords:
- kubernetes
Expand Down
4 changes: 4 additions & 0 deletions charts/pod-security-restricted/templates/club-pols.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{{ range $path, $_ := .Files.Glob "pols/**.yaml" }}
{{ $.Files.Get $path }}
---
{{ end }}

0 comments on commit 314a1e2

Please sign in to comment.