diff --git a/salt/wazuh/files/agent/ossec.conf b/salt/wazuh/files/agent/ossec.conf
new file mode 100644
index 000000000..c89b9ce06
--- /dev/null
+++ b/salt/wazuh/files/agent/ossec.conf
@@ -0,0 +1,195 @@
+{%- if grains['role'] == 'so-master' or grains['role'] == 'so-eval' %}
+{%- set ip = salt['pillar.get']('static:masterip', '') %}
+{%- endif %}
+
+
+
+
+
+ {{ip}}
+ 1514
+ udp
+
+ ubuntu, ubuntu16, ubuntu16.04
+ 10
+ 60
+ yes
+ aes
+
+
+
+
+ no
+ 5000
+ 500
+
+
+
+
+ no
+ yes
+ yes
+ yes
+ yes
+ yes
+ yes
+ yes
+ yes
+
+
+ 43200
+
+ /var/ossec/etc/shared/rootkit_files.txt
+ /var/ossec/etc/shared/rootkit_trojans.txt
+
+ /var/ossec/etc/shared/system_audit_rcl.txt
+ /var/ossec/etc/shared/system_audit_ssh.txt
+
+ yes
+
+
+
+ yes
+ 1800
+ 1d
+ yes
+
+
+
+ yes
+ 1800
+ 1d
+ yes
+
+ wodles/java
+ wodles/ciscat
+
+
+
+
+ yes
+ yes
+ /var/log/osquery/osqueryd.results.log
+ /etc/osquery/osquery.conf
+ yes
+
+
+
+
+ no
+ 1h
+ yes
+ yes
+ yes
+ yes
+ yes
+ yes
+ yes
+
+
+
+
+ no
+
+
+ 43200
+
+ yes
+
+
+ /etc,/usr/bin,/usr/sbin
+ /bin,/sbin,/boot
+
+
+ /etc/mtab
+ /etc/hosts.deny
+ /etc/mail/statistics
+ /etc/random-seed
+ /etc/random.seed
+ /etc/adjtime
+ /etc/httpd/logs
+ /etc/utmpx
+ /etc/wtmpx
+ /etc/cups/certs
+ /etc/dumpdates
+ /etc/svc/volatile
+ /sys/kernel/security
+ /sys/kernel/debug
+
+
+ /etc/ssl/private.key
+
+ yes
+
+
+ yes
+
+
+ yes
+
+
+
+
+ command
+ df -P
+ 360
+
+
+
+ full_command
+ netstat -tulpn | sed 's/\([[:alnum:]]\+\)\ \+[[:digit:]]\+\ \+[[:digit:]]\+\ \+\(.*\):\([[:digit:]]*\)\ \+\([0-9\.\:\*]\+\).\+\ \([[:digit:]]*\/[[:alnum:]\-]*\).*/\1 \2 == \3 == \4 \5/' | sort -k 4 -g | sed 's/ == \(.*\) ==/:\1/' | sed 1,2d
+ netstat listening ports
+ 360
+
+
+
+ full_command
+ last -n 20
+ 360
+
+
+
+
+ no
+ /var/ossec/etc/wpk_root.pem
+ yes
+
+
+
+
+ plain
+
+
+
+
+
+
+ syslog
+ /var/ossec/logs/active-responses.log
+
+
+
+ syslog
+ /var/log/auth.log
+
+
+
+ syslog
+ /var/log/syslog
+
+
+
+ syslog
+ /var/log/dpkg.log
+
+
+
+ syslog
+ /var/log/kern.log
+
+
+
diff --git a/salt/wazuh/files/agent/wazuh-register-agent b/salt/wazuh/files/agent/wazuh-register-agent
new file mode 100755
index 000000000..e9f9dbeb5
--- /dev/null
+++ b/salt/wazuh/files/agent/wazuh-register-agent
@@ -0,0 +1,131 @@
+#!/bin/bash
+
+###
+# Shell script for registering agents automatically with the API
+# Copyright (C) 2017 Wazuh, Inc. All rights reserved.
+# Wazuh.com
+#
+# This program is a free software; you can redistribute it
+# and/or modify it under the terms of the GNU General Public
+# License (version 2) as published by the FSF - Free Software
+# Foundation.
+###
+#
+# 12/11/2018
+# This script has been modified by Security Onion Solutions
+# - Added Agent IP variable and option
+###
+
+# Connection variables
+API_IP="localhost"
+API_PORT="55000"
+PROTOCOL="https"
+USER="foo"
+PASSWORD="bar"
+AGENT_NAME=$(hostname)
+AGENT_IP=""
+
+display_help() {
+cat <&1
+
+ if [ "$?" != "0" ]; then
+ echo -e $API_RESULT | sed -rn 's/.*"message":"(.+)".*/\1/p'
+ exit 1
+ fi
+ # Get agent id and agent key
+ AGENT_ID=$(echo $API_RESULT | cut -d':' -f 4 | cut -d ',' -f 1)
+ AGENT_KEY=$(echo $API_RESULT | cut -d':' -f 5 | cut -d '}' -f 1)
+
+ echo "Agent '$AGENT_NAME' with ID '$AGENT_ID' added."
+ echo "Key for agent '$AGENT_ID' received."
+
+ # Importing key
+ echo ""
+ echo "Importing authentication key:"
+ echo "y" | /var/ossec/bin/manage_agents -i $AGENT_KEY
+
+ # Restarting agent
+ echo ""
+ echo "Restarting:"
+ echo ""
+ /var/ossec/bin/ossec-control restart
+
+ exit 0
+}
+
+remove_agent() {
+ echo "Found: $AGENT_ID"
+ echo "Removing previous registration for '$AGENT_NAME' using ID: $AGENT_ID ..."
+ # curl -u foo:bar -k -X DELETE "https://127.0.0.1:55000/agents/001
+ REMOVE_AGENT=$(curl -s -u $USER:"$PASSWORD" -k -X DELETE $PROTOCOL://$API_IP:$API_PORT/agents/$AGENT_ID)
+ echo -e $REMOVE_AGENT
+}
+
+get_agent_id() {
+ echo ""
+ echo "Checking for Agent ID..."
+ AGENT_ID=$(curl -s -u $USER:"$PASSWORD" -k -X GET $PROTOCOL://$API_IP:$API_PORT/agents/name/$AGENT_NAME | rev | cut -d: -f1 | rev | grep -o '".*"' | tr -d '"')
+}
+
+# MAIN
+# ENTRY POINT
+
+while getopts ':hfsi:' OPTION; do
+ case "$OPTION" in
+ h)
+ display_help
+ exit 0
+ ;;
+ f|--force)
+ FORCE=true
+ ;;
+ i|--ip)
+ AGENT_IP=${OPTARG}
+ ;;
+ s|--silent)
+ SILENT=true
+ ;;
+ esac
+done
+# reset $1, $2 .... as normal argument after the flag
+shift $(($OPTIND - 1))
+
+# if no arguments are passed in after the flags, we assign the hostname value to the AGENT_NAME
+#AGENT_NAME=${1:-$(hostname)}
+
+#get_agent_id
+
+# check the return value. If we get an integer back then the agent is already registered. Anything else -> agent is not registered
+# if ! [ "$AGENT_ID" -eq "$AGENT_ID" ] 2> /dev/null ; then
+# echo "Starting registration process ..."
+# :
+# elif [[ "$FORCE" = true && "$SILENT" = "true" ]] ; then
+# remove_agent > /dev/null 2>&1
+# else
+# if [[ "$FORCE" = true ]] ; then
+# remove_agent
+# fi
+# fi
+
+# Default action -> try to register the agent
+register_agent
+#remove_agent
diff --git a/salt/wazuh/init.sls b/salt/wazuh/init.sls
index 622ef20e8..2dace4cac 100644
--- a/salt/wazuh/init.sls
+++ b/salt/wazuh/init.sls
@@ -41,6 +41,15 @@ wazuhpkgs:
- pkgs:
- wazuh-agent
+# Add Wazuh agent conf
+eslog4jfile:
+ file.managed:
+ - name: /var/ossec/etc/ossec.conf
+ - source: salt://wazuh/files/agent/ossec.conf
+ - user: 0
+ - group: 945
+ - template: jinja
+
so-wazuh:
docker_container.running:
- image: soshybridhunter/so-wazuh:HH1.0.5
@@ -48,7 +57,7 @@ so-wazuh:
- name: so-wazuh
- detach: True
- port_bindings:
- - 0.0.0.0:1515:1514/udp
+ - 0.0.0.0:1514:1514/udp
- 0.0.0.0:1514:1514/tcp
- 0.0.0.0:55000:55000
- binds: