Skip to content

Commit cff20ef

Browse files
authored
More attack surface reduction
Signed-off-by: Tommy <[email protected]>
1 parent f8921b1 commit cff20ef

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

RHEL-10.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ sudo sed -i 's/umask 022/umask 077/g' /etc/bashrc
3737
# Make home directory private
3838
sudo chmod 700 /home/*
3939

40+
# Passwordless sudo
41+
sudo sed -i 's/# %wheel/%wheel/' /etc/sudoers
42+
4043
# Remove nullok
4144
sudo /usr/bin/sed -i 's/\s+nullok//g' /etc/pam.d/system-auth
4245

@@ -100,7 +103,7 @@ sudo systemctl enable --now dnf-automatic.timer
100103
sudo systemctl disable --now firewalld
101104
sudo systemctl disable --now irqbalance
102105
## rhc provides the remote remediation feature - we don't want it
103-
sudo dnf remove -y cockpit* firewalld irqbalance rhc
106+
sudo dnf remove -y audit cockpit* cronie firewalld *firmware* flashrom grub2-tools-extra iptables* irqbalance hunspell* kdump-utils kpartx mdadm microcode_ctl parted pcsc* pigz pkgconf prefixdevname rhc rootfiles sg3* sssd* tpm2-tools vim*
104107

105108
# Install hardened_malloc
106109
# Not available on RHEL 10 yet
@@ -112,8 +115,8 @@ sudo dnf remove -y cockpit* firewalld irqbalance rhc
112115
# Setup insights
113116
sudo insights-client --register
114117

115-
# Install guest agent
116-
sudo dnf install -y qemu-guest-agent
118+
# Install nano & guest agent
119+
sudo dnf install -y nano qemu-guest-agent
117120

118121
# Enable auto TRIM
119122
sudo systemctl enable fstrim.timer
@@ -127,4 +130,4 @@ sudo tuned-adm profile virtual-guest
127130
unpriv curl -s https://raw.githubusercontent.com/Metropolis-nexus/Common-Files/main/etc/issue | sudo tee /etc/issue > /dev/null
128131
sudo chmod 644 /etc/issue
129132
unpriv curl -s https://raw.githubusercontent.com/Metropolis-nexus/Common-Files/main/etc/issue | sudo tee /etc/issue.net > /dev/null
130-
sudo chmod 644 /etc/issue.net
133+
sudo chmod 644 /etc/issue.net

0 commit comments

Comments
 (0)