Skip to content

Latest commit

 

History

History
189 lines (146 loc) · 14.3 KB

File metadata and controls

189 lines (146 loc) · 14.3 KB

Wazuh Puppet module

This module has been authored by Nicolas Zin and updated by Jonathan Gazeley and Michael Porter. Wazuh has forked it with the purpose of maintaining it. Thank you to the authors for the contribution.

Install Wazuh module

Download and install the Wazuh module from Puppet Forge:

# puppet module install wazuh-wazuh --version |WAZUH_LATEST_PUPPET|

This module installs and configures Wazuh agent and manager.

Install manager via Puppet

The manager is configured by installing the wazuh::manager class, and optionally using:

  • wazuh::command: to define active response command (like firewall-drop.sh).
  • wazuh::activeresponse: to link rules to active response commands.
  • wazuh::addlog: to define additional log files to monitor.

Warning

On Debian-based operating systems, we will have to add the following section to the /etc/puppetlabs/code/environments/production/modules/wazuh/manifests/repo.pp file for proper execution:

server => 'pgp.mit.edu'. Line 9 to 12, do not forget the , after source entry.

apt::key { 'wazuh':
    id     => '0DCFCA5547B19D2A6099506096B3EE5F29111145',
    source => 'https://packages.wazuh.com/key/GPG-KEY-WAZUH',
    server => 'pgp.mit.edu'
  }

Here is an example of a manifest wazuh-manager.pp

node "server.yourhost.com" {
  class { 'wazuh::manager':
    ossec_smtp_server => 'localhost',
    ossec_emailto => ['user@mycompany.com'],
  }

  wazuh::command { 'firewallblock':
    command_name       => 'firewall-drop',
    command_executable => 'firewall-drop.sh',
    command_expect     => 'srcip'
  }

  wazuh::activeresponse { 'blockWebattack':
      command_name => 'firewall-drop',
      ar_level     => 9,
      ar_agent_id  => 123,
      ar_rules_id  => [31153,31151],
      ar_repeated_offenders => '30,60,120'
  }

  wazuh::addlog { 'monitorLogFile':
    logfile => '/var/log/secure',
    logtype => 'syslog'
  }
}

Place the file at /etc/puppetlabs/code/environments/production/manifests/ in your Puppet master and it will be executed in the specified node after the runinterval time set in puppet.conf. However, if you want to run it first, try the following command in the Puppet agent.

# puppet agent -t

Install agent via Puppet

The agent is configured by installing the wazuh::agent class.

Here is an example of a manifest wazuh-agent.pp (please replace with your IP address)

node "client.yourhost.com" {

  class { "wazuh::agent":
    wazuh_register_endpoint => "192.168.209.166",
    wazuh_reporting_endpoint => "192.168.209.167"
  }

}

Place the file at /etc/puppetlabs/code/environments/production/manifests/ in your Puppet master and it will be executed in the specified node after the runinterval time set in puppet.conf. However, if you want to run it first, try the following command in the Puppet agent.

# puppet agent -t

Reference Wazuh puppet

Sections Variables Functions
Wazuh manager class <reference_wazuh_manager_class>

Alerts <ref_server_vars_alerts>

Authd <ref_server_vars_authd>

Cluster <ref_server_vars_cluster>

Global <ref_server_vars_global>

Localfile <ref_server_vars_localfile>

Rootcheck <ref_server_vars_rootcheck>

Syscheck <ref_server_vars_syscheck>

Syslog output <ref_server_vars_syslog_output>

Vulnerability Detector <ref_server_vars_vuln_detector>

Wazuh API <ref_server_vars_wazuh_api>

Wodle OpenSCAP <ref_server_vars_wodle_openscap>

Wodle CIS-CAT <ref_server_vars_ciscat>

Wodle osquery <ref_server_vars_wodle_osquery>

Wodle Syscollector <ref_server_vars_wodle_syscollector>

Misc <ref_server_vars_misc>

email_alert <ref_server_email_alert>

command <ref_server_command>

activeresponse <ref_server_ar>

addlog <ref_server_addlog>

Wazuh agent class <reference_wazuh_agent_class>

Active response <ref_agent_vars_ar>

Agent enrollment <ref_agent_vars_enroll>

Client settings <ref_agent_vars_client>

Localfile <ref_agent_vars_localfile>

Rootcheck <ref_agent_vars_rootcheck>

SCA <ref_agent_vars_sca>

Syscheck <ref_agent_vars_syscheck>

Wodle OpenSCAP <ref_agent_vars_wodle_openscap>

Wodle CIS-CAT <ref_agent_vars_wodle_ciscat>

Wodle osquery <ref_agent_vars_wodle_osquery>

Wodle Syscollector <ref_agent_vars_wodle_syscollector>

Misc <ref_agent_vars_misc>

addlog <ref_agent_addlog>

Contents

reference-wazuh-puppet/wazuh-agent-class reference-wazuh-puppet/wazuh-manager-class