wazuh-agent

by Avisto Telecom

Helm chartv4.12.2App 4.12.0Verified publisher

Wazuh Agent Helm chart for Kubernetes

About this chart

Wazuh Agent

Installation

Add the Avisto repository:

helm repo add avisto https://avistotelecom.github.io/charts/

Search for the version to install:

helm search repo -l avisto/wazuh-agent

Install the chart:

helm install my-wazuh-agent avisto/wazuh-agent --version 4.12.0

Configuration

The minimal configuration required to run the wazuh agent is to specify the Wazuh server ip address in the agent.configuration.joinManagerMasterHost value as well as wazuh api credentials.

The content of the values.yaml should be at least :

agent:
  configuration:
    joinManagerMasterHost: <your_wazuh_server_ip>
    username: <your_wazuh_api_username>
    password: <your_wazuh_api_password>

ossec.conf

The wazuh agent needs the /var/ossec/etc/ossec.conf file in order to apply the correct configuration. By default, this file is mounted to the wazuh agent containers as a configmap.

Overriding the configuration

It is possible to override some parts of the agent configuration using some parameters in the values.yaml. For example the following configuration override syscollector, syscheck and add further configuration to enable docker events gathering :

agent:
  configuration:
    syscollector: |
      <wodle name="syscollector">
        <disabled>no</disabled>
        <interval>6h</interval>
        <scan_on_start>yes</scan_on_start>
        <hardware>yes</hardware>
        <os>yes</os>
        <network>no</network>
        <packages>yes</packages>
        <ports all="no">yes</ports>
        <processes>yes</processes>
        <!-- Database synchronization settings -->
        <synchronization>
          <max_eps>10</max_eps>
        </synchronization>
      </wodle>
    syscheck: |
      <syscheck>
        <disabled>yes</disabled>
      </syscheck>
    additionalconfig: |
      <wodle name="docker-listener">
        <disabled>no</disabled>
      </wodle>

Using your own configmap

You can use your own configmap to replace the configuration provided by default with this helm chart. The configmap must respect the following structure :

apiVersion: v1
kind: ConfigMap
metadata:
    name: wazuh-custom-configmap
data:
  ossec.conf: |
    <ossec_config>
      <client>
        <server>
          <address><WAZUH_SERVER_IP></address>
          <port><WAZUH_SERVER_PORT></port>
          <protocol>tcp</protocol>
        </server>
        <config-profile>debian, debian12</config-profile>
        <notify_time>10</notify_time>
        <time-reconnect>60</time-reconnect>
        <auto_restart>yes</auto_restart>
        <crypto_method>aes</crypto_method>
      </client>

      <rootcheck>
        <disabled>no</disabled>
        <check_files>yes</check_files>
        <check_trojans>yes</check_trojans>
        <check_dev>yes</check_dev>
        <check_sys>yes</check_sys>
        <check_pids>yes</check_pids>
        <check_ports>yes</check_ports>
        <check_if>yes</check_if>
        <!-- Frequency that rootcheck is executed - every 12 hours -->
        <frequency>43200</frequency>
        <rootkit_files>etc/shared/rootkit_files.txt</rootkit_files>
        <rootkit_trojans>etc/shared/rootkit_trojans.txt</rootkit_trojans>
        <skip_nfs>yes</skip_nfs>
        <ignore>/var/lib/containerd</ignore>
        <ignore>/var/lib/docker/overlay2</ignore>
      </rootcheck>

      <REST_OF_THE_CONFIG>
      ...

    <ossec_config>

Replace WAZUH_SERVER_IP and WAZUH_SERVER_PORT with the values of your Wazuh server. Also, the value of agent.existingConfigmap must be set to wazuh-custom-configmap in the values.yaml file.

Security

Because the role of the wazuh agent is to monitor the activity on the host, the pod needs elevated privileged to access specific files and directories: /var/run/docker.sock, /var/run, /dev, /sys, /proc, /etc, /boot, /usr, /lib/modules and /var/log

Parameters

Global values

