mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-08 02:02:50 +01:00
Perform full email match
This commit is contained in:
@@ -310,7 +310,7 @@ function listUsers() {
|
||||
|
||||
users=$(echo "${response}" | jq -r ".[] | .verifiable_addresses[0].value" | sort)
|
||||
for user in $users; do
|
||||
roles=$(grep "$user" "$elasticRolesFile" | cut -d: -f1 | tr '\n' ' ')
|
||||
roles=$(grep ":$user\$" "$elasticRolesFile" | cut -d: -f1 | tr '\n' ' ')
|
||||
echo "$user: $roles"
|
||||
done
|
||||
}
|
||||
@@ -341,7 +341,7 @@ function adjustUserRole() {
|
||||
|
||||
filename="$socRolesFile"
|
||||
hasRole=0
|
||||
grep "$role:" "$socRolesFile" | grep -q "$identityId" && hasRole=1
|
||||
grep "^$role:" "$socRolesFile" | grep -q "$identityId" && hasRole=1
|
||||
if [[ "$op" == "add" ]]; then
|
||||
if [[ "$hasRole" == "1" ]]; then
|
||||
echo "User '$email' already has the role: $role"
|
||||
|
||||
Reference in New Issue
Block a user