Trivy Kubernetes Scan Error with specific rule check on AKS #7390
chosenonehacks
started this conversation in
Bugs
Replies: 2 comments
-
Hi @chosenonehacks ! I'll take a look. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi @chosenonehacks! which Trivy version do you use? it looks like v0.48 $ trivy k8s --scanners misconfig --report=summary --timeout=1800s cluster
2024-08-26T23:32:58+06:00 FATAL Fatal error failed getting k8s cluster: context "cluster" does not exist
$ trivy -v
Version: 0.54.1 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
Hi there, I am doing trivy scan or Azure Kubernetes cluster (AKS) and while performing misconfig scan I am getting following error always related to the same check rule:
024-08-26T10:53:22.198+0200 FATAL get k8s artifacts with node info error: running node-collector job: warning event received: policy require-run-as-nonroot/autogen-run-as-non-root fail: validation error: Running as root is not allowed. Either the field spec.securityContext.runAsNonRoot must be set to
true, or the fields spec.containers[*].securityContext.runAsNonRoot, spec.initContainers[*].securityContext.runAsNonRoot, and spec.ephemeralContainers[*].securityContext.runAsNonRoot must be set to
true. rule autogen-run-as-non-root[0] failed at path /spec/template/spec/securityContext/runAsNonRoot/ rule autogen-run-as-non-root[1] failed at path /spec/template/spec/containers/0/securityContext/runAsNonRoot/ (PolicyViolation)
Is there a way to skip this rule? Or where is the problem and how to overcome this error?
Desired Behavior
Misconfig scan completes without errors.
Actual Behavior
Misconfig scan errors and is not completed
Reproduction Steps
Target
Kubernetes
Scanner
Misconfiguration
Output Format
None
Mode
Standalone
Debug Output
Operating System
Kali
Version
Checklist
trivy clean --all
Beta Was this translation helpful? Give feedback.
All reactions