0.51: kubernetes scanner requires role permissions #6692
Labels
kind/bug
Categorizes issue or PR as related to a bug.
priority/backlog
Higher priority than priority/awaiting-more-evidence.
target/kubernetes
Issues relating to kubernetes cluster scanning
Discussed in #6653
Originally posted by jkroepke May 7, 2024
Description
I'm running trivy with an limited scope of permissions
Before 0.51, i'm runing trivy with following settings:
with works fine. After upgrade, I'm using the following command
I'm getting an error that trivy has no access to roles. However, trivy should not ask for roles.
Desired Behavior
Except that trivy is scanning the workload of deployments, statefulsets and daemonsets
Actual Behavior
2024-05-07T15:49:56Z FATAL Fatal error get k8s artifacts error: failed listing resources for gvr: rbac.authorization.k8s.io/v1, Resource=roles - roles.rbac.authorization.k8s.io is forbidden: User "system:serviceaccount:opsstack:opsstack-trivy" cannot list resource "roles" in API group "rbac.authorization.k8s.io" at the cluster scope
Reproduction Steps
1. Setup trivy using a context with namespace access only 2. Run the command above 3. ...
Target
Kubernetes
Scanner
Vulnerability
Output Format
Table
Mode
Standalone
Debug Output
Operating System
Linux
Version
Checklist
trivy image --reset
The text was updated successfully, but these errors were encountered: