Fri Dec 6 14:43:30 2019 UTC ()
Save the entropy seed daily in /etc/security.


(riastradh)
diff -r1.125 -r1.126 src/etc/security
diff -r1.26 -r1.27 src/etc/defaults/security.conf
diff -r1.40 -r1.41 src/share/man/man5/security.conf.5

cvs diff -r1.125 -r1.126 src/etc/security (expand / switch to unified diff)

--- src/etc/security 2019/09/18 22:27:55 1.125
+++ src/etc/security 2019/12/06 14:43:30 1.126
@@ -1,16 +1,16 @@ @@ -1,16 +1,16 @@
1#!/bin/sh - 1#!/bin/sh -
2# 2#
3# $NetBSD: security,v 1.125 2019/09/18 22:27:55 uwe Exp $ 3# $NetBSD: security,v 1.126 2019/12/06 14:43:30 riastradh Exp $
4# from: @(#)security 8.1 (Berkeley) 6/9/93 4# from: @(#)security 8.1 (Berkeley) 6/9/93
5# 5#
6 6
7PATH=/sbin:/usr/sbin:/bin:/usr/bin 7PATH=/sbin:/usr/sbin:/bin:/usr/bin
8 8
9rcvar_manpage='security.conf(5)' 9rcvar_manpage='security.conf(5)'
10 10
11if [ -f /etc/rc.subr ]; then 11if [ -f /etc/rc.subr ]; then
12 . /etc/rc.subr 12 . /etc/rc.subr
13else 13else
14 echo "Can't read /etc/rc.subr; aborting." 14 echo "Can't read /etc/rc.subr; aborting."
15 exit 1; 15 exit 1;
16fi 16fi
@@ -1039,26 +1039,33 @@ if checkyesno check_changelist ; then @@ -1039,26 +1039,33 @@ if checkyesno check_changelist ; then
1039 # ... expand possible files 1039 # ... expand possible files
1040 # 1040 #
1041 ls -1d $file 2>/dev/null 1041 ls -1d $file 2>/dev/null
1042 ;; 1042 ;;
1043 *) 1043 *)
1044 # Otherwise, just print the filename 1044 # Otherwise, just print the filename
1045 echo $file 1045 echo $file
1046 ;; 1046 ;;
1047 esac 1047 esac
1048 done >> $CHANGEFILES 1048 done >> $CHANGEFILES
1049 CHANGELIST="$CHANGEFILES $CHANGELIST" 1049 CHANGELIST="$CHANGEFILES $CHANGELIST"
1050fi 1050fi
1051 1051
 1052# Save entropy to ${random_file} if defined, like
 1053# /etc/rc.d/random_seed.
 1054#
 1055if [ -n "${random_file:-}" ]; then
 1056 rndctl -S "$random_file"
 1057fi
 1058
1052# Special case backups, including the master password file and 1059# Special case backups, including the master password file and
1053# ssh private host keys. The normal backup mechanisms for 1060# ssh private host keys. The normal backup mechanisms for
1054# $check_changelist (see below) also print out the actual file 1061# $check_changelist (see below) also print out the actual file
1055# differences and we don't want to do that for these files 1062# differences and we don't want to do that for these files
1056# 1063#
1057echo $MP > $TMP1 # always add /etc/master.passwd 1064echo $MP > $TMP1 # always add /etc/master.passwd
1058mtree -D -k type -f $SPECIALSPEC -I nodiff | 1065mtree -D -k type -f $SPECIALSPEC -I nodiff |
1059 sed '/^type=file/!d ; s/type=file \.//' | unvis >> $TMP1 1066 sed '/^type=file/!d ; s/type=file \.//' | unvis >> $TMP1
1060grep -v '^$' $TMP1 | sort -u > $TMP2 1067grep -v '^$' $TMP1 | sort -u > $TMP2
1061 1068
1062while read file; do 1069while read file; do
1063 backup_and_diff "$file" no 1070 backup_and_diff "$file" no
1064done < $TMP2 1071done < $TMP2

cvs diff -r1.26 -r1.27 src/etc/defaults/security.conf (expand / switch to unified diff)

