mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-07 01:32:47 +01:00
Disk Space Check
This commit is contained in:
@@ -36,9 +36,85 @@ manager_check() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
echo "Checking to see if this is a manager."
|
||||||
|
echo ""
|
||||||
|
manager_check
|
||||||
|
|
||||||
|
# List all the containers
|
||||||
|
if [ $MANAGERCHECK == 'so-import' ]; then
|
||||||
|
TRUSTED_CONTAINERS=( \
|
||||||
|
"so-idstools" \
|
||||||
|
"so-nginx" \
|
||||||
|
"so-filebeat" \
|
||||||
|
"so-suricata" \
|
||||||
|
"so-soc" \
|
||||||
|
"so-elasticsearch" \
|
||||||
|
"so-kibana" \
|
||||||
|
"so-kratos" \
|
||||||
|
"so-suricata" \
|
||||||
|
"so-registry" \
|
||||||
|
"so-pcaptools" \
|
||||||
|
"so-zeek" )
|
||||||
|
elif [ $MANAGERCHECK != 'so-helix' ]; then
|
||||||
|
TRUSTED_CONTAINERS=( \
|
||||||
|
"so-acng" \
|
||||||
|
"so-thehive-cortex" \
|
||||||
|
"so-curator" \
|
||||||
|
"so-domainstats" \
|
||||||
|
"so-elastalert" \
|
||||||
|
"so-elasticsearch" \
|
||||||
|
"so-filebeat" \
|
||||||
|
"so-fleet" \
|
||||||
|
"so-fleet-launcher" \
|
||||||
|
"so-freqserver" \
|
||||||
|
"so-grafana" \
|
||||||
|
"so-idstools" \
|
||||||
|
"so-influxdb" \
|
||||||
|
"so-kibana" \
|
||||||
|
"so-kratos" \
|
||||||
|
"so-logstash" \
|
||||||
|
"so-minio" \
|
||||||
|
"so-mysql" \
|
||||||
|
"so-nginx" \
|
||||||
|
"so-pcaptools" \
|
||||||
|
"so-playbook" \
|
||||||
|
"so-redis" \
|
||||||
|
"so-soc" \
|
||||||
|
"so-soctopus" \
|
||||||
|
"so-steno" \
|
||||||
|
"so-strelka-frontend" \
|
||||||
|
"so-strelka-manager" \
|
||||||
|
"so-strelka-backend" \
|
||||||
|
"so-strelka-filestream" \
|
||||||
|
"so-suricata" \
|
||||||
|
"so-telegraf" \
|
||||||
|
"so-thehive" \
|
||||||
|
"so-thehive-es" \
|
||||||
|
"so-wazuh" \
|
||||||
|
"so-zeek" )
|
||||||
|
else
|
||||||
|
TRUSTED_CONTAINERS=( \
|
||||||
|
"so-filebeat" \
|
||||||
|
"so-idstools" \
|
||||||
|
"so-logstash" \
|
||||||
|
"so-nginx" \
|
||||||
|
"so-redis" \
|
||||||
|
"so-steno" \
|
||||||
|
"so-suricata" \
|
||||||
|
"so-telegraf" \
|
||||||
|
"so-zeek" )
|
||||||
|
fi
|
||||||
|
OLD_VERSIONS=( \
|
||||||
|
"2.0.0-rc.1" \
|
||||||
|
"2.0.2-rc.1" \
|
||||||
|
"2.0.3-rc.1" )
|
||||||
|
|
||||||
clean_dockers() {
|
clean_dockers() {
|
||||||
# Place Holder for cleaning up old docker images
|
# Place Holder for cleaning up old docker images
|
||||||
echo ""
|
echo "Trying to clean up old dockers."
|
||||||
|
docker system prune -a -f
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
clone_to_tmp() {
|
clone_to_tmp() {
|
||||||
@@ -185,72 +261,20 @@ rc2_to_rc3() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
update_dockers() {
|
space_check() {
|
||||||
# List all the containers
|
# Check to see if there is enough space
|
||||||
if [ $MANAGERCHECK == 'so-import' ]; then
|
CURRENTSPACE=$(df -BG / | grep -v Avail | awk '{print $4}')
|
||||||
TRUSTED_CONTAINERS=( \
|
if [ "$CURRENTSPACE" -lt "1000" ]; then
|
||||||
"so-idstools" \
|
read -rsn1 -p"You are low on disk space. Upgrade will try and clean up space. Press any key to continue or Ctrl+c to exit";
|
||||||
"so-nginx" \
|
clean_dockers
|
||||||
"so-filebeat" \
|
|
||||||
"so-suricata" \
|
|
||||||
"so-soc" \
|
|
||||||
"so-elasticsearch" \
|
|
||||||
"so-kibana" \
|
|
||||||
"so-kratos" \
|
|
||||||
"so-suricata" \
|
|
||||||
"so-registry" \
|
|
||||||
"so-pcaptools" \
|
|
||||||
"so-zeek" )
|
|
||||||
elif [ $MANAGERCHECK != 'so-helix' ]; then
|
|
||||||
TRUSTED_CONTAINERS=( \
|
|
||||||
"so-acng" \
|
|
||||||
"so-thehive-cortex" \
|
|
||||||
"so-curator" \
|
|
||||||
"so-domainstats" \
|
|
||||||
"so-elastalert" \
|
|
||||||
"so-elasticsearch" \
|
|
||||||
"so-filebeat" \
|
|
||||||
"so-fleet" \
|
|
||||||
"so-fleet-launcher" \
|
|
||||||
"so-freqserver" \
|
|
||||||
"so-grafana" \
|
|
||||||
"so-idstools" \
|
|
||||||
"so-influxdb" \
|
|
||||||
"so-kibana" \
|
|
||||||
"so-kratos" \
|
|
||||||
"so-logstash" \
|
|
||||||
"so-minio" \
|
|
||||||
"so-mysql" \
|
|
||||||
"so-nginx" \
|
|
||||||
"so-pcaptools" \
|
|
||||||
"so-playbook" \
|
|
||||||
"so-redis" \
|
|
||||||
"so-soc" \
|
|
||||||
"so-soctopus" \
|
|
||||||
"so-steno" \
|
|
||||||
"so-strelka-frontend" \
|
|
||||||
"so-strelka-manager" \
|
|
||||||
"so-strelka-backend" \
|
|
||||||
"so-strelka-filestream" \
|
|
||||||
"so-suricata" \
|
|
||||||
"so-telegraf" \
|
|
||||||
"so-thehive" \
|
|
||||||
"so-thehive-es" \
|
|
||||||
"so-wazuh" \
|
|
||||||
"so-zeek" )
|
|
||||||
else
|
else
|
||||||
TRUSTED_CONTAINERS=( \
|
echo "Plenty of space for upgrading"
|
||||||
"so-filebeat" \
|
|
||||||
"so-idstools" \
|
|
||||||
"so-logstash" \
|
|
||||||
"so-nginx" \
|
|
||||||
"so-redis" \
|
|
||||||
"so-steno" \
|
|
||||||
"so-suricata" \
|
|
||||||
"so-telegraf" \
|
|
||||||
"so-zeek" )
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
update_dockers() {
|
||||||
|
|
||||||
# Download the containers from the interwebs
|
# Download the containers from the interwebs
|
||||||
for i in "${TRUSTED_CONTAINERS[@]}"
|
for i in "${TRUSTED_CONTAINERS[@]}"
|
||||||
do
|
do
|
||||||
@@ -350,9 +374,6 @@ while getopts ":b" opt; do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "Checking to see if this is a manager."
|
|
||||||
echo ""
|
|
||||||
manager_check
|
|
||||||
echo "Found that Security Onion $INSTALLEDVERSION is currently installed."
|
echo "Found that Security Onion $INSTALLEDVERSION is currently installed."
|
||||||
echo ""
|
echo ""
|
||||||
detect_os
|
detect_os
|
||||||
|
|||||||
Reference in New Issue
Block a user