defensia-agent

by Defensia

Helm chartv0.7.1App 1.4.107Verified publisher

Defensia security agent — SSH protection, WAF, bot detection, CVE scanning, and K8s-native monitoring

About this chart

Defensia Agent — Helm Chart

Deploy the Defensia security agent as a DaemonSet on your Kubernetes cluster. Each node gets an agent that provides brute-force protection, WAF, bot detection, vulnerability scanning, malware scanning, and real-time firewall management.

Prerequisites

  • Kubernetes 1.22+
  • Helm 3+
  • A Defensia account and your organization API key from defensia.cloud (one multi-use key registers every node; single-use install tokens do not work here)

Install

helm install defensia-agent oci://ghcr.io/defensia/charts/defensia-agent \
  --set apiKey="YOUR_API_KEY"

Upgrade

helm upgrade defensia-agent oci://ghcr.io/defensia/charts/defensia-agent \
  --version 0.6.1

Installing without a key

The key is optional. Installed without one, the agent runs but stays unconnected, and connects by itself once a Secret with the key appears — no restart, no reinstall:

helm install defensia-agent oci://ghcr.io/defensia/charts/defensia-agent \
  --namespace defensia --create-namespace

# later, when you have the key
kubectl -n defensia create secret generic defensia-agent \
  --from-literal=api-key=YOUR_API_KEY --dry-run=client -o yaml | kubectl apply -f -

This is what makes the chart installable from a catalogue that cannot pass a secret at install time, such as the DigitalOcean Marketplace, or from a GitOps repo where the key lives in a sealed Secret applied separately.

A wrong key behaves the same way: the agent reports it, idles, and picks up a corrected Secret on its own. It never crash-loops over a credential.

Container runtime sockets

Docker's socket is not mounted by default. Managed Kubernetes (DOKS, GKE, EKS) runs containerd, and mounting a socket that is not there makes kubelet create a directory in its place on every node — one that survives helm uninstall. Enable it only on a cluster that really runs Docker:

--set dockerSocket.enabled=true

Uninstall

helm uninstall defensia-agent

Configuration

ParameterDescriptionDefault
apiKeyOrganization API key from the Defensia panel"" (optional — see Installing without a key)
existingSecretExisting Secret holding the API key, instead of apiKey""
existingSecretKeyKey inside existingSecretapi-key
serverUrlDefensia panel URLhttps://defensia.cloud
clusterNameCluster name shown in the panel (CLUSTER_NAME)""
image.repositoryContainer imageghcr.io/defensia/agent
image.tagImage tag (defaults to chart appVersion)""
image.pullPolicyImage pull policyAlways
autoUpdate.enabledAgent patches its own DaemonSet for rolling updates. Disable if using GitOps (ArgoCD, Flux).true
ingressFirewall.enabledCreate nginx-ingress RBAC for ConfigMap-level IP blocking. Disable if not using nginx-ingress.false
ingressFirewall.namespaceNamespace where nginx-ingress runsingress-nginx
ingressFirewall.configMapNamenginx-ingress ConfigMap nameingress-nginx-controller
resources.limits.cpuCPU limit500m
resources.limits.memoryMemory limit256Mi
resources.requests.cpuCPU request50m
resources.requests.memoryMemory request64Mi
tolerationsNode tolerations[{operator: Exists}] (all nodes)
nodeSelectorNode selector{}
priorityClassNamePriority class""
extraEnvAdditional environment variables[]
serviceAccount.createCreate service accounttrue
serviceAccount.nameService account name override""
serviceAccount.annotationsService account annotations{}

GitOps / ArgoCD setup

If you manage deployments via ArgoCD or Flux, disable the built-in auto-update to avoid conflicts:

autoUpdate:
  enabled: false

The agent will not modify K8s resources. You control updates by bumping the image tag in your GitOps repo.

Traefik / non-nginx ingress

The chart works with any ingress controller. By default, no nginx-specific RBAC is created. IP blocking works at the iptables/host level regardless of ingress controller.

If you use Traefik, enable access logs so the agent can detect web attacks:

# In your Traefik Helm values
logs:
  access:
    enabled: true

Extra environment variables

extraEnv:
  - name: WEB_LOG_PATH
    value: "/var/log/nginx/access.log"
  - name: GEOIP_DB_PATH
    value: "/usr/share/GeoIP/GeoLite2-Country.mmdb"
  - name: DISABLE_K8S_AUTO_UPDATE
    value: "true"

What gets deployed

  • DaemonSet: One agent pod per node (including control-plane via tolerations)
  • ServiceAccount + ClusterRole + ClusterRoleBinding: Read-only K8s API access (pods, nodes, events, ingresses, networkpolicies) + DaemonSet patch for auto-updates
  • Secret: Stores the API key
  • Role + RoleBinding (optional): Only when ingressFirewall.enabled: true — grants ConfigMap write access in the ingress namespace

Host mounts

MountPathMode
Logs/var/logread-only
Docker socket/var/run/docker.sockread-only
Containerd socket/run/containerd/containerd.sockread-only, off by default

The containerd socket is not mounted unless you ask for it with containerdSocket.enabled=true, because nothing in the agent reads it yet. It is mounted with type: Socket, which requires the path to exist, and the default path is containerd's upstream one — k3s uses /run/k3s/containerd/containerd.sock, and RKE2, MicroK8s and CRI-O differ again. Mounting it on a cluster that keeps the socket elsewhere leaves the pod in ContainerCreating indefinitely. | Agent config | /etc/defensia | read-write (keeps the node registered across pod restarts) |

Agent capabilities

  • SSH brute-force detection and auto-banning via iptables/ipset
  • Web attack detection (SQL injection, XSS, path traversal, RCE, SSRF)
  • Log parsing: nginx, Apache, Traefik (JSON), Caddy, LiteSpeed, uvicorn, gunicorn
  • Country-based geoblocking (MaxMind GeoLite2)
  • Bot fingerprint detection with configurable actions
  • Malware scanning with real-time progress (YARA, signature matching, heuristics)
  • CVE advisory matching (NVD, CISA KEV, Exploit-DB)
  • System metrics (CPU, memory, disk, load, network I/O)
  • Kubernetes: pod inventory, NetworkPolicy audit, event monitoring
  • Real-time firewall rule management via WebSocket
  • Auto-update with SHA256 verification and crash-loop recovery

Links

Deploy defensia-agent with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has defensia-agent 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 chartdefensia-agent is pinned at v0.7.1 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