kube-enforcer-starboard

by deployment-aqua

Helm chartv6.2.5App 6.2Apache-2.0

A Helm chart for the Aqua KubeEnforcer Starboard

About this chart

Aqua KubeEnforcer Helm Charts

This page provides instructions for using Helm charts to configure and deploy the Aqua KubeEnforcer.

Contents

  • Aqua KubeEnforcer Helm Charts
    • Contents
    • Starboard
    • Prerequisites
      • Container registry credentials
      • Clone the GitHub repository with the charts
      • Configure TLS authentication between the KubeEnforcer and the API Server
    • Deploy the Helm chart
      • Deploy the KubeEnforcer with Starboard from the GitHub repository
      • Deploy the KubeEnforcer with Starboard from a Helm private repository
    • Configuration for discovery
    • Configuration for performing kube-bench scans
    • Configurable parameters
    • Issues and feedback

Starboard

Starboard is an Aqua Security open-source tool that increases the effectiveness of Kubernetes security. For this reason, Starboard is deployed by default when you deploy KubeEnforcers.

An important part of Kubernetes security is the evaluation of workload compliance results with respect to Kubernetes Assurance Policies, and preventing the deployment of non-compliant workloads; see Admission control for Kubernetes containers.

When Starboard is deployed, it assesses workload compliance throughout the lifecycle of the workloads. This enables the KubeEnforcer to:

  • Re-evaluate workload compliance during workload runtime, taking any workload and policy changes into account
  • Reflect the results of compliance evaluation in the Aqua UI at all times, not only when workloads are created

When Starboard is not deployed, the KubeEnforcer will check workloads for compliance only when the workloads are started.

Prerequisites

Container registry credentials

Link

Clone the GitHub repository with the charts

git clone https://github.com/aquasecurity/aqua-helm.git
cd aqua-helm/

Configure TLS authentication between the KubeEnforcer and the API Server

You need to enable TLS authentication from the API Server to the KubeEnforcer. Perform these steps:

Create TLS certificates which are signed by the local CA certificate. We will pass these certificates with a Helm command to enable TLS authentication between the KubeEnforcer and the API Server to receive events from the ValidatingWebhookConfiguration for Image Assurance functionality.

You can generate these certificates by executing the script:

./kube-enforcer-starboard/gen-certs.sh

You can also use your own certificates without generating new ones for TLS authentication. All you need is a root CA certificate, a certificate signed by a CA, and a certificate key.

You can optionally configure the certificates generated from the script above in the values.yaml file.

You need to encode the certificates into base64 for ca.crt, server.crt and server.key using this command:

cat <file-name> | base64 | tr -d '\n'

Provide the certificates previously obtained in the fields of the values.yaml file, as indicated here:

certsSecret:
  name: aqua-kube-enforcer-certs
  serverCertificate: "<server.crt>"
  serverKey: "<server.key>"

webhooks:
  caBundle: "<ca.crt>"

Optionally, you can provide these certificates in base64-encoded format as flags: a. certsSecret.serverCertificate="<base64_encoded_server.crt>" b. certsSecret.serverKey="<base64_encoded_server.key>" c. webhooks.caBundle="<base64_encoded_ca.crt>"

Deploy the Helm chart

Deploy the KubeEnforcer with Starboard from the GitHub repository

  1. Clone the GitHub repository with the charts:

    $ git clone -b 6.2 https://github.com/aquasecurity/kube-enforcer-starboard-helm.git
    
  2. (Optional) Update the Helm charts values.yaml file with your environment's custom values, registry secret, Aqua Server (console) credentials, and TLS certificates. This eliminates the need to pass the parameters to the Helm command. Then run one of the following commands to deploy the relevant services.

  3. Choose either 3a or 3b:

    3a. To deploy the KubeEnforcer on the same cluster as the Aqua Server (console), run this command on that cluster:

    $ helm upgrade --install --namespace aqua kube-enforcer-starboard ./kube-enforcer-starboard
    

    3b. Multi-cluster: To deploy the KubeEnforcer in a different cluster:

    First, create a namespace on that cluster named aqua:

    $ kubectl create namespace aqua
    

    Next, run the following command:

    $ helm upgrade --install --namespace aqua kube-enforcer-starboard ./kube-enforcer-starboard --set envs.gatewayAddress="<Aqua_Remote_Gateway_IP/URL>",imageCredentials.username=<registry-username>,imageCredentials.password=<registry-password>
    

Deploy the KubeEnforcer with Starboard from a Helm private repository

  1. Add Aqua Helm Repository

    $ helm repo add aqua-helm https://helm.aquasec.com
    
  2. (Optional) Update the Helm charts values.yaml file with your environment's custom values, registry secret, Aqua Server (console) credentials, and TLS certificates. This eliminates the need to pass the parameters to the Helm command. Then run one of the following commands to deploy the relevant services.

  3. Check for available chart versions either from Changelog or by running the below command

$ helm search repo aqua-helm/kube-enforcer-starboard --versions
  1. Choose either 4a or 4b:

    4a. To deploy the KubeEnforcer on the same cluster as the Aqua Server (console), run this command on that cluster:

    $ helm upgrade --install --namespace aqua kube-enforcer-starboard aqua-helm/kube-enforcer-starboard
    

    4b. Multi-cluster: To deploy the KubeEnforcer in a different cluster:

    First, create a namespace on that cluster named aqua:

    $ kubectl create namespace aqua
    

    Next, copy the content from Values.yaml, make the respective changes, and run the following command:

    $ helm upgrade --install --namespace aqua kube-enforcer-starboard aqua-helm/kube-enforcer-starboard --values values.yaml --version <>
    

