mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
fix user sync issue after setup finishes
This commit is contained in:
@@ -496,19 +496,6 @@ EOF
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function migrateLockedUsers() {
|
|
||||||
# This is a migration function to convert locked users from prior to 2.3.90
|
|
||||||
# to inactive users using the newer Kratos functionality. This should only
|
|
||||||
# find locked users once.
|
|
||||||
lockedEmails=$(curl -s ${kratosUrl}/identities | jq -r '.[] | select(.traits.status == "locked") | .traits.email')
|
|
||||||
if [[ -n "$lockedEmails" ]]; then
|
|
||||||
echo "Disabling locked users..."
|
|
||||||
for email in $lockedEmails; do
|
|
||||||
updateStatus "$email" locked
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateStatus() {
|
function updateStatus() {
|
||||||
email=$1
|
email=$1
|
||||||
status=$2
|
status=$2
|
||||||
@@ -703,11 +690,6 @@ case "${operation}" in
|
|||||||
echo "Password is acceptable"
|
echo "Password is acceptable"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"migrate")
|
|
||||||
migrateLockedUsers
|
|
||||||
echo "User migration complete"
|
|
||||||
;;
|
|
||||||
|
|
||||||
*)
|
*)
|
||||||
fail "Unsupported operation: $operation"
|
fail "Unsupported operation: $operation"
|
||||||
usage
|
usage
|
||||||
|
|||||||
@@ -68,9 +68,7 @@ add_web_user() {
|
|||||||
wait_for_file /nsm/kratos/db/db.sqlite 30 5
|
wait_for_file /nsm/kratos/db/db.sqlite 30 5
|
||||||
{
|
{
|
||||||
info "Attempting to add administrator user for web interface...";
|
info "Attempting to add administrator user for web interface...";
|
||||||
export SKIP_STATE_APPLY=true
|
|
||||||
echo "$WEBPASSWD1" | /usr/sbin/so-user add --email "$WEBUSER" --role "superuser";
|
echo "$WEBPASSWD1" | /usr/sbin/so-user add --email "$WEBUSER" --role "superuser";
|
||||||
unset SKIP_STATE_APPLY
|
|
||||||
info "Add user result: $?";
|
info "Add user result: $?";
|
||||||
} >> "/root/so-user-add.log" 2>&1
|
} >> "/root/so-user-add.log" 2>&1
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user