Wazuh is a free and open source platform used for threat prevention, detection, and response. It is capable of protecting workloads across on-premises, virtualized, containerized, and cloud-based environments. Wazuh solution consists of an endpoint security agent, deployed to the monitored systems, and a management server, which collects and analyzes data gathered by the agents. Besides, Wazuh has been fully integrated with the Elastic Stack, providing a search engine and data visualization tool that allows users to navigate through their security alerts. WWW: https://wazuh.com/
60 lines
1.1 KiB
Bash
60 lines
1.1 KiB
Bash
#!/bin/sh
|
|
|
|
# PROVIDE: wazuh_manager
|
|
# REQUIRE: LOGIN
|
|
# KEYWORD: shutdown
|
|
#
|
|
# Add these lines to /etc/rc.conf.local or /etc/rc.conf
|
|
# to enable this service:
|
|
# wazuh_manager_enable (bool): Set to NO by default.
|
|
# Set it to YES to enable Wazuh Agent.
|
|
#
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="wazuh_manager" # How the service will be invoked from service
|
|
rcvar="${name}_enable" # The variable in rc.conf that will allow this service to run
|
|
|
|
load_rc_config $name # Loads the config file, if relevant.
|
|
|
|
: ${wazuh_manager_enable:="NO"}
|
|
|
|
command="/var/ossec/bin/wazuh-control"
|
|
extra_commands="status"
|
|
|
|
start_cmd="wazuh_manager_start"
|
|
stop_cmd="wazuh_manager_stop"
|
|
status_cmd="wazuh_manager_status"
|
|
|
|
wazuh_manager_start() {
|
|
echo -n "Starting Wazuh Manager: "
|
|
${command} start > /dev/null
|
|
RETVAL=$?
|
|
if [ $RETVAL -eq 0 ]; then
|
|
echo success
|
|
else
|
|
echo failure
|
|
fi
|
|
echo
|
|
return $RETVAL
|
|
}
|
|
|
|
wazuh_manager_stop() {
|
|
echo -n "Stopping Wazuh Manager: "
|
|
${command} stop > /dev/null
|
|
RETVAL=$?
|
|
if [ $RETVAL -eq 0 ]; then
|
|
echo success
|
|
else
|
|
echo failure
|
|
fi
|
|
echo
|
|
return $RETVAL
|
|
}
|
|
|
|
wazuh_manager_status() {
|
|
${command} status
|
|
}
|
|
|
|
run_rc_command "$@"
|
|
|