NameDescriptionValue
global.imagePullSecretsGlobal Docker registry secret names as an array[]
kubeVersionOverride Kubernetes version""
nameOverrideString to partially override common.names.fullname template (will maintain the release name)""
fullnameOverrideString to fully override common.names.fullname template""
clusterDomainKubernetes Cluster Domaincluster.local
commonLabelsAdd labels to all the deployed resources{}
commonAnnotationsAdd annotations to all the deployed resources{}

Wazuh Agent values

NameDescriptionValue
agent.nameName of the Wazuh Agentwazuh-agent
agent.image.registryWazuh Agent image registryghcr.io
agent.image.repositoryWazuh Agent image repositoryavistotelecom/docker-wazuh-agent
agent.image.tagWazuh Agent image tag (immutable tags are recommended)4.12.0
agent.image.digestWazuh Agent image digest in the way sha256:aa.... Please note this parameter, if set, will override the tag""
agent.image.pullPolicyWazuh Agent image pull policyIfNotPresent
agent.image.pullSecretsSpecify image pull secrets[]
agent.configuration.joinManagerMasterHostIp address or Domain name of Wazuh server using for restapi""
agent.configuration.joinManagerProtocolHttp or https protocol for Wazuh restapihttps
agent.configuration.joinManagerApiPortPort where the Wazuh API listened55000
agent.configuration.joinManagerPortPort where the Wazuh Server listened1514
agent.configuration.usernameUsername of the Wazuh server API""
agent.configuration.passwordPassword of the Wazuh server API""
agent.configuration.wazuhGroupsGroup(s) name comma separated for auto adding agentdefault
agent.configuration.configProfileConfig profile name comma separateddebian, debian12
agent.configuration.rootcheckRootcheck configuration of the Wazuh agent (ossec.conf) formatted as YAML block text. Must start with <rootcheck> and end with </rootcheck>""
agent.configuration.ciscatCis-cat configuration of the Wazuh agent (ossec.conf) formatted as YAML block text. Must start with <wodle name="cis-cat"> and end with </wodle>""
agent.configuration.osqueryOsquery configuration of the Wazuh agent (ossec.conf) formatted as YAML block text. Must start with <wodle name="osquery"> and end with </wodle>""
agent.configuration.syscollectorSyscollector configuration of the Wazuh agent (ossec.conf) formatted as YAML block text. Must start with <wodle name="syscollector"> and end with </wodle>""
agent.configuration.scaSca configuration of the Wazuh agent (ossec.conf) formatted as YAML block text. Must start with <sca> and end with </sca>""
agent.configuration.syscheckSyscheck configuration of the Wazuh agent (ossec.conf) formatted as YAML block text. Must start with <syscheck> and end with </syscheck>""
agent.configuration.loganalysisLog analysis configuration of the Wazuh agent (ossec.conf) formatted as YAML block text. Could contain multiple <localfile></localfile> blocks""
agent.configuration.activeresponseActive response configuration of the Wazuh agent (ossec.conf) formatted as YAML block text. Must start with <active-response> and end with </active-response>""
agent.configuration.logformatLog format configuration of the Wazuh agent (ossec.conf) formatted as YAML block text. Must start with <logging> and end with </logging>""
agent.configuration.additionalconfigAdditional configuration of the Wazuh agent (ossec.conf) which is not provided by the previous parameters and formatted as YAML block text.""
agent.existingConfigmapName of an existing ConfigMap with agent configuration (ossec.conf)""
agent.extraEnvVarsArray with extra environment variables to add to Wazuh Agent nodes[]
agent.extraEnvVarsCMName of existing ConfigMap containing extra env vars for Wazuh Agent nodes""
agent.extraEnvVarsSecretName of existing Secret containing extra env vars for Wazuh Agent nodes""
agent.commandOverride default container command (useful when using custom images)[]
agent.argsOverride default container args (useful when using custom images)[]
agent.livenessProbe.enabledEnable livenessProbe on Wazuh Agent containerstrue
agent.livenessProbe.initialDelaySecondsInitial delay seconds for livenessProbe40
`agent.live

Deploy wazuh-agent with OpenTenant

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