rad-plugins
by RAD Security
A Helm chart to run the RAD Security plugins
About this chart
RAD Security Plugins
Introduction
This chart deploys the following plugins required for the RAD Security platform (formerly KSOC):
- rad-sync
- rad-watch
- rad-sbom
- rad-guard
- rad-runtime
These plugins perform several different tasks, which will be explained below.
rad-sync plugin
rad-sync is the plugin component synchronising Kubernetes resources to the customer cluster. Currently, only the GuardPolicy CRD is supported, but the mechanism is extensible and allows RAD Security to sync different resource types in the future. The plugin fetches resources from the RAD Security API. After executing them on the customer's cluster, the execution statuses are reported to the RAD Security API via HTTP calls. By default, the interval between the fetches is 60 seconds.
rad-watch plugin
rad-watch is the plugin component responsible for syncing cluster state back to RAD Security. On startup, a controller is created that follows the Kubernetes Informer pattern via the SharedIndexInformer to target the resource types that we are interested in individually.
The first action of the service is to upload the entire inventory of the cluster. Once this inventory is up-to-date, the plugin tracks events only generated when we detect a change in the object (or resource) state.
In this way, we can avoid the degradation of the API server, which would occur if we were to poll for resources. Automatic reconciliation is run every 24h by default in case any delete events are lost and prevent RAD Security from keeping track of stale objects.
rad-sbom plugin
rad-sbom is the plugin responsible for calculating SBOMs directly on the customer cluster. The plugin is run as an admission/mutating webhook, adding an image digest next to its tag if it's missing. This mutation is performed so TOCTOU does not impact the user. The image deployed is the image that RAD Security scanned. It sees all new workloads and calculates SBOMs for them. It continuously checks the RAD Security API to save time and resources to see if the SBOM is already known for any particular image digest. If not, it is being calculated and uploaded to RAD Security for further processing.
By default we use cyclonedx-json format for SBOMs, but it can be changed to spdx-json or syft-json by setting the SBOM_FORMAT environment variable in the values.yaml file.
To prevent the plugin from mutating the Pod resource, set the MUTATE_IMAGE and MUTATE_ANNOTATIONS environment variables to false. If observe a performance degradation while deploying new workloads, you can improve it significantly by disabling the mutation of the image tag and annotations.
In order to ignore images from scanning use the IGNORE_IMAGE_PREFIXES environment variable. It's a comma separated list of full image prefixes to ignore. Use registry.io to ignore the entire image registry, registry.io/repo to ignore a repository, registry.io/repo/image to ignore all versions of an image, or registry.io/repo/image:tag to ignore a specific version.
sbom:
env:
SBOM_FORMAT: cyclonedx-json
MUTATE_IMAGE: true
MUTATE_ANNOTATIONS: false
IGNORE_IMAGE_PREFIXES: "registry.io/repo/image,registry.io/repo/anotherImage:tag"
Currently, the plugin supports most of the popular container registries, via the IMAGE_PULL_SECRETS environment variable. Additionally we have native support for Azure Container Registries and ECR. See below for more details.
Private Azure Container Registry
To use a private Azure Container Registry, you need to set the azureWorkloadIdentityClientId in the values.yaml file. This will allow the plugin to use the Azure Workload Identity to authenticate to the registry. For more details see: Scanning images from Azure ACR.
Private ECR Registry
To use a private ECR Registry, you need to add and configure an AWS IAM role with the necessary permissions. For more details see: Scanning images from ECR.
rad-guard plugin
rad-guard is the plugin responsible for executing GuardPolicy (in the form of Rego) against a specific set of Kubernetes resources during their admission to the cluster, either allowing the admission or denying it.
The configuration for the blocking logic can be found in the guard section of the helm chart values file; see below.
guard:
config:
BLOCK_ON_POLICY_VIOLATION: true
If admission is blocked, it can be seen in the RAD Security application under the Events tab for the specific cluster. Finally, the plugin also acts as a mutating webhook that simply takes the AdmissionReview.UID and adds it as an annotation (rad-guard/admission: xxx). In the case of a blocked object, this gives RAD Security an identifier to track what would otherwise be an ephemeral event.
rad-runtime
rad-runtime is the plugin responsible for gathering runtime information from the nodes in the cluster. The plugin is not enabled by default. To enable the plugin, set the enabled value to true in your values file.
runtime:
enabled: true
When rad-runtime is enabled, an additional daemonset can be seen in the cluster. The daemonset is responsible for collecting runtime information from the nodes in the cluster. The information collected includes the following:
- Process information
- Network information
- Filesystem information
- Container information
By default the plugin uses containerd as a container runtime. If you are using docker or crio-o as your container runtime, you can enable it by configuring collectors in the values.yaml file.
runtime:
enabled: true
agent:
collectors:
containerd:
enabled: true
socket: /run/containerd/containerd.sock
crio:
enabled: false
socket: /run/crio/crio.sock
docker:
enabled: false
socket: /run/docker.sock
Each plugin pod contains agent and exporter containers. The agent container is responsible for collecting runtime information from the nodes in the cluster. The exporter container is responsible for exporting the collected information to the RAD Security platform.
Node Scheduling
You can control where rad-runtime pods are scheduled using standard Kubernetes scheduling mechanisms:
runtime:
enabled: true
nodeSelector:
kubernetes.io/os: linux
tolerations:
- key: "special-nodes"
operator: "Equal"
value: "true"
effect: "NoSchedule"
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/arch
operator: In
values:
- amd64
The information collected is sent to the RAD Security platform for further processing. For more information on the rad-runtime plugin, see the RAD Security documentation.
Ephemeral Storage
RAD Security plugins support optional ephemeral storage using Generic ephemeral volumes. By default, plugins use standard container ephemeral storage, but you can enable dedicated ephemeral volumes for improved performance and resource control.
Why Use Ephemeral Volumes?
Performance Benefits:
- High-performance storage classes: Use faster storage (NVMe, SSD) for improved I/O performance
- Dedicated storage: Avoid contention with other container processes sharing node storage
- Larger capacity: Allocate more space than default ephemeral storage limits
Resource Control:
- Predictable space: Guarantee specific storage capacity for each plugin
- Storage isolation: Prevent one plugin from affecting others' storage availability
- Node resource management: Better control over node storage usage
Basic Configuration
Enable ephemeral storage for any component by setting PLUGIN_NAME.ephemeralVolumes.enabled: true. If storageClassName is not set, the default StorageClass will be used.
sbom:
ephemeralVolumes:
enabled: true
size: 25Gi
storageClassName: "gp3"
accessModes:
- ReadWriteOnce
# Example: Basic setup for other plugins
# with default storage class and size
guard:
ephemeralVolumes:
enabled: true
Note: Ephemeral volumes are deleted when pods are terminated. They provide temporary, high-performance storage but do not persist data across pod restarts.
Pod Scheduling
All RAD Security plugins support standard Kubernetes scheduling mechanisms including nodeSelector, tolerations, and affinity. This allows you to control where pods are scheduled based on your cluster requirements.
Basic Example
# Apply to any plugin (guard, sbom, sync, watch, runtime, piiAnalyzer)
guard:
nodeSelector:
kubernetes.io/os: linux
tolerations:
- key: "example-key"
operator: "Equal"
value: "example-value"
effect: "NoSchedule"
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/arch
operator: In
values:
- amd64
Sampling configuration
High frequency events are sampled by default. This applies to HTTP and Open File events. Use the configuration below to change the default values.
runtime:
agent:
sampling:
enabled: true
minSamples: 10
maxSamples: 100
ratio: 5
ttl: "5m"
Prerequisites
The remainder of this page assumes the following:
- An Account in RAD Security already exists
- The user has obtained the
base64AccessKeyandbase64SecretKeyvalues required for the installation via the UI or the API - The user has kubectl installed
- The user has Helm v3 installed
- The user has kubectl admin access to the cluster
- The RAD Security pods have outbound port 443 access to
https://api.rad.security
Installing the Chart
1. Install cert-manager
cert-manager must be installed, as RAD Security deploys Admission Controllers that create certificates to secure their communication with the Kubernetes API. At present RAD Security only supports cert-manager as the means of creating these certificates.
You can check if cert-manager is installed using the command below:
kubectl get pods -A | grep cert-manager
If the command above returns no results, you must install cert-manager into your cluster using the following commands:
NOTE: It may take up to 2 minutes for the helm installcommand below to complete.
helm repo add jetstack https://charts.jetstack.io
helm repo update
helm install \
cert-manager jetstack/cert-manager \
--namespace cert-manager \
--create-namespace \
--version v1.19.2 \
--set installCRDs=true
A full list of available Helm values is oncert-manager's ArtifactHub page.
2. Verify cert-manager installation
Now we have installed cert-manager, we need to validate that it is running successfully. This can be achieved using the command below:
kubectl get pods -n cert-manager
You should see the following pods (with slightly different generated IDs at the end) with a status of Running:
NAME READY STATUS RESTARTS AGE
cert-manager-7dc9d6599-5fj6g 1/1 Running 0 1m
cert-manager-cainjector-757dd96b8b-hlqgp 1/1 Running 0 1m
cert-manager-webhook-854656c6ff-b4zqp 1/1 Running 0 1m
3. Configure RAD Security helm repository
To install the RAD Security plugins Helm chart, we need to configure access to the RAD Security helm repository using the commands below:
helm repo add rad-security https://charts.rad.security/stable
helm repo update
If you already had RAD Security's Helm chart installed, it is recommended to update it.
helm repo update rad-security
Verify the RAD Security plugins Helm chart has been installed:
helm search repo rad-security
Example output (chart version may differ):
helm search repo rad-security
NAME CHART VERSION APP VERSION DESCRIPTION
rad-security/rad-plugins 1.0.0 A Helm chart to run the RAD Security plugins
4. Create cluster-specific values file
Next, we need to create a values file called values.yaml with the following content that includes the base64AccessKeyId and base64SecretKey:
rad:
base64AccessKeyId: "YOURACCESSKEYID"
base64SecretKey: "YOURSECRETKEY"
clusterName: "please add a name here"
You can manually create the file or use values.yaml file downloaded from the RAD Security UI.
NOTE: Be sure to set the clusterName value with a descriptive name of the cluster where you will be installing RAD Security.
4.1 Recommended installation
By default, a secret is created as part of our Helm chart, which we use to securely connect to RAD Security. However, it is highly recommended that this secret is created outside of the helm installation and is just referenced in the Helm values.
The structure of the secret is as follows:
apiVersion: v1
kind: Secret
metadata:
name: rad-access-key
namespace: rad
data:
access-key-id: "Y
Deploy rad-plugins with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has rad-plugins 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 chartrad-plugins is pinned at v2.4.21 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