stackrox-secured-cluster-services

by StackRox

Helm chartv500.0.0App 5.0.0Verified publisher

Helm Chart for StackRox Secured Clusters

About this chart

StackRox Kubernetes Security Platform - Secured Cluster Services Helm Chart

This Helm chart allows you to deploy the necessary services on a StackRox secured cluster: StackRox Sensor, StackRox Collector, and StackRox Admission Control. It also deploys StackRox Scanner V4 by default.

If you want to install Secured Cluster Services for Red Hat Advanced Cluster Security, refer to Installing the secured-cluster-services Helm chart.

Prerequisites

To deploy the secured cluster services for the StackRox Kubernetes Security Platform, you must:

  • Have at least version 3.1 of the Helm tool installed on your machine

IMPORTANT

We publish new Helm charts with every new release of the StackRox Kubernetes Security Platform. Make sure to use a version of this chart that matches the StackRox Kubernetes Security Platform version you have installed.

Add the canonical chart location as a Helm repository

The canonical repository for StackRox Helm charts is https://raw.githubusercontent.com/stackrox/helm-charts/main/opensource/. To use StackRox Helm charts, run the following command:

helm repo add stackrox https://raw.githubusercontent.com/stackrox/helm-charts/main/opensource/

Only run this command once per machine on which you want to use StackRox Helm charts.

Before you deploy or upgrade a chart from a remote repository, you must run the following command:

helm repo update

Install Secured Cluster Services

Installing a new StackRox secured cluster requires a cluster init bundle. You can generate a cluster init bundle by using the roxctl CLI or the StackRox portal. You can use the same bundle to set up multiple StackRox secured clusters by providing it as an input to the helm install command.

NOTE:

  • The following sections assume that you have a safe way to pass secrets to the helm command.
  • If not, you can decouple secret creation from installing or upgrading the Helm chart, see Deployment with pre-created secrets for more information.

Generate cluster init bundle

NOTE: Beginning with StackRox/ACS 4.6 there exists a modern alternative to init bundles which goes by the name of cluster registration secrets (or 'CRS' for short) and will at some point replace init bundles entirely. Cluster registration secrets and init bundles differ in their specific usage semantics, please consult the RHACS documentation for details.

Feel free to skip this section and continue with the next one ("Generate cluster registration secret (CRS)") if you want to try out the new CRS-style of bootstrapping a new secured cluster.

In any case, you only need an init bundle or a CRS, not both.

Run the following command to generate a cluster init bundle:

roxctl central init-bundles generate <cluster init bundle name> --output cluster-init-bundle.yaml
  • This command creates a cluster init bundle called cluster-init-bundle.yaml.
  • Make sure that you store this bundle securely as it contains secrets. You can use the same bundle to set up multiple StackRox secured clusters.

Generate cluster registration secret (CRS)

NOTE: Skip this section if you have already created an init bundle. You only need an init bundle or a CRS, not both.

Run the following command to generate a cluster registration secret:

roxctl central crs generate <CRS name> --output crs.yaml
  • This command creates a cluster registration secret and stores it in the file crs.yaml.
  • Make sure that you store this file securely as it contains secrets. You can use the same CRS to set up multiple StackRox secured clusters.

Deploy Secured Cluster Services

You can use the following command to deploy secured cluster services using this Helm chart:

helm install -n stackrox --create-namespace \
    stackrox-secured-cluster-services stackrox/stackrox-secured-cluster-services \
    [ -f <path to cluster-init-bundle.yaml> | --set-file crs.file=<path to crs.yaml> ] \
    --set clusterName=<name of the secured cluster> \
    --set centralEndpoint=<endpoint of Central service>
  • In this command, you can replace the chart name stackrox/stackrox-secured-cluster-services with the chart's file path if you have it locally.
  • The provided cluster name can either denote the intended name for a new secured cluster or the name of an existing cluster, in which case the name will be reused and associated with the Kubernetes cluster on which the chart is installed.

After you deploy the StackRox Kubernetes Security Platform Secured Cluster Services using the helm install command, you will see informative notes and warnings related to the installation. The new cluster automatically registers itself to StackRox Central, and is visible in the StackRox portal as a Helm-managed cluster. If the provided cluster name is already associated with an existing secured cluster, the name will be reused and associated with the cluster on which the chart is installed.

In case you use image mirroring or otherwise access StackRox container images from non-standard location, you may also need to provide image pull credentials. There are several ways to inject the required credentials (if any) into the installation process:

  • Explicitly specify username and password: Use this if you are using a registry that supports username/password authentication. Pass the following arguments to the helm install command:
    --set imagePullSecrets.username=<registry username> --set imagePullSecrets.password=<registry password>
    
  • Use pre-existing image pull secrets: If you already have one or several image pull secrets created in the namespace to which you are deploying, you can reference these in the following way (we assume that your secrets are called pull-secret-1 and pull-secret-2):
    --set imagePullSecrets.useExisting="pull-secret-1;pull-secret-2"
    
  • Do not use image pull secrets: If you are pulling your images from quay.io/stackrox-io or a registry in a private network that does not require authentication, or if the default service account in the namespace to which you are deploying is already configured with appropriate image pull secrets, you do not need to specify any additional image pull secrets.

Applying custom configuration options

The secured cluster services Helm chart has many different configuration options. You can directly specify these options when you run the helm install command for simple use cases.

However, we recommend storing your configuration in a file and using that file for future upgrades or reconfiguration using the helm upgrade command.

Specifying options with --set parameter

You can use the --set and --set-file parameter with the helm install command to specify various options to customize deployments quickly. However, don't use them for specifying complex configurations.

