mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
Wazuh - Move agent config to init.sls
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
{%- set ip = salt['pillar.get']('static:masterip', '') %}
|
||||
#!/bin/bash
|
||||
|
||||
###
|
||||
@@ -23,7 +24,7 @@ PROTOCOL="https"
|
||||
USER="foo"
|
||||
PASSWORD="bar"
|
||||
AGENT_NAME=$(hostname)
|
||||
AGENT_IP=""
|
||||
AGENT_IP="{{ip}}"
|
||||
|
||||
display_help() {
|
||||
cat <<HELP_USAGE
|
||||
@@ -49,7 +50,7 @@ register_agent() {
|
||||
|
||||
if [ "$?" != "0" ]; then
|
||||
echo -e $API_RESULT | sed -rn 's/.*"message":"(.+)".*/\1/p'
|
||||
exit 1
|
||||
exit 0
|
||||
fi
|
||||
# Get agent id and agent key
|
||||
AGENT_ID=$(echo $API_RESULT | cut -d':' -f 4 | cut -d ',' -f 1)
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
{%- set HOSTNAME = salt['grains.get']('host', '') %}
|
||||
|
||||
#vm.max_map_count:
|
||||
# sysctl.present:
|
||||
# - value: 262144
|
||||
|
||||
# Add ossec Group
|
||||
# Add ossec group
|
||||
ossecgroup:
|
||||
group.present:
|
||||
- name: ossec
|
||||
@@ -58,6 +54,7 @@ wazuhagentregister:
|
||||
- user: 0
|
||||
- group: 0
|
||||
- mode: 755
|
||||
- template: jinja
|
||||
|
||||
so-wazuh:
|
||||
docker_container.running:
|
||||
@@ -72,3 +69,9 @@ so-wazuh:
|
||||
- binds:
|
||||
- /opt/so/wazuh/:/var/ossec/data/:rw
|
||||
|
||||
# Register the agent
|
||||
registertheagent:
|
||||
cmd.run:
|
||||
- name: /usr/sbin/wazuh-register-agent
|
||||
- cwd: /
|
||||
#- stateful: True
|
||||
|
||||
Reference in New Issue
Block a user