open-appsec-injector

by Startechnica

Helm chartv1.1.2App 1.1.34Verified publisher

A Helm chart for deploying open-appsec mutating webhook to inject a sidecar container.

About this chart

OpenAppSec WAF Injector – Helm Chart for Kubernetes

A Kubernetes Helm chart for deploying the OpenAppSec WAF Injector, which automatically injects the OpenAppSec security agent into pods using a Mutating Admission Webhook.

This chart manages:

  • Mutating admission webhook (Deployment + Service + MWC + RBAC) — the active path that injects the agent sidecar on pod creation.
  • Optional learning / storage / tuning data-plane components — internal services the injected agents talk to.
  • Optional CrowdSec integration for threat-IP feed consumption.
  • Optional custom Fog (Check Point Infinity) endpoint override.
  • Per-component NetworkPolicies (opt-in via <component>.networkPolicy.enabled).
  • Optional PodDisruptionBudget for the webhook (webhook.pdb.enabled).
  • Pre-built default policy presets (defaultConfigurations.mode = detect-learn | prevent-learn | prevent) for both cluster-scoped and namespaced CRD flavors.

CRDs are shipped by the sister chart open-appsec-crd and bundled with this chart by default (crds.enabled=true). Set crds.enabled=false if you'd rather manage the schema lifecycle separately via helm install open-appsec-crd startechnica/open-appsec-crd.

[!NOTE] This repository was inspired by open-appsec-injector

Architecture Overview

Prerequisites

  • Kubernetes 1.25+ (per Chart.yaml kubeVersion)
  • Helm 3.10.0+
  • An Istio Gateway deployment to attach the agent to (see Tested versions below for the exact Istio/Envoy matrix this chart has been validated against).
  • CRDs from the sister chart open-appsec-crd. Bundled by default (crds.enabled=true); set crds.enabled=false if you'd rather manage the schema lifecycle separately via helm install open-appsec-crd startechnica/open-appsec-crd.

Tested versions

This chart has been validated against the following Istio releases:

ComponentVersions verified
Istio Gateway1.26.8, 1.27.9, 1.28.6

Other Istio versions in the same minor lines are expected to work but have not been exercised end-to-end — file an issue if you hit a regression on a build outside this matrix.

Why these versions matter (compatibility chain)

The open-appsec runtime is bound to a specific Istio range, and that range is governed by the version of Envoy that Istio ships. The dependency chain is one-way:

open-appsec app version (Chart.yaml appVersion)
     │
     ▼  attaches at runtime via webhook.istioIngressGatewayAttachmentLibrary
     │  (a native .so that the Istio proxy dlopen()s)
     ▼
Envoy proxy build embedded in the Istio gateway
     │
     ▼  is shipped as part of
     ▼
Istio release line (1.26.x / 1.27.x / 1.28.x …)

What that means in practice:

  1. The attachment library is compiled against a specific Envoy ABI. Each open-appsec image release (appVersion: 1.1.34 here) ships a /usr/lib/attachment .so that targets a particular Envoy SDK version. Loading that .so into an Envoy build with an incompatible ABI either silently misbehaves or crashes the proxy on first request.

  2. Envoy is part of Istio, not a separate dial. You don't pick the Envoy version on an Istio install; Istio bakes one in. Upgrading Istio implicitly upgrades Envoy, which implicitly changes the ABI the attachment sees.

  3. So the verified Istio matrix above defines the supported Envoy range for this appVersion, and the appVersion is what determines which Istio range is supported. Upgrading any one of the three without verifying the other two is how you get hard-to-diagnose admission failures or proxy crashes after a rolling restart.

Upgrade rule of thumb: bump the chart's appVersion and the Istio release together, and keep a staging environment one step ahead of production so ABI surprises surface before they reach load.

Installing the Chart

Add the repo:

helm repo add startechnica https://startechnica.github.io/apps
helm repo update

Default — bundled CRDs (one-shot)

The injector chart pulls in open-appsec-crd as a subchart by default. One command installs both the schema and the application:

helm install open-appsec-injector startechnica/open-appsec-injector \
  --set kind=istio \
  --set agent.userEmail=<your-email-address> \
  --set agent.agentToken=<agent-token-from-UI> \
  --namespace istio-ingress \
  --create-namespace

Advanced — decoupled CRD lifecycle

If multiple injector releases will share one set of CRDs, or you want to upgrade the schema independently of the application, install the sister chart once cluster-wide and disable the bundled subchart on each injector release:

# Step 1 — one-time cluster-wide
helm install open-appsec-crd startechnica/open-appsec-crd

# Step 2 — each injector release
helm install open-appsec-injector startechnica/open-appsec-injector \
  --set crds.enabled=false \
  --set kind=istio \
  --set agent.userEmail=<your-email-address> \
  --set agent.agentToken=<agent-token-from-UI> \
  --namespace istio-ingress \
  --create-namespace

The CRDs carry helm.sh/resource-policy: keep either way, so they survive helm uninstall.

Tip: List all releases using helm list -A.

Enable open-appsec Injection to the existing deployment

To allow open-appsec to inspect the traffic through your existing Istio Ingress or Kong gateway, it must be attached to the existing deployment. This happens automatically if the proper labels are set and the deployment is restarted.

  1. Label the Namespace -- Add the inject-waf-attachment=true label to the namespace of your existing reverse proxy deployment (e.g. Istio Ingress Gateway or Kong):