For example,

  • Configure cluster environment:
    --set env.openshift=true
    

Using configuration YAML files and the -f command-line option

We recommended that you store all custom configuration options in persisted files.

The Secured Cluster Services Helm chart contains example configuration files (called values-public.yaml.example and values-private.yaml.example), that list all the available configuration options, along with documentation.

Furthermore, the files values-public-scanner-v4.yaml.example and values-private-scanner-v4.yaml.example list the most commonly used configuration options for Scanner V4.

The following sample configuration file (secured-cluster.yaml) uses a few of the options which you can configure:

  • values-public.yaml:
    clusterName: "acme-cluster-01"
    centralEndpoint: "central.acme-labs.internal"
    
    sensor:
      # Use custom resource overrides for sensor
      resources:
        requests:
          cpu: "2"
          memory: "4Gi"
        limits:
          cpu: "4"
          memory: "8Gi"
    
    admissionControl:
      dynamic:
        disableBypass: true # Disable bypassing of Admission Controller
    
    customize:
      # Apply the important-service=true label for all objects managed by this chart.
      labels:
        important-service: true
      # Set the CLUSTER=important-cluster environment variable for all containers in the
      # collector deployment:
      collector:
        envVars:
          CLUSTER: important-cluster
    
  • values-private.yaml:
    imagePullSecrets:
      username: <username for StackRox image registry>
      password: <password for StackRox image registry>
    

After you have created these YAML files, you can inject the configuration options into the installation process via the -f flag, i.e., by appending the following options to the helm install invocation:

helm install ... -f values-public.yaml -f values-private.yaml

Changing configuration options after deployment

To make changes to the configuration of an existing deployment of the StackRox Secured Cluster Services:

  1. Change the configuration options in your YAML configuration file(s).
  2. Use the -f option and specify the configuration file's path when you run the helm upgrade command.

For example, to apply configuration changes for the secured cluster, use the following command:

helm upgrade -n stackrox \
    stackrox-secured-cluster-services stackrox/stackrox-secured-cluster-services \
    --reuse-values \
    -f values-public.yaml \
    -f values-private.yaml

You can also specify configuration values using the --set or --set-file parameters. However, these options aren't saved, and you'll have to specify all the options again manually.

Changing cluster name after deployment

To change the name of the cluster shown in the StackRox portal, you must specify values for both the --clusterName and the --confirmNewClusterName options:

helm upgrade -n stackrox stackrox-secured-cluster-services --clusterName=<new-cluster-name> --confirmNewClusterName=<new-cluster-name>

NOTE:

When you change the cluster name:

  • The StackRox Kubernetes Security Platform either creates a new cluster or reuses an existing cluster if a cluster with the same name already exists.
  • The StackRox Kubernetes Security Platform doesn't rename the old cluster. The old cluster still shows up in the StackRox portal, but it doesn't receive any data. You must remove the old cluster if you don't want to see it in the StackRox portal.

Configuration

The following table lists some common configuration parameters of this Helm chart and their default values:

ParameterDescriptionDefault value
clusterNameName of your cluster.
confirmNewClusterNameYou don't need to change this unless you upgrade and change the value for clusterName. In this case, set it to the new value of clusterName. This option exists to prevent you from accidentally creating a new cluster with a different name.null
centralEndpointAddress of the Central endpoint, including the port number (without a trailing slash). If you are using a non-gRPC capable LoadBalancer, use the WebSocket protocol by prefixing the endpoint address with wss://.central.stackrox.svc:443
clusterLabelsCustom labels associated with a secured cluster. Must be a dictionary where both keys and values are strings.{}
additionalCAsUse it to add (named) PEM-encoded CA certificates for Sensor.{}
imagePullSecrets.usernameSpecify username for accessing image registry.null
imagePullSecrets.passwordSpecify password for accessing image registry.null
imagePullSecrets.useExistingSpecify existing Kubernetes image pull secrets that should be used for trying to pull StackRox images.[]
imagePullSecrets.useFromDefaultServiceAccountThis setting controls whether image pull secrets from a default service account in the target namespace should be used for image pulls.true
imagePullSecrets.allowNoneEnabling this setting indicates that no image pull secrets are required to be configured upon initial deployment. Use this setting if you are using a cluster-private registry that does not require authentication.false
image.main.nameRepository from which to download the main image.main
image.collector.nameRepository from which to download the collector image.collector
image.main.registryAddress of the registry you are using for main image.quay.io/stackrox-io
image.collector.registryAddress of the registry you are using for collector image.quay.io/stackrox-io
sensor.endpointAddress of the Sensor endpoint including port number. No trailing slash.sensor.stackrox.svc:443
collector.forceCollectionMethodDeprecated. This value has no effect.false
collector.collectionMethodEither CORE_BPF, or NO_COLLECTION.CORE_BPF
collector.disableTaintTolerationsIf you specify false, tolerations are applied to collector, and the collector pods can schedule onto all nodes with taints. If you specify it as true, no tolerations are applied, and the collector pods won't scheduled onto nodes with taints.false
admissionControl.enforceThis setting controls whether the admission controller enforces security policies that have been configured for enforcement in StackRox Kubernetes Security Platform.true
admissionControl.failurePolicyThis setting controls the failure policy for the ValidatingWebhookConfiguration. Can be "Ignore" or "Fail"."Ignore"
admissionControl.dynamic.disableBypassSet it to true to disable [bypassing the admissio

Deploy stackrox-secured-cluster-services with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has stackrox-secured-cluster-services 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 chartstackrox-secured-cluster-services is pinned at v500.0.0 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