k8s-scanner

by RapidFort, Inc.

Helm chartv1.0.6Verified publisher

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

  1. Create a free account on RapidFort.

  2. Launch the Quick Start guide and click "Kubernetes Scanner" to generate a service account for your Kubernetes instance.

  3. 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

ParameterDescriptionDefault
global.rf_root_urlRapidFort platform URLhttps://frontrow.rapidfort.com
secret.rf_access_idRF_ACCESS_ID for RapidFort service account""
secret.rf_secret_access_keyRF_SECRET_ACCESS_KEY for RapidFort service account""
namespace_label.keylabel key for k8s namespace to be monitored""
namespace_label.valuelabel value for k8s namespace to be monitored""
image.repositoryContainer image repository"rapidfort/k8s-scanner"
runFrequencyInSecondsRun frequency in seconds"900"
engineContainer Runtime engine. Values = "docker" or "cri""docker"
project.nameRapidFort project name."k8s-scanner-project"
project.descriptionRapidFort project description."This project is automatically created by k8s-scanner"
image.tagContainer image tag"latest"
image.pullPolicyContainer image pullPolicy"Always"
imagePullSecretsImage 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.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartk8s-scanner is pinned at v1.0.6 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. 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