--- src/etc/defaults/security.conf 2013/11/06 19:37:05 1.26
+++ src/etc/defaults/security.conf 2019/12/06 14:43:29 1.27
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: security.conf,v 1.26 2013/11/06 19:37:05 spz Exp $ 1# $NetBSD: security.conf,v 1.27 2019/12/06 14:43:29 riastradh Exp $
2# 2#
3# /etc/defaults/security.conf -- 3# /etc/defaults/security.conf --
4# default configuration of /etc/security.conf 4# default configuration of /etc/security.conf
5# 5#
6# see security.conf(5) for more information. 6# see security.conf(5) for more information.
7# 7#
8# DO NOT EDIT THIS FILE DIRECTLY; IT MAY BE REPLACED DURING A SYSTEM UPGRADE. 8# DO NOT EDIT THIS FILE DIRECTLY; IT MAY BE REPLACED DURING A SYSTEM UPGRADE.
9# EDIT /etc/security.conf INSTEAD. 9# EDIT /etc/security.conf INSTEAD.
10# 10#
11 11
12check_passwd=YES 12check_passwd=YES
13check_group=YES 13check_group=YES
14check_rootdotfiles=YES 14check_rootdotfiles=YES
@@ -36,13 +36,15 @@ check_homes_permit_other_owner="" @@ -36,13 +36,15 @@ check_homes_permit_other_owner=""
36 36
37check_devices_ignore_fstypes="!local fdesc kernfs null procfs ptyfs ntfs msdos" 37check_devices_ignore_fstypes="!local fdesc kernfs null procfs ptyfs ntfs msdos"
38check_devices_ignore_paths="" 38check_devices_ignore_paths=""
39 39
40check_mtree_follow_symlinks=NO 40check_mtree_follow_symlinks=NO
41 41
42check_passwd_nowarn_shells="/sbin/nologin" 42check_passwd_nowarn_shells="/sbin/nologin"
43check_passwd_nowarn_users="" 43check_passwd_nowarn_users=""
44check_passwd_permit_dups="toor" 44check_passwd_permit_dups="toor"
45check_passwd_permit_star=NO 45check_passwd_permit_star=NO
46check_passwd_permit_nonalpha=NO 46check_passwd_permit_nonalpha=NO
47max_loginlen=16 47max_loginlen=16
48max_grouplen=16 48max_grouplen=16
 49
 50random_file=/var/db/entropy-file

cvs diff -r1.40 -r1.41 src/share/man/man5/security.conf.5 (expand / switch to unified diff)

--- src/share/man/man5/security.conf.5 2013/11/06 19:37:06 1.40
+++ src/share/man/man5/security.conf.5 2019/12/06 14:43:30 1.41
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1.\" $NetBSD: security.conf.5,v 1.40 2013/11/06 19:37:06 spz Exp $ 1.\" $NetBSD: security.conf.5,v 1.41 2019/12/06 14:43:30 riastradh Exp $
2.\" 2.\"
3.\" Copyright (c) 1996 Matthew R. Green 3.\" Copyright (c) 1996 Matthew R. Green
4.\" All rights reserved. 4.\" All rights reserved.
5.\" 5.\"
6.\" Redistribution and use in source and binary forms, with or without 6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions 7.\" modification, are permitted provided that the following conditions
8.\" are met: 8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright 9.\" 1. Redistributions of source code must retain the above copyright
10.\" notice, this list of conditions and the following disclaimer. 10.\" notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\" notice, this list of conditions and the following disclaimer in the 12.\" notice, this list of conditions and the following disclaimer in the
13.\" documentation and/or other materials provided with the distribution. 13.\" documentation and/or other materials provided with the distribution.
14.\" 14.\"
@@ -272,26 +272,37 @@ instead. @@ -272,26 +272,37 @@ instead.
272If defined, points to the location of the packages database. 272If defined, points to the location of the packages database.
273Defaults to 273Defaults to
274.Pa /var/db/pkg . 274.Pa /var/db/pkg .
275.It Sy backup_uses_rcs 275.It Sy backup_uses_rcs
276Use 276Use
277.Xr rcs 1 277.Xr rcs 1
278for maintaining backup copies of files noted in 278for maintaining backup copies of files noted in
279.Sy check_devices , 279.Sy check_devices ,
280.Sy check_disklabels , 280.Sy check_disklabels ,
281.Sy check_pkgs , 281.Sy check_pkgs ,
282and 282and
283.Sy check_changelist 283.Sy check_changelist
284instead of just keeping a current copy and a backup copy. 284instead of just keeping a current copy and a backup copy.
 285.It Sy random_file
 286Name of the entropy seed file used at boot.
 287Default is
 288.Pa /var/db/entropy-file
 289as used by
 290.Pa /etc/rc.d/random_seed .
 291Set
 292.Sy random_file
 293to empty to disable saving a seed every time
 294.Pa /etc/security
 295runs.
285.El 296.El
286.Sh FILES 297.Sh FILES
287.Bl -tag -width /etc/defaults/security.conf -compact 298.Bl -tag -width /etc/defaults/security.conf -compact
288.It Pa /etc/defaults/security.conf 299.It Pa /etc/defaults/security.conf
289defaults for /etc/security.conf 300defaults for /etc/security.conf
290.It Pa /etc/security 301.It Pa /etc/security
291daily security check script 302daily security check script
292.It Pa /etc/security.conf 303.It Pa /etc/security.conf
293daily security check configuration 304daily security check configuration
294.It Pa /etc/security.local 305.It Pa /etc/security.local
295local site additions to 306local site additions to
296.Pa /etc/security 307.Pa /etc/security
297.El 308.El