mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-19 15:33:06 +01:00
WIP soup changes
This commit is contained in:
@@ -1619,6 +1619,60 @@ verify_latest_update_script() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
verify_es_version_compatibility() {
|
||||||
|
|
||||||
|
# Define supported upgrade paths for SO ES versions
|
||||||
|
declare -A es_upgrade_map=(
|
||||||
|
["8.14.3"]="8.17.3 8.18.4 8.18.6 8.18.8"
|
||||||
|
["8.17.3"]="8.18.4 8.18.6 8.18.8"
|
||||||
|
["8.18.4"]="8.18.6 8.18.8 9.0.8"
|
||||||
|
["8.18.6"]="8.18.8 9.0.8"
|
||||||
|
["8.18.8"]="9.0.8"
|
||||||
|
)
|
||||||
|
|
||||||
|
# ES version stepping stones. Elasticsearch MUST upgrade through these versions
|
||||||
|
declare -A es_to_so_version=(
|
||||||
|
["8.18.8"]="2.4.190-20251024"
|
||||||
|
["9.0.8"]="2.4.210"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Get current Elasticsearch version
|
||||||
|
if es_version_raw=$(so-elasticsearch-query / --fail --retry 5 --retry-delay 10); then
|
||||||
|
es_version=$(echo "$es_version_raw" | jq -r '.version.number' )
|
||||||
|
else
|
||||||
|
echo "Could not determine current Elasticsearch version to validate compatibility with post soup Elasticsearch version."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Get the target ES version from the updatedir
|
||||||
|
# DOUBLE TAP ON THIS SOMEONE FROM AN OLD VERSION UPGRADING TO ANOTHER VERSION OLDER THAN 2.4.110 WOULD HAVE AN ERROR HERE. Prior to this version there was no version defined in defaults.yaml
|
||||||
|
target_es_version=$(so-yaml.py get $UPDATE_DIR/salt/elasticsearch/defaults.yaml elasticsearch.version | sed -n '1p')
|
||||||
|
|
||||||
|
if [[ " ${es_upgrade_map[$es_version]} " =~ " $target_es_version " ]]; then
|
||||||
|
# supported upgrade
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
compatible_versions=${es_upgrade_map[$es_version]}
|
||||||
|
next_step_so_version=${es_to_so_version[${compatible_versions##* }]}
|
||||||
|
echo ""
|
||||||
|
echo "You are currently running Security Onion $INSTALLEDVERSION. You will need to update to version $next_step_so_version before updating to $(cat $UPDATE_DIR/VERSION)."
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
if [[ $is_airgap -eq 0 ]]; then
|
||||||
|
echo "You can download the $next_step_so_version ISO image from https://download.securityonion.net/file/securityonion/securityonion-$next_step_so_version.iso"
|
||||||
|
else
|
||||||
|
echo "You can use the following soup command to upgrade to $next_step_so_version;"
|
||||||
|
echo " sudo BRANCH=$next_step_so_version soup"
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
echo "*** Once you have updated to $next_step_so_version, you can then run soup again to update to $(cat $UPDATE_DIR/VERSION). ***"
|
||||||
|
echo ""
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
# Keeping this block in case we need to do a hotfix that requires salt update
|
# Keeping this block in case we need to do a hotfix that requires salt update
|
||||||
apply_hotfix() {
|
apply_hotfix() {
|
||||||
if [[ "$INSTALLEDVERSION" == "2.4.20" ]] ; then
|
if [[ "$INSTALLEDVERSION" == "2.4.20" ]] ; then
|
||||||
@@ -1715,6 +1769,8 @@ main() {
|
|||||||
echo "Verifying we have the latest soup script."
|
echo "Verifying we have the latest soup script."
|
||||||
verify_latest_update_script
|
verify_latest_update_script
|
||||||
|
|
||||||
|
verify_es_version_compatibility
|
||||||
|
|
||||||
echo "Let's see if we need to update Security Onion."
|
echo "Let's see if we need to update Security Onion."
|
||||||
upgrade_check
|
upgrade_check
|
||||||
upgrade_space
|
upgrade_space
|
||||||
|
|||||||
Reference in New Issue
Block a user