mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
Merge pull request #965 from Security-Onion-Solutions/feature/add_gcp_check
Add GCP and make cloud check more generic
This commit is contained in:
@@ -505,10 +505,10 @@ configure_network_sensor() {
|
||||
|
||||
# Set the MTU
|
||||
if [[ $NSMSETUP != 'ADVANCED' ]]; then
|
||||
if [[ $is_ec2 ]]; then MTU=1575; else MTU=1500; fi
|
||||
if [[ $is_cloud ]]; then MTU=1575; else MTU=1500; fi
|
||||
fi
|
||||
|
||||
if [[ $is_ec2 ]]; then
|
||||
if [[ $is_cloud ]]; then
|
||||
INTERFACE=${BNICS[0]}
|
||||
local nmcli_con_arg="type ethernet"
|
||||
else
|
||||
@@ -553,7 +553,7 @@ configure_network_sensor() {
|
||||
ethtool -K "$BNIC" $i off >> "$setup_log" 2>&1
|
||||
done
|
||||
|
||||
if [[ $is_ec2 ]]; then
|
||||
if [[ $is_cloud ]]; then
|
||||
nmcli con up "$BNIC" >> "$setup_log" 2>&1
|
||||
else
|
||||
# Check if the bond slave connection has already been created
|
||||
@@ -583,9 +583,9 @@ configure_network_sensor() {
|
||||
fi
|
||||
}
|
||||
|
||||
detect_ec2() {
|
||||
echo "Testing if setup is running on an EC2 instance"
|
||||
if ( curl --fail -s -m 5 http://169.254.169.254/latest/meta-data/instance-id > /dev/null ); then export is_ec2="true"; fi
|
||||
detect_cloud() {
|
||||
echo "Testing if setup is running on a cloud instance"
|
||||
if ( curl --fail -s -m 5 http://169.254.169.254/latest/meta-data/instance-id > /dev/null ) || ( dmidecode -s bios-vendor | grep -q Google > /dev/null); then export is_cloud="true"; fi
|
||||
}
|
||||
|
||||
detect_os() {
|
||||
|
||||
@@ -109,7 +109,7 @@ export PATH=$PATH:../salt/common/tools/sbin
|
||||
|
||||
got_root
|
||||
|
||||
detect_os && detect_ec2
|
||||
detect_os && detect_cloud
|
||||
set_network_dev_status_list
|
||||
|
||||
if [ "$OS" == ubuntu ]; then
|
||||
|
||||
Reference in New Issue
Block a user