From 8d600f995bdad830aacc775d19cd7c7178c78119 Mon Sep 17 00:00:00 2001 From: lidl Date: Wed, 23 Dec 2015 21:57:26 +0000 Subject: MFC r290405: Restrict 520.pfdenied to only list rules that blocked traffic. Before this change, the 520.pfdenied script listed all rules that matched /^block/ in the rule. Restrict the printed output to only those rules that result in packets being dropped. Approved by: rpaulo (mentor) --- etc/periodic/security/520.pfdenied | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'etc') diff --git a/etc/periodic/security/520.pfdenied b/etc/periodic/security/520.pfdenied index 7a32bf2..3fea360 100755 --- a/etc/periodic/security/520.pfdenied +++ b/etc/periodic/security/520.pfdenied @@ -44,7 +44,7 @@ rc=0 if check_yesno_period security_status_pfdenied_enable then TMP=`mktemp -t security` - if pfctl -sr -v 2>/dev/null | nawk '{if (/^block/) {buf=$0; getline; gsub(" +"," ",$0); print buf$0;} }' > ${TMP}; then + if pfctl -sr -v 2>/dev/null | nawk '{if (/^block/) {buf=$0; getline; gsub(" +"," ",$0); if ($5 > 0) print buf$0;} }' > ${TMP}; then check_diff new_only pf ${TMP} "${host} pf denied packets:" fi rc=$? -- cgit v1.1