kubectl label namespace istio-ingress inject-waf-attachment="true" --overwrite
  1. Label the Deployment -- Ensure your current reverse proxy deployment has the required labels set as configured in agent.objectSelector:
agent:
  objectSelector:
    matchLabels:
      gateway.networking.k8s.io/gateway-name: istio-ingress

(These labels must match what’s configured in the open-appsec Helm chart. Refer to your Helm values or the section above for details.)

  1. Restart the existing reverse proxy deployment -- Restart your existing deployment by using the following command:
kubectl rollout restart deployment istio-ingress -n istio-ingress

Uninstalling the Chart

To uninstall/delete the open-appsec-injector deployment:

helm delete open-appsec-injector --namespace istio-ingress

The command removes all the Kubernetes components associated with the chart and deletes the release.

CrowdSec Integration (Optional)

OpenAppSec can consult CrowdSec for malicious IP decisions.

crowdSec:
  enabled: true
  mode: prevent
  logging: enabled
  api:
    url: http://crowdsec-service:8080/v1/decisions/stream
  auth:
    method: apikey
    data: "00000000000000000000000000000000"

Custom Fog Endpoint (Optional)

Use this when connecting to a dedicated Fog service.

customFog:
  enabled: true
  fogAddress: "https://inext-agents.cloud.ngen.checkpoint.com/"

If disabled, the agent will use OpenAppSec default cloud endpoints.

Examples

Install with custom Fog & CrowdSec enabled

helm install open-appsec-injector startechnica/open-appsec-injector \
  --set customFog.enabled=true \
  --set customFog.fogAddress="https://inext-agents.cloud.ngen.checkpoint.com" \
  --set crowdSec.enabled=true \
  --set crowdSec.auth.data="myapikey"

Install with the tuning component + external PostgreSQL

helm install open-appsec-injector startechnica/open-appsec-injector \
  --set appsec.tuning.enabled=true \
  --set externalDatabase.host=postgres.example.com \
  --set externalDatabase.existingSecret=tuning-db-creds

The external server must allow connecting to the DB name i2datatubeschemasecurityeventlogsv03 — the upstream smartsync-tuning binary hardcodes that name in its connection URL (datatube.go), so the chart cannot override it. Pre-create the database on the managed instance, or use the bundled subchart, which auto-creates it.

Production posture (PDB + NetworkPolicies + tightened RBAC)

helm install open-appsec-injector startechnica/open-appsec-injector \
  --set webhook.replicaCount=2 \
  --set webhook.pdb.enabled=true \
  --set webhook.networkPolicy.enabled=true \
  --set appsec.learning.networkPolicy.enabled=true \
  --set appsec.storage.networkPolicy.enabled=true \
  --set allowedNamespaces='{istio-ingress,kong}'

Testing

Render templates locally without installing:

helm template open-appsec-injector startechnica/open-appsec-injector

Verify the MutatingWebhookConfiguration is registered:

kubectl get mutatingwebhookconfiguration

Troubleshooting

The post-install NOTES.txt (printed at the end of helm install/helm upgrade) carries the canonical "what to check next" walkthrough. The most common failures:

Webhook TLS error: x509: certificate signed by unknown authority

The container's secretgen.py generates a CA at startup and PATCHes the MutatingWebhookConfiguration's caBundle via the K8s API. If the patch failed (RBAC denied, API throttled), the MWC's caBundle stays empty and admission calls fail.

# Check whether the patch landed (default name: openappsec-waf.injector.cp)
kubectl get mutatingwebhookconfiguration <webhook-name> \
  -o jsonpath='{.webhooks[0].clientConfig.caBundle}' | head -c 32

# If empty, inspect the webhook pod logs for cert-gen errors
kubectl logs deployment/<webhook-fullname> -n <release-ns>

# Last resort — delete the MWC and let helm re-create it on next upgrade
kubectl delete mutatingwebhookconfiguration <webhook-name>

MountVolume.SetUp failed on agent pods

agent.persistence is enabled but no PV is available. Either set agent.persistence.config.storageClass / agent.persistence.data.storageClass to a class that has a provisioner, or supply agent.persistence.{config,data}.existingClaim pointing at pre-created PVCs.

Tuning pod in CrashLoopBackOff

appsec.tuning.enabled=true but no database is configured. Either enable the bundled subchart with --set postgresql.enabled=true, or point at an external PostgreSQL via the top-level externalDatabase.host (plus optional externalDatabase.existingSecret / externalDatabase.existingSecretPasswordKey). Templates fail-fast at render time if neither connection path is configured. The DB name is not chart-configurable — upstream hardcodes i2datatubeschemasecurityeventlogsv03, so external servers must already host (or allow auto-creating) a database by that name.

Parameters

Global parameters

NameDescriptionValue
global.imageRegistryGlobal Docker image registry""
global.imagePullSecretsGlobal Docker registry secret names as an array[]
global.defaultStorageClassGlobal default StorageClass for Persistent Volume(s)""
global.compatibility.openshift.adaptSecurityContextAdapt the securityContext sections of the deployment to make them compatible with Openshift restricted-v2 SCC: remove runAsUser, runAsGroup and fsGroup and let the platform use their allowed default IDs. Possible values: auto (apply if the detected running cluster is Openshift), force (perform the adaptation always), disabled (do not perform adaptation)auto
global.compatibility.omitEmptySeLinuxOptionsIf set to true, removes the seLinuxOptions from the securityContexts when it is set to an empty object

Deploy open-appsec-injector with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has open-appsec-injector 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 chartopen-appsec-injector is pinned at v1.1.2 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