View | Details | Raw Unified | Return to bug 264878 | Differences between
and this patch

Collapse All | Expand All

(-)b/MOVED (+1 lines)
Lines 17221-17223 textproc/rubygem-elasticsearch-rails6|textproc/rubygem-elasticsearch-rails|2022- Link Here
17221
devel/p5-Goo-Canvas|devel/p5-Goo-Canvas2|2022-06-24|Obsolete use devel/p5-Goo-Canvas2 instead
17221
devel/p5-Goo-Canvas|devel/p5-Goo-Canvas2|2022-06-24|Obsolete use devel/p5-Goo-Canvas2 instead
17222
graphics/goocanvas|graphics/goocanvas3|2022-06-24|Obsolete use graphics/goocanvas3
17222
graphics/goocanvas|graphics/goocanvas3|2022-06-24|Obsolete use graphics/goocanvas3
17223
x11-toolkits/tepl|x11-toolkits/tepl6|2022-06-25|Obsolete use x11-toolkits/tepl6
17223
x11-toolkits/tepl|x11-toolkits/tepl6|2022-06-25|Obsolete use x11-toolkits/tepl6
17224
security/base-audit|ports-mgmt/pkg|2022-06-26|Merged into ports-mgmt/pkg
(-)b/UPDATING (+10 lines)
Lines 5-10 they are unavoidable. Link Here
5
You should get into the habit of checking this file for changes each time
5
You should get into the habit of checking this file for changes each time
6
you update your ports collection, before attempting any port upgrades.
6
you update your ports collection, before attempting any port upgrades.
7
7
8
20220626:
9
AFFECTS: users of security/base-audit
10
  AUTHOR: yasu@FreeBSD.org
11
12
  This port is removed as 405.pkg-base-audit, core file of the port,
13
  is merged into ports-mgmt/pkg with pkg 1.18.1. If you use portmaster
14
  or portupgrade, do `pkg delete base-audit` before upgrading
15
  ports-mgmt/pkg. If you use pkg with binary packages, `pkg upgrade`
16
  should do everething properly.
17
8
20220625:
18
20220625:
9
AFFECTS: users of sysutils/fusefs-bindfs
19
AFFECTS: users of sysutils/fusefs-bindfs
10
  AUTHOR: doralitze@chaotikum.org
20
  AUTHOR: doralitze@chaotikum.org
(-)b/security/Makefile (-1 lines)
Lines 40-46 Link Here
40
    SUBDIR += aws-vault
40
    SUBDIR += aws-vault
41
    SUBDIR += barnyard2
41
    SUBDIR += barnyard2
42
    SUBDIR += barnyard2-sguil
42
    SUBDIR += barnyard2-sguil
43
    SUBDIR += base-audit
44
    SUBDIR += bastillion
43
    SUBDIR += bastillion
45
    SUBDIR += bcrypt
44
    SUBDIR += bcrypt
46
    SUBDIR += bcwipe
45
    SUBDIR += bcwipe
(-)a/security/base-audit/Makefile (-31 lines)
Removed Link Here
1
# Created by: Miroslav Lachman
2
3
PORTNAME=	base-audit
4
PORTVERSION=	0.5
5
CATEGORIES=	security
6
MASTER_SITES=	# none
7
DISTFILES=	# none
8
9
MAINTAINER=	000.fbsd@quip.cz
10
COMMENT=	Daily periodic check of vulnerabilities in base system
11
12
LICENSE=	BSD3CLAUSE
13
14
RUN_DEPENDS=	${LOCALBASE}/sbin/pkg:${PKG_ORIGIN}
15
16
NO_ARCH=	yes
17
NO_BUILD=	yes
18
NO_INSTALL=	yes
19
20
SUB_FILES=	405.pkg-base-audit
21
22
PERIODIC_SECURITY=	etc/periodic/security
23
24
PLIST_FILES=	${PERIODIC_SECURITY}/405.pkg-base-audit
25
26
do-install:
27
	@${MKDIR} ${STAGEDIR}${PREFIX}/${PERIODIC_SECURITY}
28
	 ${INSTALL_SCRIPT} ${WRKDIR}/405.pkg-base-audit \
29
		${STAGEDIR}${PREFIX}/${PERIODIC_SECURITY}
