mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-07 01:32:47 +01:00
Ensure sqlite.db exists before querying it; Execute so-elastic-auth after common state has been applied and redirect output to setup log
This commit is contained in:
@@ -232,7 +232,7 @@ function syncElastic() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function syncAll() {
|
function syncAll() {
|
||||||
if [[ -n "$STALE_MIN" ]]; then
|
if [[ -n "$STALE_MIN" && -f "$databasePath" ]]; then
|
||||||
staleCount=$(echo "select count(*) from identity_credentials where updated_at >= Datetime('now', '-${STALE_MIN} minutes');" \
|
staleCount=$(echo "select count(*) from identity_credentials where updated_at >= Datetime('now', '-${STALE_MIN} minutes');" \
|
||||||
| sqlite3 "$databasePath")
|
| sqlite3 "$databasePath")
|
||||||
if [[ "$staleCount" == "0" ]]; then
|
if [[ "$staleCount" == "0" ]]; then
|
||||||
|
|||||||
@@ -751,7 +751,6 @@ echo "1" > /root/accept_changes
|
|||||||
|
|
||||||
set_progress_str 60 "$(print_salt_state_apply 'manager')"
|
set_progress_str 60 "$(print_salt_state_apply 'manager')"
|
||||||
salt-call state.apply -l info manager >> $setup_log 2>&1
|
salt-call state.apply -l info manager >> $setup_log 2>&1
|
||||||
ELASTIC_AUTH_SKIP_HIGHSTATE=true bash /opt/so/saltstack/default/salt/common/tools/sbin/so-elastic-auth
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set_progress_str 61 "$(print_salt_state_apply 'firewall')"
|
set_progress_str 61 "$(print_salt_state_apply 'firewall')"
|
||||||
@@ -771,6 +770,10 @@ echo "1" > /root/accept_changes
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $is_manager || $is_helix || $is_import ]]; then
|
if [[ $is_manager || $is_helix || $is_import ]]; then
|
||||||
|
echo "Executing so-elastic-auth..." >> $setup_log 2>&1
|
||||||
|
ELASTIC_AUTH_SKIP_HIGHSTATE=true bash /usr/sbin/so-elastic-auth >> $setup_log 2>&1
|
||||||
|
echo "Finished so-elastic-auth..." >> $setup_log 2>&1
|
||||||
|
|
||||||
set_progress_str 63 "$(print_salt_state_apply 'idstools')"
|
set_progress_str 63 "$(print_salt_state_apply 'idstools')"
|
||||||
create_local_nids_rules >> $setup_log 2>&1
|
create_local_nids_rules >> $setup_log 2>&1
|
||||||
salt-call state.apply -l info idstools >> $setup_log 2>&1
|
salt-call state.apply -l info idstools >> $setup_log 2>&1
|
||||||
|
|||||||
Reference in New Issue
Block a user