mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
Merge pull request #7764 from Security-Onion-Solutions/awlocal
This commit is contained in:
@@ -138,6 +138,23 @@ analyze_system() {
|
|||||||
logCmd "ip a"
|
logCmd "ip a"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
analyst_salt_local() {
|
||||||
|
|
||||||
|
# Install everything using local salt
|
||||||
|
# Set the repo
|
||||||
|
securityonion_repo
|
||||||
|
gpg_rpm_import
|
||||||
|
# Install salt
|
||||||
|
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*"
|
||||||
|
|
||||||
|
salt-call state.apply workstation --local --file-root=../salt/ -l info 2>&1 | tee -a outfile
|
||||||
|
echo "Whiptail to reboot here"
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
analyst_workstation_pillar() {
|
analyst_workstation_pillar() {
|
||||||
|
|
||||||
local pillar_file=$temp_install_dir/pillar/minions/$MINION_ID.sls
|
local pillar_file=$temp_install_dir/pillar/minions/$MINION_ID.sls
|
||||||
@@ -2423,8 +2440,8 @@ securityonion_repo() {
|
|||||||
# update this package because the repo config files get added back
|
# update this package because the repo config files get added back
|
||||||
# if the package is updated when the update_packages function is called
|
# if the package is updated when the update_packages function is called
|
||||||
logCmd "yum -v -y update centos-release"
|
logCmd "yum -v -y update centos-release"
|
||||||
echo "Move the .repo files that were added by the centos-release package."
|
echo "Backing up the .repo files that were added by the centos-release package."
|
||||||
find /etc/yum.repos.d/ -type f -not -name 'securityonion*repo' -print0 | xargs -0 -I {} mv -bvf {} /root/oldrepos/
|
logCmd "find /etc/yum.repos.d/ -type f -not -name 'securityonion*repo' -print0 | xargs -0 -I {} mv -bvf {} /root/oldrepos/"
|
||||||
logCmd "yum repolist all"
|
logCmd "yum repolist all"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -100,11 +100,29 @@ if [[ $is_analyst ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if ! whiptail_analyst_install; then
|
if ! whiptail_analyst_install; then
|
||||||
# Lets make this a standalone
|
if [[ $is_analyst_iso ]]; then
|
||||||
echo "Enabling graphical interface and setting it to load at boot"
|
if whiptail_analyst_nongrid_iso; then
|
||||||
systemctl set-default graphical.target
|
echo "Enabling graphical interface and setting it to load at boot"
|
||||||
startx
|
systemctl set-default graphical.target
|
||||||
exit 0
|
startx
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
# Abort!
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if whiptail_analyst_nongrid_network; then
|
||||||
|
echo ""
|
||||||
|
echo ""
|
||||||
|
echo "Kicking off the automated setup of the analyst workstation. This can take a while depending on your network connection."
|
||||||
|
echo ""
|
||||||
|
echo ""
|
||||||
|
analyst_salt_local
|
||||||
|
else
|
||||||
|
# Abort!
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If you got this far then you want to join the grid
|
# If you got this far then you want to join the grid
|
||||||
|
|||||||
@@ -43,7 +43,42 @@ whiptail_analyst_install() {
|
|||||||
|
|
||||||
Would you like to join this workstation to an existing grid?
|
Would you like to join this workstation to an existing grid?
|
||||||
|
|
||||||
NOTE: Selecting "no" will enable X Windows and set it to load at boot.
|
EOM
|
||||||
|
whiptail --title "$whiptail_title" \
|
||||||
|
--yesno "$message" 11 75 --defaultno
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
whiptail_analyst_nongrid_iso() {
|
||||||
|
|
||||||
|
[ -n "$TESTING" ] && return
|
||||||
|
|
||||||
|
read -r -d '' message <<- EOM
|
||||||
|
|
||||||
|
You have selected this Analyst workstation to be independant.
|
||||||
|
|
||||||
|
Would you still like to have the graphical interface loaded at boot?
|
||||||
|
|
||||||
|
NOTE: Selecting no will exit without making changes.
|
||||||
|
|
||||||
|
EOM
|
||||||
|
whiptail --title "$whiptail_title" \
|
||||||
|
--yesno "$message" 11 75 --defaultno
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
whiptail_analyst_nongrid_network() {
|
||||||
|
|
||||||
|
[ -n "$TESTING" ] && return
|
||||||
|
|
||||||
|
read -r -d '' message <<- EOM
|
||||||
|
|
||||||
|
You have selected this Analyst workstation to be independant.
|
||||||
|
|
||||||
|
Would you still like to install and load the graphical interface?
|
||||||
|
|
||||||
|
NOTE: Selecting no will exit without making changes.
|
||||||
|
|
||||||
EOM
|
EOM
|
||||||
whiptail --title "$whiptail_title" \
|
whiptail --title "$whiptail_title" \
|
||||||
--yesno "$message" 11 75 --defaultno
|
--yesno "$message" 11 75 --defaultno
|
||||||
|
|||||||
@@ -15,6 +15,6 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
cd "$(dirname "$0")/salt/common/tools/sbin" || exit 255
|
cd "$(dirname "$0")/setup" || exit 255
|
||||||
|
|
||||||
./so-analyst-install
|
./so-setup analyst "$@"
|
||||||
|
|||||||
Reference in New Issue
Block a user