Setup Script - Change layout of actions

This commit is contained in:
Mike Reeves
2018-03-22 16:00:41 -04:00
parent 922fd4b6a8
commit 15ce59682b

View File

@@ -350,59 +350,16 @@ if (whiptail_you_sure) then
fi fi
fi fi
# Configure NICs for boxes that will be running a sensor
if [ $INSTALLTYPE != 'MASTERONLY' ] || [ $INSTALLTYPE != 'STORAGENODE' ]; then
# Pick which interface you want to use as the Management if [ $INSTALLTYPE == 'SENSORONLY']; then
whiptail_management_nic whiptail_management_nic
# Filter out the management NIC from the monitor NICs
filter_nics filter_nics
# Choose what NICS to include in the bond
whiptail_bond_nics whiptail_bond_nics
fi
if [ $INSTALLTYPE == 'SENSORONLY' ] || [ $INSTALLTYPE == 'STORAGENODE' ]; then
# Get the master server for the install
whiptail_management_server whiptail_management_server
fi
# Time to get asnwers to questions so we can fill out the pillar file
if [ $INSTALLTYPE != 'MASTERONLY' ] || [ $INSTALLTYPE != 'STORAGENODE' ]; then
# Pick you NIDS. Currently on Suricata
whiptail_nids whiptail_nids
# Basic or Advanced setup?
whiptail_sensor_config whiptail_sensor_config
if [ $NSMSETUP == 'BASIC' ]; then
bro_calculate_lbprocs
fi fi
if [ $NSMSETUP == 'ADVANCED' ]; then
# Display CPU list for pinning
whiptail_bro_pins
# Pin steno
# Pin Suricata
fi
# Ask how many CPUs to use for bro
fi
if [ $INSTALLTYPE != 'SENSORONLY' ] || [ $INSTALLTYPE != 'STORAGENODE' ]; then
whiptail_rule_setup
# Get the code if it isn't ET Open
if [ $RULESETUP != 'ETOPEN' ]; then
# Get the code
whiptail_oinkcode
fi
fi
######################### #########################
## Do all the things!! ## ## Do all the things!! ##
@@ -410,96 +367,96 @@ if (whiptail_you_sure) then
# Need to ask if you are sure before proceeding # Need to ask if you are sure before proceeding
if [ $INSTALLTYPE == 'MASTERONLY']; then # if [ $INSTALLTYPE == 'MASTERONLY']; then
echo "blah" # echo "blah"
fi # fi
if [ $INSTALLTYPE == 'SENSORONLY' ]; then # if [ $INSTALLTYPE == 'SENSORONLY' ]; then
# Make this a sensor # # Make this a sensor
# Copy over the ssh key # Copy over the ssh key
copy_ssh_key # copy_ssh_key
# Create the bond interface # Create the bond interface
create_bond # create_bond
# Install Salt # Install Salt
saltify # saltify
fi # fi
if [ $INSTALLTYPE == 'STORAGENODE' ]; then # if [ $INSTALLTYPE == 'STORAGENODE' ]; then
# Make this a storage node # Make this a storage node
# Copy over the ssh key # Copy over the ssh key
copy_ssh_key # copy_ssh_key
# Install Salt # Install Salt
saltify # saltify
fi # fi
if [ $INSTALLTYPE == 'EVALMODE']; then # if [ $INSTALLTYPE == 'EVALMODE']; then
create_bond # create_bond
fi # fi
if [ $INSTALLTYPE != 'SENSORONLY' ] || [ $INSTALLTYPE != 'STORAGENODE' ]; then # if [ $INSTALLTYPE != 'SENSORONLY' ] || [ $INSTALLTYPE != 'STORAGENODE' ]; then
install_master # install_master
fi # fi
# Create so-core user # Create so-core user
mkdir -p /opt/so/conf # mkdir -p /opt/so/conf
# Create the salt directories if this isn't a stadnalone sensor # Create the salt directories if this isn't a stadnalone sensor
if [ $INSTALLTYPE != 'SENSORONLY' ] || [ $INSTALLTYPE != 'STORAGENODE' ]; then # if [ $INSTALLTYPE != 'SENSORONLY' ] || [ $INSTALLTYPE != 'STORAGENODE' ]; then
salt_directories # salt_directories
fi # fi
# Add socore user to the system # Add socore user to the system
groupadd --gid 939 socore # groupadd --gid 939 socore
$ADDUSER --uid 939 --gid 939 --home-dir /opt/so --no-create-home socore # $ADDUSER --uid 939 --gid 939 --home-dir /opt/so --no-create-home socore
chown -R 939:939 /opt/so # chown -R 939:939 /opt/so
# Add the grain on the sensor # Add the grain on the sensor
# Create the salt goodness # Create the salt goodness
if [ $INSTALLTYPE == 'SENSORONLY' ]; then # if [ $INSTALLTYPE == 'SENSORONLY' ]; then
# Create the grains file for the sensor # Create the grains file for the sensor
# SCP the pillar file to the master # SCP the pillar file to the master
scp /tmp/$HOSTNAME.sls socore@$MASTERSRV:/opt/so/saltstack/pillar/sensors/ # scp /tmp/$HOSTNAME.sls socore@$MASTERSRV:/opt/so/saltstack/pillar/sensors/
# Accept the key on the master # Accept the key on the master
ssh socore@$MASTERSRV 'sudo salt-key -ya $HOSTNAME' # ssh socore@$MASTERSRV 'sudo salt-key -ya $HOSTNAME'
# Grab the ssl key for lumberjack from the master # Grab the ssl key for lumberjack from the master
scp socore@$MASTERSRV:/some/path /some/path # scp socore@$MASTERSRV:/some/path /some/path
fi # fi
# Do that same thing on all the others but drop em into the right place # Do that same thing on all the others but drop em into the right place
if [ $INSTALLTYPE != 'SENSORONLY' ] || [ $INSTALLTYPE != 'STORAGENODE' ]; then # if [ $INSTALLTYPE != 'SENSORONLY' ] || [ $INSTALLTYPE != 'STORAGENODE' ]; then
# Create the grains file for the Master # Create the grains file for the Master
touch /etc/salt/grains # touch /etc/salt/grains
echo "role: so-master" > /etc/salt/grains # echo "role: so-master" > /etc/salt/grains
# Set up the minion to talk to itself # Set up the minion to talk to itself
echo "master: $HOSTNAME" > /etc/salt/minion # echo "master: $HOSTNAME" > /etc/salt/minion
# Copy the master config over # Copy the master config over
cp files/master /etc/salt/master # cp files/master /etc/salt/master
# Comment this out for now # Comment this out for now
# chown -R socore:socore /etc/salt # chown -R socore:socore /etc/salt
# Start salt master and minion # Start salt master and minion
service salt-master restart # service salt-master restart
service salt-minion restart # service salt-minion restart
# Sudoers # Sudoers
# Create the Master Pillar # Create the Master Pillar
es_heapsize # es_heapsize
ls_heapsize # ls_heapsize
master_pillar # master_pillar
# Determine Disk space # Determine Disk space
# Calculate half of available disk space for ELSA log_size_limit # Calculate half of available disk space for ELSA log_size_limit
@@ -518,7 +475,7 @@ if (whiptail_you_sure) then
#Click 'No' to stop setup and adjust the amount of RAM allocated to this machine.\n\ #Click 'No' to stop setup and adjust the amount of RAM allocated to this machine.\n\
#Otherwise, click 'Yes' to continue." #Otherwise, click 'Yes' to continue."
fi # fi
##MASTER ##MASTER