30
31
.include <bsd.port.mk>
(-)a/security/base-audit/files/405.pkg-base-audit.in (-223 lines)
Removed Link Here
1
#!/bin/sh -f
2
#
3
# Copyright (c) 2004 Oliver Eikemeier. All rights reserved.
4
# Copyright (c) 2014 Matthew Seaman <matthew@FreeBSD.org>
5
# Copyright (c) 2016 Miroslav Lachman <000.fbsd@quip.cz>
6
#
7
# Redistribution and use in source and binary forms, with or without
8
# modification, are permitted provided that the following conditions are
9
# met:
10
#
11
# 1. Redistributions of source code must retain the above copyright notice
12
#    this list of conditions and the following disclaimer.
13
#
14
# 2. Redistributions in binary form must reproduce the above copyright
15
#    notice, this list of conditions and the following disclaimer in the
16
#    documentation and/or other materials provided with the distribution.
17
#
18
# 3. Neither the name of the author nor the names of its contributors may be
19
#    used to endorse or promote products derived from this software without
20
#    specific prior written permission.
21
#
22
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
23
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
24
# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
33
if [ -r /etc/defaults/periodic.conf ]; then
34
	. /etc/defaults/periodic.conf
35
	source_periodic_confs
36
fi
37
38
: ${security_status_baseaudit_enable:=YES}
39
: ${security_status_baseaudit_period:=daily}
40
: ${security_status_baseaudit_quiet:=NO}
41
: ${security_status_baseaudit_chroots=$pkg_chroots}
42
: ${security_status_baseaudit_jails=$pkg_jails}
43
: ${security_status_baseaudit_jails_ignore=""}
44
: ${security_status_baseaudit_expiry:=2}
45
46
# Compute PKG_DBDIR from the config file.
47
pkgcmd=%%PREFIX%%/sbin/pkg
48
PKG_DBDIR=`${pkgcmd} config PKG_DBDIR`
49
auditfile="${PKG_DBDIR}/vuln.xml"
50
51
audit_base() {
52
	local pkgargs="$1"
53
	local basedir="$2"
54
	local rc
55
	local then
56
	local now
57
	local usrlv
58
	local krnlv
59
	local strlen
60
	local chrootv
61
	local jailv
62
	local jid
63
	
64
	## get version from chroot
65
	if [ -n "`echo "$pkgargs" | egrep '^-c'`" ]; then
66
		if [ -x "$basedir/bin/freebsd-version" ]; then
67
			chrootv=$($basedir/bin/freebsd-version -u)
68
			## safety check - strlen
69
			strlen=$(echo "$chrootv" | wc -c)
70
			if [ $strlen -gt 17 -o $strlen -lt 11 ]; then
71
				echo "Wrong version string, cannot run audit"
72
				return 3
73
			fi
74
			usrlv=$(echo $chrootv | sed 's,^,FreeBSD-,;s,-RELEASE-p,_,;s,-RELEASE$,,')
75
		else
76
			echo "Cannot guess chroot version"
77
			return 3
78
		fi
79
	## get version from jail
80
	elif [ -n "`echo "$pkgargs" | egrep '^-j'`" ]; then
81
		jid=$(echo "$pkgargs" | awk '$1 ~ /^-[j]/ { print $2 }')
82
		jailv=$(jexec $jid freebsd-version -u)
83
		## safety check - strlen
84
		strlen=$(echo "$jailv" | wc -c)
85
		if [ $strlen -gt 17 -o $strlen -lt 11 ]; then
86
			echo "Wrong version string, cannot run audit"
87
			return 3
88
		fi
89
		usrlv=$(echo $jailv | sed 's,^,FreeBSD-,;s,-RELEASE-p,_,;s,-RELEASE$,,')
90
	## get version from host
91
	else
92
		usrlv=$(freebsd-version -u | sed 's,^,FreeBSD-,;s,-RELEASE-p,_,;s,-RELEASE$,,')
93
	fi
94
95
	then=`stat -f '%m' "${basedir}${auditfile}" 2> /dev/null` || rc=3
96
	now=`date +%s` || rc=3
97
	## Add 10 minutes of padding since the check is in seconds.
98
	if [ $rc -ne 0 -o \
99
		$(( 86400 \* "${security_status_baseaudit_expiry}" )) \
100
		-le $(( ${now} - ${then} + 600 )) ]; then
101
		## When non-interactive, sleep to reduce congestion on mirrors
102
		anticongestion
103
		f="-F"
104
	else
105
		echo -n 'Database fetched: '
106
		date -r "${then}" || rc=3
107
	fi
108
109
	## cannot check kernel in jail or chroot
110
	if [ -z "`echo "$pkgargs" | egrep '^-[cj]'`" -a `sysctl -n security.jail.jailed` = 0 ]; then
111
		krnlv=$(freebsd-version -k | sed 's,^,FreeBSD-kernel-,;s,-RELEASE-p,_,;s,-RELEASE$,,')
112
		${pkgcmd} audit $f $q $krnlv || { rc=$?; [ $rc -lt 3 ] && rc=3; }
113
	fi
114
115
	${pkgcmd} audit $f $q $usrlv || { rc=$?; [ $rc -lt 3 ] && rc=3; }
116
117
	return $rc
118
}
119
120
# Use $pkg_chroots to provide a default list of chroots, and
121
# $pkg_jails to provide a default list of jails (or '*' for all jails)
122
# for all pkg periodic scripts, or set
123
# $security_status_baseaudit_chroots and
124
# $security_status_baseaudit_jails for this script only.
125
126
audit_base_all() {
127
	local rc
128
	local last_rc
129
	local jails
130
131
	# We always show audit results for the base system, but only print
132
	# a banner line if we're also showing audit results for any
133
	# chroots or jails.
134
135
	if [ -n "${security_status_baseaudit_chroots}" -o \
136
		-n "${security_status_baseaudit_jails}" ]; then
137
		echo "Host system:"
138
	fi
139
140
	audit_base '' ''
141
	last_rc=$?
142
	[ $last_rc -gt 1 ] && rc=$last_rc
143
144
	for c in $security_status_baseaudit_chroots ; do
145
		echo
146
		echo "chroot: $c"
147
		audit_base "-c $c" $c
148
		last_rc=$?
149
		[ $last_rc -gt 1 ] && rc=$last_rc
150
	done
151
152
	case $security_status_baseaudit_jails in
153
	\*)
