mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 09:12:45 +01:00
[fix] so-user spelling+syntax fixes
* Consistent ending punctuation * Consistent capitalization * Correct comparison operators
This commit is contained in:
@@ -48,7 +48,7 @@ fi
|
|||||||
|
|
||||||
FLEET_HASH=$(docker exec so-soctopus python -c "import bcrypt; print(bcrypt.hashpw('$FLEET_PASS'.encode('utf-8'), bcrypt.gensalt()).decode('utf-8'));" 2>&1)
|
FLEET_HASH=$(docker exec so-soctopus python -c "import bcrypt; print(bcrypt.hashpw('$FLEET_PASS'.encode('utf-8'), bcrypt.gensalt()).decode('utf-8'));" 2>&1)
|
||||||
if [[ $? -ne 0 ]]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
echo "Failed to generate Fleet password hash."
|
echo "Failed to generate Fleet password hash"
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -56,9 +56,9 @@ MYSQL_OUTPUT=$(docker exec so-mysql mysql -u root --password=$MYSQL_PASS fleet -
|
|||||||
"INSERT INTO users (password,salt,username,email,admin,enabled) VALUES ('$FLEET_HASH','','$FLEET_USER','$FLEET_USER',1,1)" 2>&1)
|
"INSERT INTO users (password,salt,username,email,admin,enabled) VALUES ('$FLEET_HASH','','$FLEET_USER','$FLEET_USER',1,1)" 2>&1)
|
||||||
|
|
||||||
if [[ $? -eq 0 ]]; then
|
if [[ $? -eq 0 ]]; then
|
||||||
echo "Successfully added user to Fleet."
|
echo "Successfully added user to Fleet"
|
||||||
else
|
else
|
||||||
echo "Unable to add user to Fleet; user might already exist."
|
echo "Unable to add user to Fleet; user might already exist"
|
||||||
echo $resp
|
echo $resp
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
usage() {
|
usage() {
|
||||||
echo "Usage: $0 <user-name>"
|
echo "Usage: $0 <user-name>"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Enables or disables a user in Fleet."
|
echo "Enables or disables a user in Fleet"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,9 +50,9 @@ MYSQL_OUTPUT=$(docker exec so-mysql mysql -u root --password=$MYSQL_PASS fleet -
|
|||||||
"UPDATE users SET enabled=$FLEET_STATUS WHERE username='$FLEET_USER'" 2>&1)
|
"UPDATE users SET enabled=$FLEET_STATUS WHERE username='$FLEET_USER'" 2>&1)
|
||||||
|
|
||||||
if [[ $? -eq 0 ]]; then
|
if [[ $? -eq 0 ]]; then
|
||||||
echo "Successfully updated user in Fleet."
|
echo "Successfully updated user in Fleet"
|
||||||
else
|
else
|
||||||
echo "Failed to update user in Fleet."
|
echo "Failed to update user in Fleet"
|
||||||
echo $resp
|
echo $resp
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
@@ -49,9 +49,9 @@ fi
|
|||||||
# Create new user in TheHive
|
# Create new user in TheHive
|
||||||
resp=$(curl -sk -XPOST -H "Authorization: Bearer $THEHIVE_KEY" -H "Content-Type: application/json" "https://$THEHIVE_IP/thehive/api/user" -d "{\"login\" : \"$THEHIVE_USER\",\"name\" : \"$THEHIVE_USER\",\"roles\" : [\"read\",\"alert\",\"write\",\"admin\"],\"preferences\" : \"{}\",\"password\" : \"$THEHIVE_PASS\"}")
|
resp=$(curl -sk -XPOST -H "Authorization: Bearer $THEHIVE_KEY" -H "Content-Type: application/json" "https://$THEHIVE_IP/thehive/api/user" -d "{\"login\" : \"$THEHIVE_USER\",\"name\" : \"$THEHIVE_USER\",\"roles\" : [\"read\",\"alert\",\"write\",\"admin\"],\"preferences\" : \"{}\",\"password\" : \"$THEHIVE_PASS\"}")
|
||||||
if [[ "$resp" =~ \"status\":\"Ok\" ]]; then
|
if [[ "$resp" =~ \"status\":\"Ok\" ]]; then
|
||||||
echo "Successfully added user to TheHive."
|
echo "Successfully added user to TheHive"
|
||||||
else
|
else
|
||||||
echo "Unable to add user to TheHive; user might already exist."
|
echo "Unable to add user to TheHive; user might already exist"
|
||||||
echo $resp
|
echo $resp
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
usage() {
|
usage() {
|
||||||
echo "Usage: $0 <user-name> <true|false>"
|
echo "Usage: $0 <user-name> <true|false>"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Enables or disables a user in thehive."
|
echo "Enables or disables a user in TheHive."
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,9 +48,9 @@ esac
|
|||||||
|
|
||||||
resp=$(curl -sk -XPATCH -H "Authorization: Bearer $THEHIVE_KEY" -H "Content-Type: application/json" "https://$THEHIVE_IP/thehive/api/user/${THEHIVE_USER}" -d "{\"status\":\"${THEHIVE_STATUS}\" }")
|
resp=$(curl -sk -XPATCH -H "Authorization: Bearer $THEHIVE_KEY" -H "Content-Type: application/json" "https://$THEHIVE_IP/thehive/api/user/${THEHIVE_USER}" -d "{\"status\":\"${THEHIVE_STATUS}\" }")
|
||||||
if [[ "$resp" =~ \"status\":\"Locked\" || "$resp" =~ \"status\":\"Ok\" ]]; then
|
if [[ "$resp" =~ \"status\":\"Locked\" || "$resp" =~ \"status\":\"Ok\" ]]; then
|
||||||
echo "Successfully updated user in thehive."
|
echo "Successfully updated user in TheHive"
|
||||||
else
|
else
|
||||||
echo "Failed to update user in thehive."
|
echo "Failed to update user in TheHive"
|
||||||
echo "$resp"
|
echo "$resp"
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
. /usr/sbin/so-common
|
. /usr/sbin/so-common
|
||||||
|
|
||||||
if [[ $# < 1 || $# > 2 ]]; then
|
if [[ $# -lt 1 || $# -gt 2 ]]; then
|
||||||
echo "Usage: $0 <list|add|update|enable|disable|validate|valemail|valpass> [email]"
|
echo "Usage: $0 <list|add|update|enable|disable|validate|valemail|valpass> [email]"
|
||||||
echo ""
|
echo ""
|
||||||
echo " list: Lists all user email addresses currently defined in the identity system"
|
echo " list: Lists all user email addresses currently defined in the identity system"
|
||||||
@@ -22,7 +22,7 @@ if [[ $# < 1 || $# > 2 ]]; then
|
|||||||
echo " valemail: Validates that the given email address is acceptable for defining a new user; requires 'email' parameter"
|
echo " valemail: Validates that the given email address is acceptable for defining a new user; requires 'email' parameter"
|
||||||
echo " valpass: Validates that a password is acceptable for defining a new user"
|
echo " valpass: Validates that a password is acceptable for defining a new user"
|
||||||
echo ""
|
echo ""
|
||||||
echo " Note that the password can be piped into stdin to avoid prompting for it."
|
echo " Note that the password can be piped into STDIN to avoid prompting for it"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user