Skip to content

fix(k8s): support kubernetes v1.31#7810

Merged
knqyf263 merged 2 commits intoaquasecurity:mainfrom
afdesk:fix/k8s/support-v1.31
Oct 29, 2024
Merged

fix(k8s): support kubernetes v1.31#7810
knqyf263 merged 2 commits intoaquasecurity:mainfrom
afdesk:fix/k8s/support-v1.31

Conversation

@afdesk
Copy link
Contributor

@afdesk afdesk commented Oct 29, 2024

Description

This PR adds a new condition status from Kubernetes 1.31.*

$ minikube start --kubernetes-version='v1.31.1'

Before:

$ ./trivy k8s --report summary
INFINITY LOOP

After:

$ ./trivy k8s --report summary
2024-10-29T12:01:44+06:00       INFO    Node scanning is enabled
2024-10-29T12:01:44+06:00       INFO    If you want to disable Node scanning via an in-cluster Job, please try '--disable-node-collector' to disable the Node-Collector job.
207 / 207 [-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------] 100.00% 13 p/s

Summary Report for minikube


Workload Assessment
┌───────────┬──────────┬───────────────────┬───────────────────┬───────────────────┐
│ Namespace │ Resource │  Vulnerabilities  │ Misconfigurations │      Secrets      │
│           │          ├───┬───┬───┬───┬───┼───┬───┬───┬───┬───┼───┬───┬───┬───┬───┤
│           │          │ C │ H │ M │ L │ U │ C │ H │ M │ L │ U │ C │ H │ M │ L │ U │
└───────────┴──────────┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┘
Severities: C=CRITICAL H=HIGH M=MEDIUM L=LOW U=UNKNOWN


Infra Assessment
┌─────────────┬──────────────────────────────────────────────┬──────────────────────┬───────────────────┬───────────────────┐
│  Namespace  │                   Resource                   │   Vulnerabilities    │ Misconfigurations │      Secrets      │
│             │                                              ├───┬────┬────┬────┬───┼───┬───┬───┬───┬───┼───┬───┬───┬───┬───┤
│             │                                              │ C │ H  │ M  │ L  │ U │ C │ H │ M │ L │ U │ C │ H │ M │ L │ U │
├─────────────┼──────────────────────────────────────────────┼───┼────┼────┼────┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
│ kube-system │ DaemonSet/kube-proxy                         │   │ 2  │ 8  │ 17 │   │   │ 3 │ 5 │ 9 │   │   │   │   │   │   │
│ kube-system │ Pod/kube-controller-manager-minikube         │   │ 2  │ 5  │ 1  │   │   │   │   │   │   │   │   │   │   │   │
│ kube-system │ Deployment/coredns                           │   │ 1  │ 3  │    │   │   │   │   │   │   │   │   │   │   │   │
│ kube-system │ Pod/kube-apiserver-minikube                  │   │ 2  │ 5  │ 1  │   │   │   │   │   │   │   │   │   │   │   │
│ kube-system │ Service/kube-dns                             │   │    │    │    │   │   │   │ 1 │   │   │   │   │   │   │   │
│ kube-system │ ConfigMap/extension-apiserver-authentication │   │    │    │    │   │   │   │ 1 │   │   │   │   │   │   │   │
│ kube-system │ Pod/storage-provisioner                      │ 4 │ 52 │ 34 │ 1  │   │   │ 2 │ 5 │ 9 │   │   │   │   │   │   │
│ kube-system │ Pod/kube-scheduler-minikube                  │   │ 2  │ 4  │ 1  │   │   │   │   │   │   │   │   │   │   │   │
│ kube-system │ Pod/etcd-minikube                            │   │ 5  │ 10 │    │   │   │   │   │   │   │   │   │   │   │   │
│             │ Node/minikube                                │   │    │    │    │   │   │ 4 │   │ 2 │   │   │   │   │   │   │
└─────────────┴──────────────────────────────────────────────┴───┴────┴────┴────┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┘
Severities: C=CRITICAL H=HIGH M=MEDIUM L=LOW U=UNKNOWN


