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

k8s summary separate infra and user finding results #6121

Closed
chen-keinan opened this issue Feb 13, 2024 · 0 comments · Fixed by #6120
Closed

k8s summary separate infra and user finding results #6121

chen-keinan opened this issue Feb 13, 2024 · 0 comments · Fixed by #6120
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
Milestone

Comments

@chen-keinan
Copy link
Contributor

chen-keinan commented Feb 13, 2024

Description

separate summery view of infra and workload components vulnerability, secrets and misconfiguration findings

infra:

all resources which are under namespace kube-system and Node resource

user:

all resources which are deployed by user and not match infra criteria

Roles and ClusterRoles will be handled with a separate PR.

Example:

Before:


Summary Report for kind-kind


Workload Assessment
┌────────────────────┬────────────────────────────────────────────────┬───────────────────────┬───────────────────┬───────────────────┐
│     Namespace      │                    Resource                    │    Vulnerabilities    │ Misconfigurations │      Secrets      │
│                    │                                                ├────┬────┬────┬────┬───┼───┬───┬───┬───┬───┼───┬───┬───┬───┬───┤
│                    │                                                │ C  │ H  │ M  │ L  │ U │ C │ H │ M │ L │ U │ C │ H │ M │ L │ U │
├────────────────────┼────────────────────────────────────────────────┼────┼────┼────┼────┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
│ local-path-storage │ Deployment/local-path-provisioner              │ 4  │ 32 │ 10 │ 2  │   │   │ 1 │ 3 │ 9 │   │   │   │   │   │   │
│ kube-system        │ Pod/kube-scheduler-kind-control-plane          │    │    │    │    │ 5 │   │ 2 │ 4 │ 8 │   │   │   │   │   │   │
│ kube-system        │ Pod/kube-apiserver-kind-control-plane          │    │    │    │    │ 5 │   │ 2 │ 4 │ 9 │   │   │   │   │   │   │
│ kube-system        │ DaemonSet/kindnet                              │ 19 │ 56 │ 57 │ 82 │ 2 │   │ 3 │ 5 │ 5 │   │   │   │   │   │   │
│ kube-system        │ ConfigMap/extension-apiserver-authentication   │    │    │    │    │   │   │   │ 1 │   │   │   │   │   │   │   │
│ kube-system        │ Deployment/coredns                             │    │ 13 │ 10 │ 3  │   │   │ 1 │ 3 │ 4 │   │   │   │   │   │   │
│ kube-system        │ DaemonSet/kube-proxy                           │ 19 │ 45 │ 47 │ 82 │ 2 │   │ 3 │ 4 │ 9 │   │   │   │   │   │   │
│ kube-system        │ Pod/etcd-kind-control-plane                    │    │    │    │    │ 6 │   │ 2 │ 4 │ 7 │   │   │   │   │   │   │
│ kube-system        │ Pod/kube-controller-manager-kind-control-plane │    │    │    │    │ 5 │   │ 2 │ 4 │ 8 │   │   │   │   │   │   │
│ kube-system        │ ControlPlaneComponents/k8s.io/apiserver        │    │    │ 3  │    │   │   │   │   │   │   │   │   │   │   │   │
│                    │ NodeComponents/kind-control-plane              │    │ 4  │ 7  │ 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:bootstrap-signer                         │   │   │ 1 │   │   │
│ kube-system │ Role/system::leader-locking-kube-scheduler                      │   │   │ 1 │   │   │
│ kube-system │ Role/system:controller:cloud-provider                           │   │   │ 1 │   │   │
│ kube-system │ Role/system::leader-locking-kube-controller-manager             │   │   │ 1 │   │   │
│ kube-system │ Role/system:controller:token-cleaner                            │   │   │ 1 │   │   │
│ kube-public │ Role/system:controller:bootstrap-signer                         │   │   │ 1 │   │   │
│ kube-public │ RoleBinding/kubeadm:bootstrap-signer-clusterinfo                │ 1 │   │   │   │   │
│             │ ClusterRole/admin                                               │ 3 │ 4 │ 6 │   │   │
│             │ ClusterRole/system:controller:node-controller                   │   │   │ 1 │   │   │
│             │ ClusterRole/system:controller:resourcequota-controller          │ 1 │   │   │   │   │
│             │ ClusterRole/system:controller:persistent-volume-binder          │ 1 │ 2 │ 1 │   │   │
│             │ ClusterRole/system:controller:replication-controller            │   │   │ 2 │   │   │
│             │ ClusterRole/system:controller:root-ca-cert-publisher            │   │   │ 1 │   │   │
│             │ ClusterRole/local-path-provisioner-role                         │ 1 │ 1 │ 1 │   │   │
│             │ ClusterRole/system:controller:daemon-set-controller             │   │   │ 1 │   │   │
│             │ ClusterRole/edit                                                │ 2 │ 4 │ 6 │   │   │
│             │ ClusterRole/system:controller:job-controller                    │   │   │ 2 │   │   │
│             │ ClusterRole/system:controller:statefulset-controller            │   │   │ 1 │   │   │
│             │ ClusterRole/system:controller:endpointslicemirroring-controller │   │ 1 │   │   │   │
│             │ ClusterRole/system:controller:ttl-after-finished-controller     │   │   │ 1 │   │   │
│             │ ClusterRole/system:controller:expand-controller                 │ 1 │   │   │   │   │
│             │ ClusterRole/cluster-admin                                       │ 2 │   │   │   │   │
│             │ ClusterRole/system:aggregate-to-admin                           │ 1 │   │   │   │   │
│             │ ClusterRole/system:kube-scheduler                               │   │ 2 │ 1 │   │   │
│             │ ClusterRole/system:aggregate-to-edit                            │ 2 │ 4 │ 6 │   │   │
│             │ ClusterRole/system:controller:cronjob-controller                │   │   │ 3 │   │   │
│             │ ClusterRole/system:controller:horizontal-pod-autoscaler         │ 1 │   │   │   │   │
│             │ ClusterRole/system:node                                         │ 1 │   │ 1 │   │   │
│             │ ClusterRoleBinding/cluster-admin                                │   │   │ 1 │   │   │
│             │ ClusterRole/system:controller:pod-garbage-collector             │   │   │ 1 │   │   │
│             │ ClusterRole/system:controller:replicaset-controller             │   │   │ 2 │   │   │
│             │ ClusterRole/system:kube-controller-manager                      │ 5 │ 2 │   │   │   │
│             │ ClusterRole/system:controller:generic-garbage-collector         │ 1 │   │   │   │   │
│             │ ClusterRole/system:controller:namespace-controller              │ 1 │   │   │   │   │
│             │ ClusterRole/system:controller:deployment-controller             │   │   │ 3 │   │   │
│             │ ClusterRole/system:controller:endpointslice-controller          │   │ 1 │   │   │   │
│             │ ClusterRole/system:controller:endpoint-controller               │   │ 1 │   │   │   │
└─────────────┴─────────────────────────────────────────────────────────────────┴───┴───┴───┴───┴───┘
Severities: C=CRITICAL H=HIGH M=MEDIUM L=LOW U=UNKNOWN


Infra Assessment
┌─────────────┬────────────────────────────────────────────────┬─────────────────────────────┐
│  Namespace  │                    Resource                    │ Kubernetes Infra Assessment │
│             │                                                ├─────┬─────┬─────┬─────┬─────┤
│             │                                                │  C  │  H  │  M  │  L  │  U  │
├─────────────┼────────────────────────────────────────────────┼─────┼─────┼─────┼─────┼─────┤
│ kube-system │ Pod/kube-controller-manager-kind-control-plane │     │     │     │ 3   │     │
│ kube-system │ Pod/kube-apiserver-kind-control-plane          │     │     │ 1   │ 8   │     │
│ kube-system │ Pod/kube-scheduler-kind-control-plane          │     │     │     │ 1   │     │
│             │ NodeInfo/kind-control-plane                    │  1  │ 4   │     │ 1   │     │
└─────────────┴────────────────────────────────────────────────┴─────┴─────┴─────┴─────┴─────┘
Severities: C=CRITICAL H=HIGH M=MEDIUM L=LOW U=UNKNOWN

After:


Summary Report for kind-kind


Workload Assessment
┌────────────────────┬───────────────────────────────────┬─────────────────────┬───────────────────┬───────────────────┐
│     Namespace      │             Resource              │   Vulnerabilities   │ Misconfigurations │      Secrets      │
│                    │                                   ├───┬────┬────┬───┬───┼───┬───┬───┬───┬───┼───┬───┬───┬───┬───┤
│                    │                                   │ C │ H  │ M  │ L │ U │ C │ H │ M │ L │ U │ C │ H │ M │ L │ U │
├────────────────────┼───────────────────────────────────┼───┼────┼────┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
│ local-path-storage │ Deployment/local-path-provisioner │ 4 │ 32 │ 10 │ 2 │   │   │ 1 │ 3 │ 9 │   │   │   │   │   │   │
└────────────────────┴───────────────────────────────────┴───┴────┴────┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┘
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/kindnet                              │ 19 │ 56 │ 57 │ 82 │ 2 │   │ 3 │ 5 │ 5  │   │   │   │   │   │   │
│ kube-system │ Pod/kube-scheduler-kind-control-plane          │    │    │    │    │ 5 │   │ 2 │ 4 │ 9  │   │   │   │   │   │   │
│ kube-system │ DaemonSet/kube-proxy                           │ 19 │ 45 │ 47 │ 82 │ 2 │   │ 3 │ 4 │ 9  │   │   │   │   │   │   │
│ kube-system │ ControlPlaneComponents/k8s.io/apiserver        │    │    │ 3  │    │   │   │   │   │    │   │   │   │   │   │   │
│ kube-system │ Pod/etcd-kind-control-plane                    │    │    │    │    │ 6 │   │ 2 │ 4 │ 7  │   │   │   │   │   │   │
│ kube-system │ Deployment/coredns                             │    │ 13 │ 10 │ 3  │   │   │ 1 │ 3 │ 4  │   │   │   │   │   │   │
│ kube-system │ Pod/kube-apiserver-kind-control-plane          │    │    │    │    │ 5 │   │ 2 │ 5 │ 17 │   │   │   │   │   │   │
│ kube-system │ ConfigMap/extension-apiserver-authentication   │    │    │    │    │   │   │   │ 1 │    │   │   │   │   │   │   │
│ kube-system │ Pod/kube-controller-manager-kind-control-plane │    │    │    │    │ 5 │   │ 2 │ 4 │ 11 │   │   │   │   │   │   │
│             │ Node/kind-control-plane                        │    │ 4  │ 7  │ 2  │   │ 1 │ 4 │   │ 1  │   │   │   │   │   │   │
└─────────────┴────────────────────────────────────────────────┴────┴────┴────┴────┴───┴───┴───┴───┴────┴───┴───┴───┴───┴───┴───┘
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:controller:token-cleaner                            │   │   │ 1 │   │   │
│ kube-system │ Role/system:controller:bootstrap-signer                         │   │   │ 1 │   │   │
│ kube-system │ Role/system::leader-locking-kube-scheduler                      │   │   │ 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:replication-controller            │   │   │ 2 │   │   │
│             │ ClusterRole/system:controller:job-controller                    │   │   │ 2 │   │   │
│             │ ClusterRole/system:controller:persistent-volume-binder          │ 1 │ 2 │ 1 │   │   │
│             │ ClusterRole/system:controller:resourcequota-controller          │ 1 │   │   │   │   │
│             │ ClusterRole/system:controller:endpoint-controller               │   │ 1 │   │   │   │
│             │ ClusterRole/system:controller:deployment-controller             │   │   │ 3 │   │   │
│             │ ClusterRole/system:controller:endpointslice-controller          │   │ 1 │   │   │   │
│             │ ClusterRole/admin                                               │ 3 │ 4 │ 6 │   │   │
│             │ ClusterRoleBinding/cluster-admin                                │   │   │ 1 │   │   │
│             │ ClusterRole/system:controller:horizontal-pod-autoscaler         │ 1 │   │   │   │   │
│             │ ClusterRole/system:kube-scheduler                               │   │ 2 │ 1 │   │   │
│             │ ClusterRole/system:controller:root-ca-cert-publisher            │   │   │ 1 │   │   │
│             │ ClusterRole/edit                                                │ 2 │ 4 │ 6 │   │   │
│             │ ClusterRole/system:controller:namespace-controller              │ 1 │   │   │   │   │
│             │ ClusterRole/system:node                                         │ 1 │   │ 1 │   │   │
│             │ ClusterRole/cluster-admin                                       │ 2 │   │   │   │   │
│             │ ClusterRole/system:controller:cronjob-controller                │   │   │ 3 │   │   │
│             │ ClusterRole/system:controller:endpointslicemirroring-controller │   │ 1 │   │   │   │
│             │ ClusterRole/system:controller:daemon-set-controller             │   │   │ 1 │   │   │
│             │ ClusterRole/system:controller:generic-garbage-collector         │ 1 │   │   │   │   │
│             │ ClusterRole/system:controller:pod-garbage-collector             │   │   │ 1 │   │   │
│             │ ClusterRole/system:controller:node-controller                   │   │   │ 1 │   │   │
│             │ ClusterRole/system:kube-controller-manager                      │ 5 │ 2 │   │   │   │
│             │ ClusterRole/system:controller:replicaset-controller             │   │   │ 2 │   │   │
│             │ ClusterRole/system:controller:statefulset-controller            │   │   │ 1 │   │   │
│             │ ClusterRole/system:aggregate-to-edit                            │ 2 │ 4 │ 6 │   │   │
│             │ ClusterRole/system:aggregate-to-admin                           │ 1 │   │   │   │   │
│             │ ClusterRole/local-path-provisioner-role                         │ 1 │ 1 │ 1 │   │   │
│             │ ClusterRole/system:controller:ttl-after-finished-controller     │   │   │ 1 │   │   │
│             │ ClusterRole/system:controller:expand-controller                 │ 1 │   │   │   │   │
└─────────────┴─────────────────────────────────────────────────────────────────┴───┴───┴───┴───┴───┘
Severities: C=CRITICAL H=HIGH M=MEDIUM L=LOW U=UNKNOWN
@chen-keinan chen-keinan added 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 labels Feb 13, 2024
@chen-keinan chen-keinan added this to the v0.50.0 milestone Feb 18, 2024
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

Successfully merging a pull request may close this issue.

1 participant