Skip to content

Commit 5764009

Browse files
authored
Created a policy for deny pod privilege and escalation (#1083)
* changed policy action Signed-off-by: Tejas-24ytj <tblamkhade24@gmail.com> * Added a policy to deny pod privilege and escalation Signed-off-by: Tejas-24ytj <tblamkhade24@gmail.com> * Renamed the admission policy Signed-off-by: Tejas-24ytj <tblamkhade24@gmail.com> --------- Signed-off-by: Tejas-24ytj <tblamkhade24@gmail.com>
1 parent 6d05fe4 commit 5764009

File tree

3 files changed

+24
-18
lines changed

3 files changed

+24
-18
lines changed

generic/admission/deny-privileged-pods.yaml

Lines changed: 0 additions & 11 deletions
This file was deleted.

generic/admission/metadata.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
version: v0.2.3
22
policyRules:
3-
- name: deny-privileged-pods
4-
precondition:
5-
- OPTSCAN
6-
description:
7-
tldr: Deny deployment of privileged pods across the cluster
8-
detailed: This policy denies the deployment of privileged pods across the cluster to enforce security best practices and prevent privilege escalation risks. The kube-system namespace is excluded from this policy to avoid disruption of critical system components such as CoreDNS, Kube Proxy, and other essential Kubernetes services that may require privileged access.
9-
yaml: deny-privileged-pods.yaml
3+
- name: priv-escalation-and-deny-priv-pod
4+
precondition:
5+
- OPTSCAN
6+
description:
7+
tldr: Block privileged pods and privilege escalation in workloads
8+
detailed: This policy blocks privileged pods and privilege escalation to reduce the risk of container escape and enforce least-privilege security across the cluster, while excluding the kube-system namespace to avoid impacting
9+
critical Kubernetes components.
10+
yaml: priv-escalation-and-deny-priv-pod.yaml
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
apiVersion: admission.accuknox.com/v1
2+
kind: AdmissionPolicy
3+
metadata:
4+
annotations:
5+
app.accuknox.com/source: policy-manager
6+
app.accuknox.com/type: harden
7+
name: priv-escalation-and-deny-priv-pod
8+
spec:
9+
privilegedPod:
10+
action: Block
11+
ignoreNamespaces:
12+
- kube-system
13+
privilegeEscalation:
14+
action: Block
15+
ignoreNamespaces:
16+
- kube-system

0 commit comments

Comments
 (0)