#!/bin/bash
# This script aims at updating custom rules that are stored on the agent to have a full remote control on them #
#NOTE Different approach were available : using scp|ossecauthd|osseccontrol| or wazuh_api PUT command from manager to server but all lead to intricacies
#NOTE need to be executable
#INFO agent.conf files are used to configure those custom rules.
# List of agent IP addresses
AGENT_IPS=("192.168.56.12")

# SURICATA #
#NOTE Suricata needs to have be implemented one time first at least
# Loop through the list of agent IP addresses
for AGENT_IP in "${AGENT_IPS[@]}"
do
  # Run the suricata-update command on the agent machine using SSH
  ssh root@$AGENT_IP "sudo suricata-update"
done
