mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 09:12:45 +01:00
Setup Script - Add Storage Node Pillar
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
HOSTNAME=$(cat /etc/hostname)
|
||||
TOTAL_MEM=`grep MemTotal /proc/meminfo | awk '{print $2}' | sed -r 's/.{3}$//'`
|
||||
NICS=$(ip link | awk -F: '$0 !~ "lo|vir|veth|br|docker|wl|^[^0-9]"{print $2 " \"" "Interface" "\"" " OFF"}')
|
||||
|
||||
CPUCORES=$(cat /proc/cpuinfo | grep processor | wc -l)
|
||||
|
||||
# End Global Variable Section
|
||||
|
||||
@@ -129,16 +129,28 @@ master_pillar () {
|
||||
fi
|
||||
echo " lsheap: $LS_HEAP_SIZE" >> /opt/so/saltstack/pillar/masters/$HOSTNAME.sls
|
||||
echo " lsaccessip: 127.0.0.1" >> /opt/so/saltstack/pillar/masters/$HOSTNAME.sls
|
||||
if [ $INSTALLTYPE == 'BACKENDNODE' ]; then
|
||||
echo " elastalert: 0" >> /opt/so/saltstack/pillar/masters/$HOSTNAME.sls
|
||||
else
|
||||
echo " elastalert: 1" >> /opt/so/saltstack/pillar/masters/$HOSTNAME.sls
|
||||
fi
|
||||
echo " elastalert: 1" >> /opt/so/saltstack/pillar/masters/$HOSTNAME.sls
|
||||
echo " ls_pipeline_workers: $CPUCORES" >> /opt/so/saltstack/pillar/masters/$HOSTNAME.sls
|
||||
|
||||
salt-call state.highstate
|
||||
salt-key -qya $HOSTNAME
|
||||
salt-call state.highstate
|
||||
|
||||
node_pillar () {
|
||||
# Create the node pillar
|
||||
touch /tmp/$HOSTNAME.sls
|
||||
echo "node:" > /tmp/$HOSTNAME.sls
|
||||
echo " esaccessip: 127.0.0.1" >> /tmp/$HOSTNAME.sls
|
||||
echo " esheap: $ES_HEAP_SIZE" >> /tmp/$HOSTNAME.sls
|
||||
echo " esclustername: {{ grains.host }}" >> /tmp/$HOSTNAME.sls
|
||||
echo " lsheap: $LS_HEAP_SIZE" >> /tmp/$HOSTNAME.sls
|
||||
echo " lsaccessip: 127.0.0.1" >> /tmp/$HOSTNAME.sls
|
||||
echo " ls_pipeline_workers: $CPUCORES" >> /tmp/$HOSTNAME.sls
|
||||
echo " ls_pipeline_batch_size: 125" >> /tmp/$HOSTNAME.sls
|
||||
echo " ls_input_threads: 1" >> /tmp/$HOSTNAME.sls
|
||||
echo " ls_batch_count: 125" >> /tmp/$HOSTNAME.sls
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
saltify_centos () {
|
||||
@@ -189,6 +201,11 @@ whiptail_nids () {
|
||||
"Suricata" "Evaluate all the things" ON 3>&1 1>&2 2>&3 )
|
||||
}
|
||||
|
||||
whiptail_oinkcode () {
|
||||
OINKCODE=$(whiptail --title "Security Onion Setup" --inputbox \
|
||||
"Enter your oinkcode" 10 60 XXXXXXX 3>&1 1>&2 2>&3)
|
||||
}
|
||||
|
||||
whiptail_management_server () {
|
||||
MASTERSRV=$(whiptail --title "Enter your Master Server IP Address" --inputbox 10 60 1.2.3.4 3>&1 1>&2 2>&3)
|
||||
}
|
||||
@@ -272,8 +289,7 @@ if (whiptail --title "Security Onion Setup" --yesno "Are you sure you want to in
|
||||
# Get the code if it isn't ET Open
|
||||
if [ $RULESETUP != 'ETOPEN' ]; then
|
||||
# Get the code
|
||||
OINKCODE=$(whiptail --title "Security Onion Setup" --inputbox \
|
||||
"Enter your oinkcode" 10 60 XXXXXXX 3>&1 1>&2 2>&3)
|
||||
whiptail_oinkcode
|
||||
fi
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user