1105937Sthomas#!/bin/sh -
2105937Sthomas#
3105937Sthomas# Copyright (c) 2001  The FreeBSD Project
4105937Sthomas# All rights reserved.
5105937Sthomas#
6105937Sthomas# Redistribution and use in source and binary forms, with or without
7105937Sthomas# modification, are permitted provided that the following conditions
8105937Sthomas# are met:
9105937Sthomas# 1. Redistributions of source code must retain the above copyright
10105937Sthomas#    notice, this list of conditions and the following disclaimer.
11105937Sthomas# 2. Redistributions in binary form must reproduce the above copyright
12105937Sthomas#    notice, this list of conditions and the following disclaimer in the
13105937Sthomas#    documentation and/or other materials provided with the distribution.
14105937Sthomas#
15105937Sthomas# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16105937Sthomas# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17105937Sthomas# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18105937Sthomas# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19105937Sthomas# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20105937Sthomas# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21105937Sthomas# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22105937Sthomas# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23105937Sthomas# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24105937Sthomas# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25105937Sthomas# SUCH DAMAGE.
26105937Sthomas#
27105937Sthomas# $FreeBSD: releng/10.3/etc/periodic/security/510.ipfdenied 254974 2013-08-27 21:20:28Z jlh $
28105937Sthomas#
29105937Sthomas
30105937Sthomas# If there is a global system configuration file, suck it in.
31105937Sthomas#
32105937Sthomasif [ -r /etc/defaults/periodic.conf ]
33105937Sthomasthen
34105937Sthomas    . /etc/defaults/periodic.conf
35105937Sthomas    source_periodic_confs
36105937Sthomasfi
37105937Sthomas
38105937Sthomas. /etc/periodic/security/security.functions
39105937Sthomas
40254974Sjlhsecurity_daily_compat_var security_status_ipfdenied_enable
41254974Sjlh
42105937Sthomasrc=0
43105937Sthomas
44254974Sjlhif check_yesno_period security_status_ipfdenied_enable
45254974Sjlhthen
46117088Smtm	TMP=`mktemp -t security`
47105937Sthomas	if ipfstat -nhio 2>/dev/null | grep block > ${TMP}; then
48105937Sthomas	  check_diff new_only ipf ${TMP} "${host} ipf denied packets:"
49105937Sthomas	fi
50105937Sthomas	rc=$?
51254974Sjlh	rm -f ${TMP}
52254974Sjlhfi
53105937Sthomas
54105937Sthomasexit $rc
55