krci-security-operator

by sergk

Helm chartv0.4.0-SNAPSHOT.4App 0.4.0-SNAPSHOT.4Apache-2.0Verified publisher

A Helm chart for the KubeRocketCI Security Operator

About this chart

krci-security-operator

A Helm chart for the KubeRocketCI Security Operator

Homepage: https://docs.kuberocketci.io/

Introduction

KubeRocketCI Security Operator runs the security integrations of a cluster, one module per integration. The first module imports Trivy Operator reports (VulnerabilityReport, ExposedSecretReport) into the DefectDojo of the cluster. One instance runs per cluster with cluster-wide read-only access and writes only to DefectDojo.

Prerequisites

  • Trivy Operator is installed in the cluster and produces the reports.

  • DefectDojo is reachable from the operator pod.

  • DefectDojo 3.5.200 or later. Earlier versions may work but are not tested.

  • A Secret in the release namespace holds the DefectDojo address and API token under the keys url and token. Its name is set in defectdojo.secretName. Token options and the recommended least-privilege setup: DefectDojo API token.

    kubectl create secret generic defectdojo-credentials -n <namespace> \
      --from-literal=url=https://defectdojo.example.com \
      --from-literal=token=<api-token>
    

Deploy with Helm

  1. Add the Helm EPAMEDP Charts repository:

    helm repo add epamedp https://epam.github.io/edp-helm-charts/stable
    
  2. Choose an available chart version:

    helm search repo epamedp/krci-security-operator -l
    

    NOTE: It is highly recommended to use the latest released version.

  3. Install the operator:

    helm install krci-security-operator epamedp/krci-security-operator --version <chart_version> -n <namespace>
    
  4. Check that the pod of the operator is running.

Maintainers

NameEmailUrl
epmd-edp[email protected]https://solutionshub.epam.com/solution/kuberocketci

Source Code

Values

KeyTypeDefaultDescription
affinityobject{}Affinity for pod assignment
annotationsobject{}Annotations to add to the deployment
clusterNamestring""Required, no default. Unique name of this cluster in the DefectDojo: a lowercase RFC 1123 DNS label. Every namespace product is named <clusterName>/<namespace>, and the operator closes only the tests of its own cluster
componentPrefixeslist["in-cluster-"]Prefixes stripped from the Argo CD application name when the component tag is derived
concurrencyint2Number of namespaces reconciled in parallel
defectdojo.productTypestring"KubeRocketCI"DefectDojo Product Type of the namespace products. Use one value for every operator that writes to the same DefectDojo; a product that exists under another Product Type fails its reimports
defectdojo.secretNamestring"defectdojo-credentials"Secret in the release namespace with the keys url and token of the cluster's DefectDojo. The operator reads it at runtime and never writes it
excludeNamespaceslist[]Glob patterns of namespaces that are skipped
extraVolumeMountslist[]Additional volume mounts to add to the manager container
extraVolumeslist[]Additional volumes to add to the manager pod
image.registrystring""krci-security-operator image registry. Leave empty to use the repository as-is (Docker Hub by default)
image.repositorystring"epamedp/krci-security-operator"krci-security-operator Docker image name. The released image can be found on Dockerhub
image.tagstringnilkrci-security-operator Docker image tag. The released image can be found on Dockerhub. If not defined then .Chart.AppVersion is used
imagePullPolicystring"IfNotPresent"Image pull policy
imagePullSecretslist[]Optional array of imagePullSecrets containing private registry credentials # Ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry
labelTags.namespacelist[]Keys of Namespace labels that are copied into tags <key>:<value> of the namespace product, for example app.edp.epam.com/tenant. Each key must be a valid Kubernetes label key of at most 191 characters, so that its tag fits 255 characters with a label value of 63 characters. A key that breaks this, a repeated key, keys that differ in case only, and a key whose tag key the operator writes itself (k8s-cluster, k8s-namespace, k8s-workload, k8s-container, oci-image, app, report-kind) stop the operator at start. The operator owns the product tags of the listed keys: it corrects and removes them, and keeps every other tag. Empty copies none
labelTags.workloadlist[]Keys of workload labels that are copied into tags <key>:<value> of the tests of the workload. A label is read from the Deployment, StatefulSet, DaemonSet or CronJob, from a Job that has no CronJob, or from a Pod, the object the app tag is read from; a ReplicaSet without a Deployment has none. The key rules are those of labelTags.namespace. A change of the list uploads once every test whose tags change. Empty copies none
metrics.enabledboolfalseServe the Prometheus metrics of the manager over plain HTTP on metrics.port of the pod. The chart creates no Service for them
metrics.portint8080Container port of the metrics endpoint
namestring"krci-security-operator"component name
nodeSelectorobject{}Node labels for pod assignment
podSecurityContextobject{"runAsNonRoot":true,"seccompProfile":{"type":"RuntimeDefault"}}Pod-level security context # Ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
reportKindslist["VulnerabilityReport","ExposedSecretReport"]Trivy Operator report kinds to import. Supported: VulnerabilityReport, ExposedSecretReport. The tests of a kind the cluster does not serve stay open; remove the kind to close them
resourcesobject{"limits":{"memory":"512Mi"},"requests":{"cpu":"50m","memory":"128Mi"}}Resource requests/limits for the manager container. Memory scales with concurrency multiplied by one page of 10 full Trivy reports (a report can reach 3 MB), plus the metadata of all reports in the cluster, plus the names, container names, image references, components and label tags of the workloads of a namespace (read 500 at a time) and the metadata of the reports of one kind of a namespace: raise the memory limit when concurrency, the report sizes or the number of workloads grow. # Ref: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
resyncPeriodstring"30m"Interval of the periodic re-check of every namespace (Go duration, at least 1m)
securityContextobject{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"readOnlyRootFilesystem":true}Container-level security context # Ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
tolerationslist[]Tolerations for pod assignment

Deploy krci-security-operator with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has krci-security-operator 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 chartkrci-security-operator is pinned at v0.4.0-SNAPSHOT.4 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