View | Details | Raw Unified | Return to bug 236410
Collapse All | Expand All

(-)b/scripts/hardening (-4 / +25 lines)
Lines 32-40 Link Here
32
32
33
: ${BSDDIALOG_OK=0}
33
: ${BSDDIALOG_OK=0}
34
34
35
echo -n > $BSDINSTALL_TMPETC/rc.conf.hardening
35
# make sure the target files exist
36
echo -n > $BSDINSTALL_TMPETC/sysctl.conf.hardening
36
touch $BSDINSTALL_TMPETC/rc.conf.hardening
37
echo -n > $BSDINSTALL_TMPBOOT/loader.conf.hardening
37
touch $BSDINSTALL_TMPETC/sysctl.conf.hardening
38
touch $BSDINSTALL_TMPBOOT/loader.conf.hardening
39
40
# load the current settings
41
hide_uids=$(grep -q '^security\.bsd\.see_other_uids=0$' $BSDINSTALL_TMPETC/sysctl.conf.hardening && echo on)
42
hide_gids=$(grep -q '^security\.bsd\.see_other_gids=0$' $BSDINSTALL_TMPETC/sysctl.conf.hardening && echo on)
43
hide_jail=$(grep -q '^security\.bsd\.see_jail_proc=0$' $BSDINSTALL_TMPETC/sysctl.conf.hardening && echo on)
44
read_msgbuf=$(grep -q '^security\.bsd\.unprivileged_read_msgbuf=0$' $BSDINSTALL_TMPETC/sysctl.conf.hardening && echo on)
45
proc_debug=$(grep -q '^security\.bsd\.unprivileged_proc_debug=0$' $BSDINSTALL_TMPETC/sysctl.conf.hardening && echo on)
46
random_pid=$(grep -q '^kern\.randompid=1$' $BSDINSTALL_TMPETC/sysctl.conf.hardening && echo on)
47
clear_tmp=$(sysrc -ef $BSDINSTALL_TMPETC/rc.conf.hardening clear_tmp_enable)
48
clear_tmp=${clear_tmp#*=}
49
[ -n "$clear_tmp" -a "$clear_tmp" = '"YES"' ] && clear_tmp="on"
50
disable_syslogd=$(sysrc -ef $BSDINSTALL_TMPETC/rc.conf.hardening syslogd_flags)
51
disable_syslogd=${disable_syslogd#*=}
52
[ -n "$disable_syslogd" -a "$disable_syslogd" = '"-ss"' ] && disable_syslogd="on"
53
secure_console=$([ -f $BSDINSTALL_TMPETC/ttys.hardening ] && grep -q 'unknown	off insecure' $BSDINSTALL_TMPETC/ttys.hardening && echo "on")
54
disable_ddtrace=$(grep -q '^security\.bsd\.allow_destructive_dtrace=0$' $BSDINSTALL_TMPBOOT/loader.conf.hardening && echo on)
55
56
# reset the target files
57
: > $BSDINSTALL_TMPETC/rc.conf.hardening
58
: > $BSDINSTALL_TMPETC/sysctl.conf.hardening
59
: > $BSDINSTALL_TMPBOOT/loader.conf.hardening
38
60
39
exec 3>&1
61
exec 3>&1
40
FEATURES=$( bsddialog --backtitle "$OSNAME Installer" \
62
FEATURES=$( bsddialog --backtitle "$OSNAME Installer" \
41
- 

Return to bug 236410