Fix the rest of the analyst entries

This commit is contained in:
Mike Reeves
2023-06-26 16:26:55 -04:00
parent cb8faf7c5f
commit 6adef20a06
4 changed files with 24 additions and 23 deletions

View File

@@ -187,7 +187,7 @@
'schedule', 'schedule',
'docker_clean' 'docker_clean'
], ],
'so-workstation': [ 'so-desktop': [
], ],
}, grain='role') %} }, grain='role') %}

View File

@@ -29,7 +29,7 @@ base:
- salt.lasthighstate - salt.lasthighstate
- docker - docker
'not *_workstation and G@saltversion:{{saltversion}}': 'not *_desktop and G@saltversion:{{saltversion}}':
- match: compound - match: compound
- common - common
@@ -271,10 +271,10 @@ base:
- schedule - schedule
- docker_clean - docker_clean
'J@workstation:gui:enabled:^[Tt][Rr][Uu][Ee]$ and ( G@saltversion:{{saltversion}} and G@os:Rocky )': 'J@desktop:gui:enabled:^[Tt][Rr][Uu][Ee]$ and ( G@saltversion:{{saltversion}} and G@os:Rocky )':
- match: compound - match: compound
- workstation - desktop
'J@workstation:gui:enabled:^[Ff][Aa][Ll][Ss][Ee]$ and ( G@saltversion:{{saltversion}} and G@os:Rocky )': 'J@desktop:gui:enabled:^[Ff][Aa][Ll][Ss][Ee]$ and ( G@saltversion:{{saltversion}} and G@os:Rocky )':
- match: compound - match: compound
- workstation.remove_gui - desktop.remove_gui

View File

@@ -83,7 +83,7 @@ analyze_system() {
logCmd "ip a" logCmd "ip a"
} }
analyst_salt_local() { desktop_salt_local() {
# Install everything using local salt # Install everything using local salt
# Set the repo # Set the repo
@@ -93,9 +93,9 @@ analyst_salt_local() {
logCmd "yum -y install salt-minion-3004.1 httpd-tools python3 python36-docker python36-dateutil python36-m2crypto python36-mysql python36-packaging python36-lxml yum-utils device-mapper-persistent-data lvm2 openssl jq" logCmd "yum -y install salt-minion-3004.1 httpd-tools python3 python36-docker python36-dateutil python36-m2crypto python36-mysql python36-packaging python36-lxml yum-utils device-mapper-persistent-data lvm2 openssl jq"
logCmd "yum -y update --exclude=salt*" logCmd "yum -y update --exclude=salt*"
logCmd "salt-call state.apply workstation --local --file-root=../salt/ -l info" logCmd "salt-call state.apply desktop --local --file-root=../salt/ -l info"
read -r -d '' message <<- EOM read -r -d '' message <<- EOM
Finished Analyst workstation installation. Finished Security Onion Desktop installation.
Press the Enter key to reboot. Press the Enter key to reboot.
EOM EOM
@@ -106,19 +106,20 @@ analyst_salt_local() {
} }
analyst_workstation_pillar() { desktop_pillar() {
local pillar_file=$local_salt_dir/pillar/minions/$MINION_ID.sls local pillar_file=$local_salt_dir/pillar/minions/$MINION_ID.sls
# Create the analyst workstation pillar # Create the desktop pillar
printf '%s\n'\ printf '%s\n'\
"host:"\ "host:"\
" mainint: '$MNIC'"\ " mainint: '$MNIC'"\
"workstation:"\ "desktop:"\
" gui:"\ " gui:"\
" enabled: true" >> "$pillar_file"\ " enabled: true" >> "$pillar_file"\
"sensoroni:"\ "sensoroni:"\
" node_description: '${NODE_DESCRIPTION//\'/''}'" > $pillar_file " config:"\
" node_description: '${NODE_DESCRIPTION//\'/''}'" > $pillar_file
} }
calculate_useable_cores() { calculate_useable_cores() {
@@ -603,8 +604,8 @@ collect_webuser_inputs() {
configure_minion() { configure_minion() {
local minion_type=$1 local minion_type=$1
if [[ $is_analyst ]]; then if [[ $is_desktop ]]; then
minion_type=workstation minion_type=desktop
fi fi
info "Configuring minion type as $minion_type" info "Configuring minion type as $minion_type"
echo "role: so-$minion_type" > /etc/salt/grains echo "role: so-$minion_type" > /etc/salt/grains
@@ -1585,7 +1586,7 @@ network_init() {
title "Initializing Network" title "Initializing Network"
disable_ipv6 disable_ipv6
set_hostname set_hostname
if [[ ( $is_iso || $is_analyst_iso ) ]]; then if [[ ( $is_iso || $is_desktop_iso ) ]]; then
set_management_interface set_management_interface
fi fi
} }
@@ -1697,9 +1698,9 @@ process_installtype() {
is_import=true is_import=true
elif [ "$install_type" = 'RECEIVER' ]; then elif [ "$install_type" = 'RECEIVER' ]; then
is_receiver=true is_receiver=true
elif [ "$install_type" = 'ANALYST' ]; then elif [ "$install_type" = 'DESKTOP' ]; then
if [ "$setup_type" != 'analyst' ]; then if [ "$setup_type" != 'desktop' ]; then
exec bash so-setup analyst exec bash so-setup desktop
fi fi
fi fi
@@ -2107,10 +2108,10 @@ set_path() {
set_minion_info() { set_minion_info() {
short_name=$(echo "$HOSTNAME" | awk -F. '{print $1}') short_name=$(echo "$HOSTNAME" | awk -F. '{print $1}')
if [[ $is_analyst ]]; then if [[ $is_desktop ]]; then
MINION_ID=$(echo "${short_name}_workstation" | tr '[:upper:]' '[:lower:]') MINION_ID=$(echo "${short_name}_desktop" | tr '[:upper:]' '[:lower:]')
fi fi
if [[ ! $is_analyst ]]; then if [[ ! $is_desktop ]]; then
MINION_ID=$(echo "${short_name}_${install_type}" | tr '[:upper:]' '[:lower:]') MINION_ID=$(echo "${short_name}_${install_type}" | tr '[:upper:]' '[:lower:]')
fi fi
export MINION_ID export MINION_ID

View File

@@ -88,7 +88,7 @@ fi
# Check to see if this is an desktop install. If it is let's run things differently # Check to see if this is an desktop install. If it is let's run things differently
if [[ $is_desktop ]]; then if [[ $is_desktop ]]; then
title "This is an desktop workstation install" title "This is a desktop install"
# Make sure it's CentOS or Rocky Linux # Make sure it's CentOS or Rocky Linux
if [[ ! $is_rocky ]]; then if [[ ! $is_rocky ]]; then