forked from konstruktoid/hardening
-
Notifications
You must be signed in to change notification settings - Fork 0
/
packages
59 lines (43 loc) · 1.62 KB
/
packages
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
function f_package_install {
echo "[$SCRIPT_COUNT] Installing base packages"
local APPARMOR
local AUDITD
local VM
if [[ "${KEEP_SNAPD}" == "Y" ]]; then
apt-mark hold snapd
fi
APPARMOR="apparmor-profiles apparmor-utils libpam-apparmor"
AUDITD="auditd audispd-plugins"
VM=""
if dmesg | grep -i -E "dmi.*vmware"; then
VM="open-vm-tools"
fi
if dmesg | grep -i -E "dmi.*virtualbox"; then
VM="virtualbox-guest-dkms virtualbox-guest-utils"
fi
if [[ $LXC == "1" ]]; then
APPARMOR=""
AUDITD=""
fi
echo "postfix postfix/main_mailer_type select Internet Site" | debconf-set-selections
echo "postfix postfix/mailname string $(hostname -f)" | debconf-set-selections
local PACKAGE_INSTALL
PACKAGE_INSTALL="acct aide-common cracklib-runtime debsums gnupg2 haveged libpam-pwquality libpam-tmpdir needrestart openssh-server postfix psad rkhunter sysstat systemd-coredump tcpd update-notifier-common vlock $APPARMOR $AUDITD $VM"
for deb_install in $PACKAGE_INSTALL; do
$APT install -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confnew --no-install-recommends "$deb_install"
done
if [[ -f /etc/default/sysstat ]]; then
sed -i 's/ENABLED=.*/ENABLED="true"/' /etc/default/sysstat
systemctl enable sysstat
fi
((SCRIPT_COUNT++))
}
function f_package_remove {
echo "[$SCRIPT_COUNT] Package removal"
local PACKAGE_REMOVE
PACKAGE_REMOVE="apport* autofs avahi* beep git pastebinit popularity-contest rsh* rsync talk* telnet* tftp* whoopsie xinetd yp-tools ypbind"
for deb_remove in $PACKAGE_REMOVE; do
$APT purge "$deb_remove"
done
((SCRIPT_COUNT++))
}