154
		jails=$(jls -q -h name path | sed -e 1d -e 's/ /|/')
155
		;;
156
	'')
157
		jails=
158
		;;
159
	*)
160
		# Given the jail name or jid, find the jail path
161
		jails=
162
		for j in $security_status_baseaudit_jails ; do
163
			p=$(jls -j $j -h name path | sed -e 1d -e 's/ /|/')
164
			jails="${jails} ${p}"
165
		done
166
		;;
167
	esac
168
169
	for j in $jails ; do
170
		# ignore some jails
171
		if [ -n "$security_status_baseaudit_jails_ignore" ]; then
172
			# we iterate to get exact matches because we want substring matches
173
			# foo should not match foo.bar
174
			for ignore in $security_status_baseaudit_jails_ignore ; do
175
				if [ "${j%|*}" == "$ignore" ]; then
176
					echo
177
					echo "ignoring jail: ${j%|*}"
178
					# continue with the main loop
179
					continue 2
180
				fi
181
			done
182
		fi
183
		echo
184
		echo "jail: ${j%|*}"
185
		audit_base "-j ${j%|*}" ${j##*|}
186
		last_rc=$?
187
		[ $last_rc -gt 1 ] && rc=$last_rc
188
	done
189
190
	return $rc
191
}
192
193
security_daily_compat_var security_status_baseaudit_enable
194
security_daily_compat_var security_status_baseaudit_quiet
195
security_daily_compat_var security_status_baseaudit_chroots
196
security_daily_compat_var security_status_baseaudit_jails
197
security_daily_compat_var security_status_baseaudit_exipiry
198
199
rc=0
200
201
if check_yesno_period security_status_baseaudit_enable
202
then
203
	echo
204
	echo 'Checking for security vulnerabilities in base (userland & kernel):'
205
206
	if ! ${pkgcmd} -N >/dev/null 2>&1 ; then
207
		echo 'pkg-audit is enabled but pkg is not used'
208
		rc=2
209
	else
210
		case "${security_status_baseaudit_quiet}" in
211
		[Yy][Ee][Ss])
212
			q='-q'
213
			;;
214
		*)
215
			q=
216
			;;
217
		esac
218
219
		audit_base_all ; rc=$?
220
	fi
221
fi
222
223
exit "$rc"
(-)a/security/base-audit/pkg-descr (-4 lines)
Removed Link Here
1
Audit base system against known vulnerabilities and generate reports
2
including references to security advisories.
3
It uses pkg audit and Vuxml database as is used for packages but this script
4
checks base system.
(-)a/security/base-audit/pkg-message (-22 lines)
Removed Link Here
1
[
2
{ type: install
3
  message: <<EOM
4
Add the following lines to /etc/periodic.conf(.local) to enable periodic check
5
	security_status_baseaudit_enable="YES"
6
	security_status_baseaudit_quiet="NO"
7
8
Use pkg_chroots to provide a default list of chroots
9
and pkg_jails to provide a default list of jails (or '*' for all jails)
10
for all pkg periodic scripts, or set
11
	security_status_baseaudit_chroots
12
and
13
	security_status_baseaudit_jails
14
for this script only.
15
16
You can also change following variables:
17
	security_status_baseaudit_period="daily"
18
	security_status_baseaudit_expiry="2"
19
EOM
20
}
21
]
22
- 

Return to bug 264878