Skip to content

Commit

Permalink
Hardening | Add support to centos 7
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Martinez committed Nov 5, 2021
1 parent b8d237f commit 86a2dc8
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions shared/scripts/harden-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ curl -fsSLo "${TMP_DIR}/install-ansible.sh" https://url.fyde.me/ansible
chmod +x "${TMP_DIR}/install-ansible.sh"
"${TMP_DIR}/install-ansible.sh"

# Install unattended-upgrades/yum-cron
# unattended-upgrades/yum-cron
log_entry "INFO" "Configure automatic updates"

if [[ "${ID_LIKE:-}${ID}" =~ debian ]]; then
apt-get update
apt-get install -y \
Expand All @@ -132,8 +134,13 @@ elif [[ "${ID:-}" == "amzn" ]]; then
UPDATE_FILE="/etc/yum/yum-cron.conf"
UPDATE_SVC="yum-cron"
else
dnf install -y yum-utils epel-release
dnf install -y dnf-automatic
COMMAND=(yum)
if command -v dnf &> /dev/null; then
COMMAND=(dnf)
fi
"${COMMAND[@]}" install -y yum-utils epel-release
"${COMMAND[@]}" install -y dnf-automatic
rpm --import /etc/pki/rpm-gpg/*GPG*
UPDATE_FILE="/etc/dnf/automatic.conf"
UPDATE_SVC="dnf-automatic.timer"
fi
Expand Down

0 comments on commit 86a2dc8

Please sign in to comment.