Skip to content

Commit

Permalink
add condition for log4j hotfix and AL2023
Browse files Browse the repository at this point in the history
  • Loading branch information
araman-m committed Apr 24, 2024
1 parent 8e4db28 commit f6963e0
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/splunkconf-cloud-recovery.sh
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,9 @@ exec >> /var/log/splunkconf-cloud-recovery-debug.log 2>&1
# 20240415 add splunkpostextrasyncdir
# 20240422 set latest var for AL2023
# 20240423 change update logic for AL2023 to run for second boot to prevent potential conflict with SSM
# 20240424 add condition logic for log4jhotfix as not needed for AL2023

VERSION="20240423a"
VERSION="20240424a"

# dont break script on error as we rely on tests for this
set +e
Expand Down Expand Up @@ -410,9 +411,14 @@ get_packages () {
fi
# one yum command so yum can try to download and install in // which will improve recovery time
yum install --setopt=skip_missing_names_on_install=True ${PACKAGELIST} -y --skip-broken
# disable as scan in permanence and not needed for splunk
systemctl stop log4j-cve-2021-44228-hotpatch
systemctl disable log4j-cve-2021-44228-hotpatch
if [ $(grep -ic PLATFORM_ID=\"platform:al2023\" /etc/os-release) -eq 1 ]; then
echo "distribution which already doenst includ log4j hotfix, no need to try disabling it"
else
# disable as scan in permanence and not needed for splunk
echo "trying to disable log4j hotfix, as perf hirt and not needed for splunk"
systemctl stop log4j-cve-2021-44228-hotpatch
systemctl disable log4j-cve-2021-44228-hotpatch
fi
fi #splunkconnectedmode
}

Expand Down

0 comments on commit f6963e0

Please sign in to comment.