Optional flags:

FlagDescription
--namespacedefaults to aqua
--aquaSecret.kubeEnforcerTokendefaults to ""; you can obtain the KubeEnforcer token from Aqua Enterprise under the Enforcers screen in the default/custom KubeEnforcer group, or you can manually approve KubeEnforcer authentication from Aqua Enterprise under the default/custom KubeEnforcer group in the Enforcers screen.

Configuration for discovery

To perform discovery on the cluster, the KubeEnforcer needs a dedicated ClusterRole with get, list, and watch permissions on pods, secrets, nodes, namespaces, deployments, ReplicaSets, ReplicationControllers, StatefulSets, DaemonSets, jobs, CronJobs, ClusterRoles, ClusterRoleBindings, and ComponentStatuses`.

Configuration for performing kube-bench scans

To perform kube-bench scans in the cluster, the KubeEnforcer needs:

  • A dedicated role in the aqua namespace with get, list, and watch permissions on pods/log
  • create and delete permissions on jobs

Configurable parameters

ParameterDescriptionDefaultMandatory
imageCredentials.createSet to create new pull image secrettrueYES - New cluster
imageCredentials.nameYour Docker pull image secret nameaqua-registry-secretYES - New cluster
imageCredentials.usernameYour Docker registry (Docker Hub, etc.) usernameN/AYES - New cluster
imageCredentials.passwordYour Docker registry (Docker Hub, etc.) passwordN/AYES - New cluster
platformOrchestration platform name (Allowed values are aks, eks, gke, openshift, tkg, tkgi, k8s, rancher, gs, k3s, mke)unsetYES, for openshift and mirantis platform
aquaSecret.kubeEnforcerTokenAqua KubeEnforcer (KE) tokenN/AYES
clusterNameCluster name registered with Aqua in Infrastructure tabN/ANO
certsSecret.createSet to create a new secret for KE certstrueYES
certsSecret.nameSecret name for KE certsaqua-kube-enforcer-certsYES
certsSecret.serverCertificateCertificate for TLS authentication with the Kubernetes api-serverN/AYES
certsSecret.serverKeyCertificate key for TLS authentication with the Kubernetes api-serverN/AYES
webhooks.caBundleRoot certificate for TLS authentication with the Kubernetes api-serverN/AYES
envs.gatewayAddressGateway host addressaqua-gateway-svc:8443YES
starboard.serviceAccount.nameStarboard service accountstarboard-operatorYES
starboard.clusterRoleBinding.nameStarboard cluster binding namestarboard-operatorYES
starboard.clusterRole.nameStarboard cluster role namestarboard-operatorYES
starboard.image.repositoryUriPrefixStarboard image repository URIdocker.io/aquasecYES
starboard.image.repositoryStarboard image namestarboard-operatorYES
starboard.tagStarboard image tag0.10.1YES
starboard.OPERATOR_TARGET_NAMESPACESThis determines the installation mode, which in turn determines the multi-tenancy support of the operator(blank)YES (blank string)=> ALLNAMESPACES, foo,bar.baz => specific NAMESPACES
starboard.OPERATOR_LOG_DEV_MODEThe flag to use (or not use) development mode (more human-readable output, extra stack traces and logging information, etc.)falseYES
starboard.OPERATOR_CONCURRENT_SCAN_JOBS_LIMITThe maximum number of scan jobs create by the operator10YES
starboard.OPERATOR_SCAN_JOB_RETRY_AFTERThe time to wait before retrying a failed scan job30sYES
starboard.OPERATOR_METRICS_BIND_ADDRESSThe TCP address to bind to for serving Prometheus metrics. It can be set to 0 to disable the metrics serving.:8080YES
starboard.OPERATOR_HEALTH_PROBE_BIND_ADDRESSThe TCP address to bind to for serving health probes, i.e., the /healthz/ and /readyz/ endpoints:9090true
starboard.OPERATOR_CIS_KUBERNETES_BENCHMARK_ENABLEDThe flag to enable CIS Kubernetes Benchmark scanningtrueYES
starboard.OPERATOR_VULNERABILITY_SCANNER_ENABLEDThe flag to enable vulnerability scannertrueYES
starboard.OPERATOR_BATCH_DELETE_LIMITThe maximum number of config audit reports deleted by the operator when the plugin's config has changed10YES
starboard.OPERATOR_BATCH_DELETE_DELAYThe time to wait before deleting another batch of config audit reports10sYES
starboard.ports.metricContainerPort
starboard.ports.probeCntainerPort
starboard.readinessProbe
starboard.livenessProbe
kubeEnforcerAdvance.enableAdvanced KubeEnforcer deploymentfalseNO
kubeEnforcerAdvance.nodeIDEnvoy Node ID of the advance KE deploymentenvoyYES - if kubeEnforcerAdvance.enable
nodeSelectorKubernetes node selector{}NO
tolerationsKubernetes node tolerations[]NO
podAnnotationsKubernetes pod annotations{}NO
affinityKubernetes node affinity{}NO

Issues and feedback

If you encounter any problems or would like to give us feedback on this deployment, we encourage you to raise issues here on GitHub.

Deploy kube-enforcer-starboard with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has kube-enforcer-starboard 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 chartkube-enforcer-starboard is pinned at v6.2.5 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