Skip to content

fix: add missing permission to get namespaces#2728

Merged
simar7 merged 1 commit intoaquasecurity:mainfrom
dcoppa:main
Sep 23, 2025
Merged

fix: add missing permission to get namespaces#2728
simar7 merged 1 commit intoaquasecurity:mainfrom
dcoppa:main

Conversation

@dcoppa
Copy link
Copy Markdown
Contributor

@dcoppa dcoppa commented Aug 29, 2025

Description

trivy-operator is doing:

_, err := r.clientset.CoreV1().Namespaces().Get(ctx, "openshift-kube-apiserver", metav1.GetOptions{})

to check if it's running on OpenShift.

Because the operator is missing the necessary permission to get namespaces, our logs are filled with errors like the one below:

namespaces "openshift-kube-apiserver" is forbidden: User "system:serviceaccount:trivy:trivy" cannot get resource "namespaces" in API group "" in the namespace "openshift-kube-apiserver"

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

@dcoppa dcoppa requested a review from simar7 as a code owner August 29, 2025 08:33
@github-actions github-actions bot added the bug label Aug 29, 2025
Copy link
Copy Markdown
Contributor

@afdesk afdesk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
thanks for your contribution!

cc @simar7

@dcoppa
Copy link
Copy Markdown
Contributor Author

dcoppa commented Sep 22, 2025

Any news?

@simar7 simar7 merged commit dfaf42a into aquasecurity:main Sep 23, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants