-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCISHardening.sh
More file actions
executable file
·61 lines (45 loc) · 1.06 KB
/
CISHardening.sh
File metadata and controls
executable file
·61 lines (45 loc) · 1.06 KB
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
#!/bin/bash
echo Securing AppArmor
sudo apt install apparmor-utils
sudo aa-enforce /etc/apparmor.d/*
echo Securing Banners
sudo chown root:root /etc/motd
sudo chmod 644 /etc/motd
sudo chown root:root /etc/issue
sudo chmod 644 /etc/issue
sudo chown root:root /etc/issue.net
sudo chmod 644 /etc/issue.net
# Insert 2.1 stuff here!
read -p "Are any xinetd services required? " -n 1 -r
echo # (optional) move to a new line
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
sudo systemctl disable xinetd
fi
# 2.1.11
sudo apt remove openbsd-inetd
# 2.2.4
sudo systemctl disable cups
# 2.2.5
sudo systemctl disable isc-dhcp-server
sudo systemctl disable isc-dhcp-server6
# 2.2.6
sudo systemctl disable slapd
# 2.2.7
read -p "Is NFS required? " -n 1 -r
echo # (optional) move to a new line
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
sudo systemctl disable nfs-server
fi
sudo systemctl disable rpcbind
# 2.2.8
sudo systemctl disable bind9
# 2.2.11
sudo systemctl disable dovecot
# 2.2.13
sudo systemctl disable squid
# 2.2.14
sudo systemctl disable snmpd
# 2.2.16
sudo systemctl disable rsync