Skip to content

Commit

Permalink
add 'kubectl' process name to allowlist (aquasecurity#1549)
Browse files Browse the repository at this point in the history
  • Loading branch information
roikol authored May 31, 2022
1 parent 9ef2e5f commit 1631ebd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion signatures/rego/k8s_service_account_token.rego
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ tracee_match {
contains(pathname,"secrets/kubernetes.io/serviceaccount")
endswith(pathname,"token")

process_names_allowlist := {"flanneld", "kube-proxy", "etcd", "kube-apiserver", "coredns", "kube-controller"}
process_names_allowlist := {"flanneld", "kube-proxy", "etcd", "kube-apiserver", "coredns", "kube-controller", "kubectl"}
not process_names_allowlist[input.processName]
}
19 changes: 19 additions & 0 deletions signatures/rego/k8s_service_account_token_test.rego
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,22 @@ test_match_wrong_request {
]
}
}

test_match_wrong_process_name {
not tracee_match with input as {
"processId": 1000,
"hostProcessId": 1,
"eventName": "security_file_open",
"processName":"kubectl",
"args": [
{
"name": "flags",
"value": "O_RDONLY"
},
{
"name": "pathname",
"value": "/var/run/secrets/kubernetes.io/serviceaccount/token"
}
]
}
}

0 comments on commit 1631ebd

Please sign in to comment.