diff options
author | jlh <jlh@FreeBSD.org> | 2013-08-27 21:20:28 +0000 |
---|---|---|
committer | jlh <jlh@FreeBSD.org> | 2013-08-27 21:20:28 +0000 |
commit | 2194a6603d76d977fda661e9938aebfe18cf3375 (patch) | |
tree | aeca29c177cf44d51cbba1cb6a179a3bb74302ef /etc/periodic/security/550.ipfwlimit | |
parent | 73f239a63e71d117bcfaca20d9b5bf28b434d9fd (diff) | |
download | FreeBSD-src-2194a6603d76d977fda661e9938aebfe18cf3375.zip FreeBSD-src-2194a6603d76d977fda661e9938aebfe18cf3375.tar.gz |
Make the period of each periodic security script configurable.
There are now six additional variables
weekly_status_security_enable
weekly_status_security_inline
weekly_status_security_output
monthly_status_security_enable
monthly_status_security_inline
monthly_status_security_output
alongside their existing daily counterparts. They all have the same
default values.
All other "daily_status_security_${scriptname}_${whatever}"
variables have been renamed to "security_status_${name}_${whatever}".
A compatibility shim has been introduced for the old variable names,
which we will be able to remove in 11.0-RELEASE.
"security_status_${name}_enable" is still a boolean but a new
"security_status_${name}_period" allows to define the period of
each script. The value is one of "daily" (the default for backward
compatibility), "weekly", "monthly" and "NO".
Note that when the security periodic scripts are run directly from
crontab(5) (as opposed to being called by daily or weekly periodic
scripts), they will run unless the test is explicitely disabled with a
"NO", either for in the "_enable" or the "_period" variable.
When the security output is not inlined, the mail subject has been
changed from "$host $arg run output" to "$host $arg $period run output".
For instance:
myfbsd security run output -> myfbsd security daily run output
I don't think this is considered as a stable API, but feel free to
correct me if I'm wrong.
Finally, I will rearrange periodic.conf(5) and default/periodic.conf
to put the security options in their own section. I left them in
place for this commit to make reviewing easier.
Reviewed by: hackers@
Diffstat (limited to 'etc/periodic/security/550.ipfwlimit')
-rwxr-xr-x | etc/periodic/security/550.ipfwlimit | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/etc/periodic/security/550.ipfwlimit b/etc/periodic/security/550.ipfwlimit index daa0f86..86932c6 100755 --- a/etc/periodic/security/550.ipfwlimit +++ b/etc/periodic/security/550.ipfwlimit @@ -38,10 +38,12 @@ then source_periodic_confs fi +security_daily_compat_var security_status_ipfwlimit_enable + rc=0 -case "$daily_status_security_ipfwlimit_enable" in - [Yy][Ee][Ss]) +if check_yesno_period security_status_ipfwlimit_enable +then IPFW_VERBOSE=`sysctl -n net.inet.ip.fw.verbose 2> /dev/null` if [ $? -ne 0 ] || [ "$IPFW_VERBOSE" -eq 0 ]; then exit 0 @@ -61,8 +63,7 @@ case "$daily_status_security_ipfwlimit_enable" in echo 'ipfw log limit reached:' cat ${TMP} fi - rm -f ${TMP};; - *) rc=0;; -esac + rm -f ${TMP} +fi exit $rc |