Skip to content

Commit

Permalink
Adding CVE-2023-3676 check
Browse files Browse the repository at this point in the history
Signed-off-by: Amit Schendel <[email protected]>
  • Loading branch information
amitschendel committed Sep 14, 2023
1 parent 546619d commit 1c48fd8
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 0 deletions.
15 changes: 15 additions & 0 deletions rules/CVE-2023-3676/raw.rego
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package armo_builtins

deny[msg] {
input.request.kind.kind == "Pod"
path := input.request.object.spec.containers.volumeMounts.subPath
not startswith(path, "$(")
msga := {
"alertMessage": "You may be vulnerable to CVE-2023-3676",
"failedPaths": [path],
"fixPaths":[],
"alertObject": {
"k8SApiObjects": [input[_]],
},
}
}
25 changes: 25 additions & 0 deletions rules/CVE-2023-3676/rule.metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "CVE-2023-3676",
"attributes": {
"armoBuiltin": true
},
"ruleLanguage": "Rego",
"match": [
{
"apiGroups": [
"apps"
],
"apiVersions": [
"v1"
],
"resources": [
"Pod"
]
}
],
"ruleDependencies": [
],
"description": "Check for CVE-2023-3676",
"remediation": "Update kubelet version",
"ruleQuery": "armo_builtins"
}
23 changes: 23 additions & 0 deletions rules/CVE-2023-3676/test/pod/input/pod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: v1
kind: Pod
metadata:
name: wintest
spec:
containers:
- name: test
image: raesene/windows-powertools
command:
- powershell.exe
- -command
- "start-sleep -seconds 600"
volumeMounts:
- name: test
mountPath: c:\var
subPath: $(Start-process cmd)
volumes:
- name: test
hostPath:
path: c:\var
hostNetwork: true
nodeSelector:
kubernetes.io/os: windows

0 comments on commit 1c48fd8

Please sign in to comment.