Error to read kubeconfig with trivy #5794
Labels
target/kubernetes
Issues relating to kubernetes cluster scanning
triage/support
Indicates an issue that is a support question.
Discussed in #5769
Originally posted by pczanwar December 9, 2023
Question
FATAL failed getting k8s cluster: stat $HOME/.kube/dev.yml: no such file or directory
I have the yaml file in the path(kubeconfig)
My versions for kubectl and trivy are -
docker run --rm -v ${pwd}/tmp:/root/.cache/ -v //var/run/docker.sock:/var/run/docker.sock aquasec/trivy --version
Version: 0.48.0
kubectl.exe version
Client Version: v1.28.2
Here is the command i am trying to run -
docker run --rm -v ${pwd}/tmp:/root/.cache/ -v //var/run/docker.sock:/var/run/docker.sock aquasec/trivy:latest k8s --kubeconfig ~/.kube/dev.yml --report summary cluster -s HIGH
error is -
$ docker run --rm -v ${pwd}/tmp:/root/.cache/ -v //var/run/docker.sock:/var/run/docker.sock aquasec/trivy k8s --kubeconfig ~/.kube/advdev.yml --report summary cluster -s HIGH
2023-12-09T00:06:03.331Z FATAL failed getting k8s cluster: stat C:/XXX/YYYYYY/.kube/dev.yml: no such file or directory
File: /c/XXX/YYYYYY/.kube/dev.yml
Size: 6692 Blocks: 8 IO Block: 65536 regular file
Device: 788eb514h/2022618388d Inode: 2251799813728761 Links: 1
Access: (0644/-rw-r--r--) Uid: (3706294/prashant.zanwar) Gid: (1049089/ UNKNOWN)
Access: 2023-12-08 19:07:59.039528000 -0500
Modify: 2023-12-08 18:35:09.809407100 -0500
Change: 2023-12-08 19:07:59.177812900 -0500
Birth: 2023-12-08 19:07:59.052437900 -0500
Please advice --
Target
None
Scanner
None
Output Format
None
Mode
None
Operating System
No response
Version
No response
The text was updated successfully, but these errors were encountered: