Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error encountered during Trivy scan of RKE2. #6127

Closed
2 tasks done
chen-keinan opened this issue Feb 14, 2024 Discussed in #6093 · 4 comments
Closed
2 tasks done

Error encountered during Trivy scan of RKE2. #6127

chen-keinan opened this issue Feb 14, 2024 Discussed in #6093 · 4 comments
Assignees
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

Comments

@chen-keinan
Copy link
Contributor

Discussed in #6093

Originally posted by Hamzachelligue February 9, 2024

Description

Dear all
I am using Trivy to generate a CIS benchmark report, but it is showing me errors related to the kube-apiserver pod, indicating that --anonymous-auth arguments should be false, even though they are present on the pods with the correct attribut.
Has anyone encountered this type of problem? Thank you in advance.

Desired Behavior

How to correct this problem?
there are many arguments with the same problem

Actual Behavior

The error message indicates the absence of an argument that is present.

Reproduction Steps

1.trivy k8s --namespace=kube-system --report=all  --compliance=k8s-cis pod

Target

Kubernetes

Scanner

Vulnerability

Output Format

Table

Mode

Client/Server

Debug Output

Pod/kube-apiserver-controlplane-1 (kubernetes)
==============================================
Tests: 1 (SUCCESSES: 0, FAILURES: 1, EXCEPTIONS: 0)
Failures: 0 ()
 
MEDIUM: Ensure that the --anonymous-auth argument is set to false^M
══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════^M
Disable anonymous requests to the API server.^M
^M
See https://avd.aquasec.com/misconfig/kcv0001^M
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────^M
Pod/kube-apiserver-controlplane-1:25-186^M
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────^M
  25 ┌         - args:^M
  26 │             - --admission-control-config-file=/etc/rancher/rke2/rke2-pss.yaml^M
  27 │             - --allow-privileged=true^M
  28 │             - --anonymous-auth=false^M
  29 │             - --api-audiences=https://kubernetes.default.svc.cluster.local,rke2^M
  30 │             - --authorization-mode=Node,RBAC^M
  31 │             - --bind-address=0.0.0.0^M
  32 │             - --cert-dir=/var/lib/rancher/rke2/server/tls/temporary-certs^M
  33 └             - --client-ca-file=/var/lib/rancher/rke2/server/tls/client-ca.crt^M
  ..   ^M

Operating System

linux

Version

0.49.0

Checklist

@chen-keinan chen-keinan added kind/bug Categorizes issue or PR as related to a bug. target/kubernetes Issues relating to kubernetes cluster scanning labels Feb 14, 2024
@chen-keinan chen-keinan self-assigned this Feb 14, 2024
@chen-keinan chen-keinan added the priority/backlog Higher priority than priority/awaiting-more-evidence. label Feb 14, 2024
@imstevenxyz
Copy link

I am also experiencing this on a newly installed RKE2 cluster (v1.29.1+rke2r1) and trivy-0.49.1

@itaysk
Copy link
Contributor

itaysk commented Apr 9, 2024

@chen-keinan is this still an issue?

@chen-keinan
Copy link
Contributor Author

@chen-keinan is this still an issue?

I'll investigate and update

@chen-keinan
Copy link
Contributor Author

fixed by this PR aquasecurity/trivy-checks#110

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

3 participants