aboutsummaryrefslogtreecommitdiff
path: root/security/wazuh-agent
diff options
context:
space:
mode:
authorKirill Ponomarev <krion@FreeBSD.org>2020-07-30 16:16:02 +0000
committerKirill Ponomarev <krion@FreeBSD.org>2020-07-30 16:16:02 +0000
commiteaa0891b28754bcd65b166439846b97fa9741cd1 (patch)
treec590653a2745c77cb74dc1eb38f7533800cc939e /security/wazuh-agent
parentdc9eaf26d939e249f3f7ccbb7bb3359ed588d2f3 (diff)
downloadports-eaa0891b28754bcd65b166439846b97fa9741cd1.tar.gz
ports-eaa0891b28754bcd65b166439846b97fa9741cd1.zip
Add RC script
PR: 246822 Approved by: maintainer
Notes
Notes: svn path=/head/; revision=543803
Diffstat (limited to 'security/wazuh-agent')
-rw-r--r--security/wazuh-agent/Makefile3
-rw-r--r--security/wazuh-agent/files/wazuh-agent.in62
-rw-r--r--security/wazuh-agent/pkg-message8
3 files changed, 73 insertions, 0 deletions
diff --git a/security/wazuh-agent/Makefile b/security/wazuh-agent/Makefile
index 1f66c5ee53a8..47a08faa10c3 100644
--- a/security/wazuh-agent/Makefile
+++ b/security/wazuh-agent/Makefile
@@ -3,6 +3,7 @@
PORTNAME= wazuh
DISTVERSIONPREFIX= v
DISTVERSION= 3.13.1
+PORTREVISION= 1
CATEGORIES= security
MASTER_SITES= https://packages.wazuh.com/deps/3.13/
PKGNAMESUFFIX= -agent
@@ -32,6 +33,8 @@ SHEBANG_FILES= ${WRKSRC}/contrib/util.sh \
${WRKSRC}/wodles/oscap/oscap.py \
${WRKSRC}/active-response/*.sh
+USE_RC_SUBR= ${PORTNAME}-agent
+
USERS= ossec ossecm ossecr
GROUPS= ossec
diff --git a/security/wazuh-agent/files/wazuh-agent.in b/security/wazuh-agent/files/wazuh-agent.in
new file mode 100644
index 000000000000..68f1c80b208b
--- /dev/null
+++ b/security/wazuh-agent/files/wazuh-agent.in
@@ -0,0 +1,62 @@
+#!/bin/sh
+
+# $FreeBSD$
+#
+# PROVIDE: wazuh_agent
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Add these lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+# wazuh_agent_enable (bool): Set to NO by default.
+# Set it to YES to enable Wazuh Agent.
+#
+
+. /etc/rc.subr
+
+name="wazuh_agent" # 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_agent_enable:="NO"}
+
+command="/var/ossec/bin/ossec-control"
+extra_commands="status"
+
+start_cmd="wazuh_agent_start"
+stop_cmd="wazuh_agent_stop"
+status_cmd="wazuh_agent_status"
+
+wazuh_agent_start() {
+ echo -n "Starting Wazuh: "
+ ${command} start > /dev/null
+ RETVAL=$?
+ if [ $RETVAL -eq 0 ]; then
+ echo success
+ else
+ echo failure
+ fi
+ echo
+ return $RETVAL
+}
+
+wazuh_agent_stop() {
+ echo -n "Stopping Wazuh: "
+ ${command} stop > /dev/null
+ RETVAL=$?
+ if [ $RETVAL -eq 0 ]; then
+ echo success
+ else
+ echo failure
+ fi
+ echo
+ return $RETVAL
+}
+
+wazuh_agent_status() {
+ ${command} status
+}
+
+run_rc_command "$@"
+
diff --git a/security/wazuh-agent/pkg-message b/security/wazuh-agent/pkg-message
new file mode 100644
index 000000000000..138646d68dd8
--- /dev/null
+++ b/security/wazuh-agent/pkg-message
@@ -0,0 +1,8 @@
+************************************************************************************
+* *
+* You must edit /var/ossec/etc/ossec.conf.sample for your setup, and *
+* follow the other directions for wazuh client configuration at: *
+* https://documentation.wazuh.com/3.12/user-manual/reference/ossec-conf/index.html *
+* *
+************************************************************************************
+