Commit Graph

134 Commits

Author SHA1 Message Date
Ruslan Ermilov
8aad57438b Purge orphan catpages.
PR:		conf/35242
Submitted by:	Annihilator <annihilator.c@usa.net>
2005-03-30 18:02:49 +00:00
Suleiman Souhlal
71b7f1cffb Replace "ipfw l", which is now deprecated, with "ipfw list".
Approved by:	grehan (mentor)
2005-02-23 15:07:36 +00:00
Gleb Smirnoff
aed9792fae Don't do setuid checks on file systems mounted with noexec option.
Reviewed by:	brian, ru
MFC after:	1 week
2005-01-13 15:07:35 +00:00
Brian Somers
b96d69488c Sed doesn't grok '[ \t]' -- it doesn't expand the \t :(
As there are no tabs in maillog, reduce the expression so that only spaces
are used.

Problem raised by:      Leif Neland root at internet dot dk
2005-01-12 01:31:21 +00:00
Brian Somers
b389bf7570 Oops, the < in arg1=< is optional - treat it as such! 2005-01-11 10:54:38 +00:00
Brian Somers
cd3384a7ec Adjust the mail reject output so that it gives an abreviated reason for the
reject.  For example:

Checking for rejected mail hosts:
  48 getherbalnow.info (451... resolve)
  46 absorb.com (451... resolve)
   4 tgmart01.codns.com (553... exist)
   3 kali.com.cn (451... resolve)
   2 genie.com (451... resolve)
   1 zv.qy (553... exist)
   1 zd.hinet.hr (553... exist)
   ....

The bit in parenthesis is the reject code and the last word on the line -
enough to give the admin a better chance of seeing real problems (hopefully!).

While I'm here, remove the "<" at the start of rejects coming from "from"
addresses without a name@ part.

I had to rewrite the patch given by the submitter as this script has been
sed'ified (used to be perl) and I think the reject code is useful....

PR:		17377
Idea from:	root at ns dot internet dot dk
MFC after:	7 days
2005-01-11 02:08:53 +00:00
Brian Somers
ea7e63ea87 Collapse "fgrep | egrep | sed" down to a single sed.
This also trims extraneous commas from domain names.

MFC after:	7 days
2005-01-11 01:47:44 +00:00
Ruslan Ermilov
e653b48c80 Start the dreaded NOFOO -> NO_FOO conversion.
OK'ed by:	core
2004-12-21 08:47:35 +00:00
Max Laier
66754ab3f1 Teach periodic(8) security output to display information about blocked
packet counts by pf(4).

This adds a ``daily_status_security_pfdenied_enable'' variable to
periodic.conf, which defaults to ``YES'' as the matching IPF(W) versions.

The output will look like this (line wrapped):

  pf denied packets:
  > block drop log on rl0 proto tcp all [ Evaluations: 504986 Packets: 0
    Bytes: 0 States: 0 ]
  > block drop log on rl0 all [ Evaluations: 18559 Packets: 427 Bytes: 140578
    States: 0 ]

Submitted by:	clive (thanks a lot!)
MFC after:	2 weeks
2004-11-24 18:41:53 +00:00
Joseph Koshy
59583bf53c Add a knob 'daily_status_security_diff_flags' controlling the
format of the 'diff' output generated during periodic(8) scripts.

Submitted by:	keramida (script changes)
Reviewed by:	keramida (man page changes)
2004-09-23 02:00:52 +00:00
Josef Karthauser
bb1e7a5e19 Allow the location of the INDEX file to specified to pkg_version.
This is particularly convenient on a cluster of machines to prevent
having to rebuild the INDEX file on each.

Reviewed by:	portmgr
2004-05-19 09:18:08 +00:00
Darren Reed
167992ad9a Add script for checking ipv6 blocked packets from PR.
PR:		misc/50154
Submitted by:	Kimura Fuyuki <fuyuki@hadaly.org>
2004-04-20 13:44:57 +00:00
Andrey A. Chernov
6fec5a9e2a Don't remove empty dirs if their names are in $daily_clean_tmps_ignore 2004-02-28 04:58:40 +00:00
Gregory Neil Shapiro
75d80d9541 Use hoststat/purgestat instead of sendmail -bh/-bH so the calls can
be properly mailwrapper'ed.

PR:		conf/60676
Submitted by:	Colin Percival <cperciva@daemonology.net>, maxim
MFC after:	4 days
2004-01-02 18:50:22 +00:00
Ruslan Ermilov
9ef295f29e Use %e in the date(1) format string to eliminate the sed(1) command. 2003-11-07 21:55:35 +00:00
Jesper Skriver
9eebf81523 Add status checking of ATA raid to the daily periodic scripts. 2003-10-27 20:14:53 +00:00
Mike Makonnen
3b5ba84fd2 Have mktemp(1) construct the temporary file name for us instead
of providing a template manually.

Submitted by:	Lars Eggert <larse@isi.edu>
2003-06-30 22:06:26 +00:00
John Baldwin
711c2e1de2 Remove 220.backup-distfile since it has been deleted.
Reported by:	mdodd
Pointy hat to:	jhb
2003-04-01 20:32:01 +00:00
John Baldwin
3165d2ea56 Complete removal of 320.rdist by removing its entry from periodic.conf and
removing the related 220.backup-distfile script and associatd periodic.conf
entry.

Discussed with:	obrien
2003-04-01 17:45:27 +00:00
David E. O'Brien
1b79399c2b 320.rdist is OBE as we don't have rdist in the base system any more. 2003-03-29 03:28:28 +00:00
David E. O'Brien
d19c3acb44 This is OBE as we don't have rdist in the base system any longer. 2003-03-29 03:27:49 +00:00
Garrett Wollman
de1d122868 Do not do manually what sendmail(8) can do better automatically.
Tell sendmail to clean up its own host status cache.
The error condition handling could probably be done better.
2003-01-08 18:51:45 +00:00
Stefan Eßer
2068678af4 Add support for bzip2ed log files. 2003-01-05 21:32:50 +00:00
Giorgos Keramidas
0333ea509d Avoid using perl in the periodic & security scripts. This brings the
base system one step closer to being totally perl-free.

Approved by:	re (jhb)
2002-12-07 23:37:44 +00:00
Thomas Quinot
da509dd293 Do not emit a message on stderr when one of the compared files
is shorter than the other.

Reviewed by:	roberto
MFC after:	3 days
2002-11-16 14:58:39 +00:00
Thomas Quinot
68c2bacd8d Remove incorrect output redirection.
Reviewed by:	roberto
Committed from:	EuroBSDCon Amsterdam
MFC after:	3 days
2002-11-16 14:57:12 +00:00
Thomas Quinot
77ee1b9798 Add newly-added sripts to FILES.
Reviewed by:	roberto
2002-10-25 15:23:26 +00:00
Thomas Quinot
7644e396f3 Add a new /etc/periodic/security script to check for packets
rejected by ipfilter (510.ipfdenied), and a corresponding periodic.conf
knob (daily_status_security_ipfdenied_enable).

Reviewed by:	roberto
Approved by:	re@
2002-10-25 15:16:54 +00:00
Thomas Quinot
cb9eff8a9e Factor out code across various /etc/periodic/security scripts into a
separate file, /etc/periodic/security/security.functions.

Reviewed by:	roberto (mentor)
Approved by:	re@
2002-10-25 15:14:16 +00:00
Joerg Wunsch
6e84ba78c1 When considering temporary files for deletion, don't examine the mtime
and atime only, but also the ctime.  Otherwise, files extracted from
tar or zip archives will immediately be declared stale since they've
got their mtime reset to the original mtime.

Reviewed by:	brian
MFC after:	1 week
2002-10-06 18:48:20 +00:00
Brian Somers
df93d794dc Add a pkg_version variable so that it's possible to run portsversion instead
of pkg_version in periodic/weekly/400.status-pkg.
2002-09-25 03:01:42 +00:00
Andrey A. Chernov
15897030c6 Make it work with POSIX sort (POS arg).
All old sorts understand -k too.
2002-09-24 18:53:46 +00:00
Crist J. Clark
10f23b4ad0 Only create a temporary file if we are actually going to do something
in the script. Eliminates a bug where we create a temp file, but don't
delete it since the rm(1) is only done if the check is enabled.

PR:		bin/40960
Submitted by:	frf <frf@xocolatl.com>
MFC after:	3 days
2002-08-25 04:09:17 +00:00
Jens Schweikhardt
f017edb1bf o Test and change to the correct directory, /var/spool/.hoststat
o Bring if/then style in sync with /etc/rc scripts

PR:		conf/41570
Submitted by:	Konstantin M Volevatch <cox@rosnet.ru>
MFC after:	1 week
2002-08-12 11:09:01 +00:00
Gregory Neil Shapiro
b31d4126e3 If all file systems are marked nosuid, the line:
MP=`mount -t ufs | grep -v " nosuid" | awk '{ print $3 }' | sort`

sets ${MP} to an empty string so the next line:

	set ${MP}

actually just dumps all of the shells variables to stdout (and therefore
the security report).  Fixed by surrounding the code which goes through the
mounts with a test for an empty string before using ${MP}.

Reviewed by:	brian
MFC after:	3 days
2002-08-03 22:33:34 +00:00
Ruslan Ermilov
bff0acee63 Install scripts via FILES (purposedly not via SCRIPTS that would
strip the suffixes).
2002-07-18 12:33:01 +00:00
Ruslan Ermilov
0b87f79976 s/${INSTALL} -c/${INSTALL} ${COPY}/ 2002-07-18 12:07:49 +00:00
Brian Somers
103efc95e8 Mention that we're checking kernel log messages, even if there's
no output.

PR:		39618
MFC after:	1 week
2002-06-28 10:32:18 +00:00
Brian Somers
9e280368ad Temporarily change our umask to 066 so that the potential creation
of wtmp.0 is done as mode 600.

This ensures that tight permissions set in /etc/newsyslog.conf for
wtmp logging aren't ``betrayed''.

Suggested by:	lumpy <lumpy@the.whole.net>
MFC after:	3 days
2002-05-17 14:05:08 +00:00
Brian Somers
740b91b560 Change `dmesg -a'' to `dmesg''.
The change was introduced in src/etc/security 1.53 almost a year ago
in an attempt to see ipfw deny message logs.

However, ipfw deny/reject logs have been displayed since version 1.13
of the same file as a separate ``job'' and have since moved to
src/etc/periodic/security/500.ipfwdenied.

MFC after:	3 days
2002-05-17 13:38:36 +00:00
Brian Somers
db1d04d6d9 Tighten up temporary file permissions and move them to ${TMPDIR:-/tmp}
Problem reported by:	lumpy <lumpy@the.whole.net>
MFC after:		3 days
2002-05-17 11:34:12 +00:00
Brian Somers
afa3985979 Return 3 unless $daily_status_security_enable != YES.
Returning $? masks security output when ``periodic security'' is successful !

MFC after:	3 days
2002-05-17 11:31:45 +00:00
Brian Somers
9472aac628 Fix the output when daily_status_mailq_shorten is set to YES
PR:			23766
Mostly submitted by:	lambert@ssabsd.csw.net
MFC after:		3 days
2002-05-07 13:11:05 +00:00
Crist J. Clark
f5a8f1482c Remove leading whitespace from the setuid file lists.
Due to the way we run ls(1), through xargs(1), the leading whitespace
can change even when the setuid files haven't. To avoid displaying
these lines, we currently run diff(1) with the '-w' option. However,
this is probably not the ideal way to go; there is a very, very small
possibility for diff(1) to miss things is shouldn't. So, with the
leading space cleaned, we can revert to the '-b' option which is
"safer."

PR:		conf/37618
Reviewed by:	brian
MFC after:	3 days
2002-05-05 00:59:37 +00:00
Brian Somers
ee9336d9b7 Handle .bz2 files created by newsyslog
PR:			37529
Partially submitted by:	Peter Hollaubek <fifteen@inext.hu>
MFC after:		1 week
2002-04-30 17:07:32 +00:00
Gregory Neil Shapiro
14a349d554 Update mail queue related periodic scripts to account for sendmail 8.12's
clientmqueue (submit mail queue).

The new mailq display is only active if both the old
daily_status_mailq_enable is set to "YES" and the new
daily_status_include_submit_mailq is set to "YES" so people who disabled
440.status-mailq won't have any surprises.

Likewise, the new queue run is only active if both the old
daily_queuerun_enable is set to "YES" and the new daily_submit_queuerun
is set to "YES" so people who disabled 500.queuerun won't have any
surprises.

While I am here, remove the [ ! -d /var/spool/mqueue ] checks from
both scripts as the queue directory isn't always /var/spool/mqueue for
the main daemon -- it can be set to anything in the sendmail.cf file.

MFC after:	1 week
2002-04-10 03:58:40 +00:00
Robert Watson
2e1fc052bc No need to explicitly check for both cases when using grep -i. 2002-03-12 21:44:33 +00:00
Robert Watson
cd9281b380 Update login failure checking to check auth.log instead of messages,
and teach it to look for more general classes of failures, including
SSH login failures.  This is similar but not identical to a patch
submitted by aeonflux@synapse.subneural.net.
2002-03-11 19:39:08 +00:00
Crist J. Clark
90bbf5454c Environmental variable was not being passed to a subshell as intended.
PR:		bin/35558
Submitted by:	Nicolas Rachinsky <list@rachinsky.de>
2002-03-05 19:13:05 +00:00
Brian Somers
55ade43025 Set rc=1 rather than 0 so that setting daily_show_success=YES masks
the output of all goes well.

PR:		34825
Submitted by:	Valentin Nechayev <netch@netch.kiev.ua>
MFC after:	3 weeks
2002-02-13 19:10:07 +00:00