commit 8b6ab026ddec65a19dcbb33a272b4bc1337aa77e Author: yo Date: Mon Dec 18 14:06:09 2023 +0100 Initialize port diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..df69af9 --- /dev/null +++ b/Makefile @@ -0,0 +1,24 @@ +# sysutils/godit/Makefile 2023-12-18 08:18:42Z yo + +PORTNAME= godit +PORTVERSION= 0.6.2 +DISTVERSIONPREFIX=v +PORTREVISION= 1 +CATEGORIES= sysutils + +MAINTAINER= johan@nosd.in +COMMENT= Read audit trails and decode to human readable (text/json). Service reads auditpipe and write to text file. +WWW= https://git.nosd.in/yo/libbsm/ + +LICENSE= BSD3CLAUSE + +USES= go:modules +GO_MODULE= git.nosd.in/yo/libbsm + +USE_RC_SUBR= godit + +post-install: + @${MKDIR} ${STAGEDIR}${EXAMPLESDIR} + ${INSTALL_DATA} ${PATCHDIR}/godit.newsyslog ${STAGEDIR}${EXAMPLESDIR}/newsyslog.sample + +.include diff --git a/distinfo b/distinfo new file mode 100644 index 0000000..8807343 --- /dev/null +++ b/distinfo @@ -0,0 +1,5 @@ +TIMESTAMP = 1702901853 +SHA256 (go/sysutils_godit/godit-v0.6.2/v0.6.2.mod) = ca43bc984123603d2c01378b2a26e279d9e05bc60202886019c9cc3d4054729e +SIZE (go/sysutils_godit/godit-v0.6.2/v0.6.2.mod) = 61 +SHA256 (go/sysutils_godit/godit-v0.6.2/v0.6.2.zip) = e3ca0d3c503312ed781a6c5eaa0e68d81175c0be7be02aca54e23c79b8f6612b +SIZE (go/sysutils_godit/godit-v0.6.2/v0.6.2.zip) = 24720 diff --git a/files/godit.in b/files/godit.in new file mode 100644 index 0000000..e3e0430 --- /dev/null +++ b/files/godit.in @@ -0,0 +1,38 @@ +#!/bin/sh + +# PROVIDE: godit +# REQUIRE: audit +# KEYWORD: shutdown +# +# Add the following to /etc/rc.conf[.local] to enable this service +# godit_enable="YES" +# + +. /etc/rc.subr + +: ${godit_enable=NO} +: ${godit_extra_args=""} + +name="godit" +rcvar="godit_enable" +pidfile=/var/run/godit.daemon.pid +childpidfile=/var/run/godit.pid +godit_current_file="/var/audit/current.godit" + +load_rc_config ${name} + +start_precmd="${name}_prestart" +command="/usr/sbin/daemon" +godit_command="%%PREFIX%%/bin/godit" +command_args="-rP ${pidfile} -p ${childpidfile} -S -R 1 -T ${name} \ + ${godit_command} -l ${godit_extra_args} -o ${godit_current_file} /dev/auditpipe" + +extra_commands="reload" + +godit_prestart() +{ + install -d -m 0750 `dirname "${godit_current_file}"` +} + +run_rc_command "$1" + diff --git a/files/godit.newsyslog b/files/godit.newsyslog new file mode 100644 index 0000000..e088600 --- /dev/null +++ b/files/godit.newsyslog @@ -0,0 +1,7 @@ +# configuration file for newsyslog for net-snmp +# +# see newsyslog.conf(5) for details +# +# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num] +/var/audit/current.godit 640 1 * @T00 R /var/run/godit.pid SIGUSR1 + diff --git a/pkg-descr b/pkg-descr new file mode 100644 index 0000000..562483b --- /dev/null +++ b/pkg-descr @@ -0,0 +1,3 @@ +Read audit trails and decode to human readable (text/json). Service reads auditpipe and write to text file. + +WWW: https://git.nosd.in/yo/libbsm/ diff --git a/pkg-plist b/pkg-plist new file mode 100644 index 0000000..b7074e1 --- /dev/null +++ b/pkg-plist @@ -0,0 +1,2 @@ +bin/godit +@sample %%EXAMPLESDIR%%/newsyslog.sample etc/newsyslog.conf.d/godit.conf