RBAC Assessment
┌─────────────┬────────────────────────────────────────────────────────────────────┬───────────────────┐
│  Namespace  │                              Resource                              │  RBAC Assessment  │
│             │                                                                    ├───┬───┬───┬───┬───┤
│             │                                                                    │ C │ H │ M │ L │ U │
├─────────────┼────────────────────────────────────────────────────────────────────┼───┼───┼───┼───┼───┤
│ kube-system │ Role/system:controller:cloud-provider                              │   │   │ 1 │   │   │
│ kube-system │ Role/system:persistent-volume-provisioner                          │   │ 2 │   │   │   │
│ kube-system │ Role/system::leader-locking-kube-scheduler                         │   │   │ 1 │   │   │
│ kube-system │ Role/system:controller:token-cleaner                               │   │   │ 1 │   │   │
│ kube-system │ Role/system:controller:bootstrap-signer                            │   │   │ 1 │   │   │
│ kube-system │ Role/system::leader-locking-kube-controller-manager                │   │   │ 1 │   │   │
│ kube-public │ RoleBinding/kubeadm:bootstrap-signer-clusterinfo                   │ 1 │   │   │   │   │
│ kube-public │ Role/system:controller:bootstrap-signer                            │   │   │ 1 │   │   │
│             │ ClusterRole/system:controller:namespace-controller                 │ 1 │   │   │   │   │
│             │ ClusterRole/system:controller:root-ca-cert-publisher               │   │   │ 1 │   │   │
│             │ ClusterRole/system:controller:persistent-volume-binder             │ 1 │ 2 │ 1 │   │   │
│             │ ClusterRole/system:aggregate-to-admin                              │ 1 │   │   │   │   │
│             │ ClusterRole/system:controller:generic-garbage-collector            │ 1 │   │   │   │   │
│             │ ClusterRole/system:kube-scheduler                                  │   │   │ 1 │   │   │
│             │ ClusterRole/system:aggregate-to-edit                               │ 2 │ 4 │ 6 │   │   │
│             │ ClusterRole/system:controller:horizontal-pod-autoscaler            │ 2 │   │   │   │   │
│             │ ClusterRole/system:controller:endpointslicemirroring-controller    │   │ 1 │   │   │   │
│             │ ClusterRole/system:controller:ttl-after-finished-controller        │   │   │ 1 │   │   │
│             │ ClusterRole/admin                                                  │ 3 │ 4 │ 6 │   │   │
│             │ ClusterRole/system:kube-controller-manager                         │ 5 │   │   │   │   │
│             │ ClusterRole/system:node                                            │ 1 │   │ 1 │   │   │
│             │ ClusterRoleBinding/cluster-admin                                   │   │   │ 1 │   │   │
│             │ ClusterRole/system:controller:legacy-service-account-token-cleaner │ 1 │   │   │   │   │
│             │ ClusterRole/system:controller:endpoint-controller                  │   │ 1 │   │   │   │
│             │ ClusterRole/system:controller:expand-controller                    │ 1 │   │   │   │   │
│             │ ClusterRole/cluster-admin                                          │ 2 │   │   │   │   │
│             │ ClusterRole/system:controller:endpointslice-controller             │   │ 1 │   │   │   │
│             │ ClusterRole/system:controller:replicaset-controller                │   │   │ 2 │   │   │
│             │ ClusterRole/system:controller:replication-controller               │   │   │ 2 │   │   │
│             │ ClusterRole/system:controller:pod-garbage-collector                │   │   │ 1 │   │   │
│             │ ClusterRoleBinding/kubeadm:cluster-admins                          │   │   │ 1 │   │   │
│             │ ClusterRole/system:controller:daemon-set-controller                │   │   │ 1 │   │   │
│             │ ClusterRole/system:controller:deployment-controller                │   │   │ 3 │   │   │
│             │ ClusterRoleBinding/minikube-rbac                                   │   │   │ 1 │   │   │
│             │ ClusterRole/system:controller:resourcequota-controller             │ 1 │   │   │   │   │
│             │ ClusterRole/system:controller:job-controller                       │   │   │ 2 │   │   │
│             │ ClusterRole/system:controller:statefulset-controller               │   │   │ 1 │   │   │
│             │ ClusterRole/edit                                                   │ 2 │ 4 │ 6 │   │   │
│             │ ClusterRole/system:controller:cronjob-controller                   │   │   │ 3 │   │   │
│             │ ClusterRole/system:controller:node-controller                      │   │   │ 1 │   │   │
└─────────────┴────────────────────────────────────────────────────────────────────┴───┴───┴───┴───┴───┘
Severities: C=CRITICAL H=HIGH M=MEDIUM L=LOW U=UNKNOWN

Related issues

Related PRs

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've followed the conventions in the PR title.
  • 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).

@afdesk afdesk marked this pull request as ready for review October 29, 2024 06:17
@afdesk afdesk requested a review from knqyf263 as a code owner October 29, 2024 06:17
@afdesk afdesk marked this pull request as draft October 29, 2024 06:25
@afdesk afdesk marked this pull request as ready for review October 29, 2024 06:26
@afdesk afdesk requested review from nikpivkin and simar7 October 29, 2024 06:56
@knqyf263 knqyf263 added this pull request to the merge queue Oct 29, 2024
Merged via the queue into aquasecurity:main with commit 7a4f4d8 Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(k8s): scan for k8s v1.31.1 not working

3 participants