"trivy kubernetes" (v0.47.0) panics in GitLab CI pipeline job #5628
Labels
kind/bug
Categorizes issue or PR as related to a bug.
target/kubernetes
Issues relating to kubernetes cluster scanning
Milestone
Discussed in #5583
Originally posted by elchenberg November 14, 2023
Description
I have a GitLab CI pipeline job that runs
trivy kubernetes [...]
. It runs without issues with Trivy v0.46.1 but when I try to update to Trivy v0.47.0 it panics.I suspect that this might be related to the kubeconfig: There is no kubeconfig in the pipeline job.
Instead of a kubeconfig
kubectl
uses the job's serviceaccount token (located at /var/run/secrets/kubernetes.io/serviceaccount/token).Desired Behavior
No panic.
Actual Behavior
Panic.
Reproduction Steps
1. Have a GitLab Runner using a Kubernetes executor. 2. Have a pipeline job that runs `trivy kubernetes`: trivy kubernetes: image: docker.io/aquasec/trivy:0.47.0 script: - trivy --debug kubernetes --exit-code 1 --namespace=default --no-progress --report all --scanners config --severity MEDIUM,HIGH,CRITICAL all
Target
Kubernetes
Scanner
Misconfiguration
Output Format
None
Mode
Standalone
Debug Output
Checklist
trivy image --reset
The text was updated successfully, but these errors were encountered: