k8s-scanner
Kubernetes SCA scanner by RapidFort
About this chart
k8s-scanner
k8s-scanner is RapidFort's Kubernetes SCA scanner
Generate SBOMs and get an accurate vulnerability report for every container running in your Kubernetes cluster. View the results on the RapidFort platform.
Getting Started
-
Create a free account on RapidFort.
-
Launch the Quick Start guide and click "Kubernetes Scanner" to generate a service account for your Kubernetes instance.
-
Export the RF_ACCESS_ID and RF_SECRET_ACCESS_KEY values for your environment or add them to your profile.
Installing the Helm Chart
To install the chart with the release name my-release:
## Add the RapidFort Helm repository
$ helm repo add rapidfort https://rapidfort.github.io/helm
## Install the k8s-scanner helm chart
$ helm upgrade --install my-release rapidfort/k8s-scanner \
--set secret.rf_access_id=$RF_ACCESS_ID \
--set secret.rf_secret_access_key=$RF_SECRET_ACCESS_KEY
Tip: List all releases using
helm list --all-namespaces
Uninstalling the chart
To uninstall/delete the my-release deployment:
$ helm delete my-release
Configuration
| Parameter | Description | Default |
|---|---|---|
global.rf_root_url | RapidFort platform URL | https://frontrow.rapidfort.com |
secret.rf_access_id | RF_ACCESS_ID for RapidFort service account | "" |
secret.rf_secret_access_key | RF_SECRET_ACCESS_KEY for RapidFort service account | "" |
namespace_label.key | label key for k8s namespace to be monitored | "" |
namespace_label.value | label value for k8s namespace to be monitored | "" |
image.repository | Container image repository | "rapidfort/k8s-scanner" |
runFrequencyInSeconds | Run frequency in seconds | "900" |
engine | Container Runtime engine. Values = "docker" or "cri" | "docker" |
project.name | RapidFort project name. | "k8s-scanner-project" |
project.description | RapidFort project description. | "This project is automatically created by k8s-scanner" |
image.tag | Container image tag | "latest" |
image.pullPolicy | Container image pullPolicy | "Always" |
imagePullSecrets | Image pull secrets for private registry | "[]" |
Cluster Role
k8s-scanner enumerates a list of all pods running in your Kubernetes cluster, so it requires "list" permission on the "pods" resource for the entire cluster.
- apiGroups: [""]
resources: ["pods", "namespaces"]
verbs: ["list"]
Host Access
k8s-scanner currently needs to access the host machine's docker socket running at /var/run to access Docker images. It also needs access to /tmp volume for accessing exported docker images.
volumes:
- name: docker-sock
hostPath:
path: /var/run
- name: tmp
hostPath:
path: /tmp
For CRI engine, it uses following hosts:
- name: containerd-sock
hostPath:
path: /run/containerd/containerd.sock
- name: containerd-lib
hostPath:
path: /var/lib/containerd
- name: tmp
hostPath:
path: /tmp
Deploy k8s-scanner with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has k8s-scanner on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartk8s-scanner is pinned at v1.0.6 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply