mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
Correct pillar key for thehive
This commit is contained in:
@@ -40,10 +40,10 @@ test -t 0
|
|||||||
if [[ $? == 0 ]]; then
|
if [[ $? == 0 ]]; then
|
||||||
echo "Enter new password:"
|
echo "Enter new password:"
|
||||||
fi
|
fi
|
||||||
read -s PASS
|
read -s CORTEX_PASS
|
||||||
|
|
||||||
# Create new user in Cortex
|
# Create new user in Cortex
|
||||||
resp=$(curl -sk -XPOST -H "Authorization: Bearer $CORTEX_KEY" -H "Content-Type: application/json" "https://$CORTEX_IP/cortex/api/user" -d "{\"name\": \"$CORTEX_USER\",\"roles\": [\"read\",\"analyze\",\"orgadmin\"],\"organization\": \"$CORTEX_ORG_NAME\",\"login\": \"$CORTEX_USER\",\"password\" : \"$CORTEX_PASSWORD\" }")
|
resp=$(curl -sk -XPOST -H "Authorization: Bearer $CORTEX_KEY" -H "Content-Type: application/json" "https://$CORTEX_IP/cortex/api/user" -d "{\"name\": \"$CORTEX_USER\",\"roles\": [\"read\",\"analyze\",\"orgadmin\"],\"organization\": \"$CORTEX_ORG_NAME\",\"login\": \"$CORTEX_USER\",\"password\" : \"$CORTEX_PASS\" }")
|
||||||
if [[ "$resp" =~ \"status\":\"Ok\" ]]; then
|
if [[ "$resp" =~ \"status\":\"Ok\" ]]; then
|
||||||
echo "Successfully added user to Cortex."
|
echo "Successfully added user to Cortex."
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ fi
|
|||||||
|
|
||||||
USER=$1
|
USER=$1
|
||||||
|
|
||||||
THEHIVE_KEY=$(lookup_pillar thehivekey)
|
THEHIVE_KEY=$(lookup_pillar hivekey)
|
||||||
THEHIVE_IP=$(lookup_pillar managerip)
|
THEHIVE_IP=$(lookup_pillar managerip)
|
||||||
THEHIVE_USER=$USER
|
THEHIVE_USER=$USER
|
||||||
|
|
||||||
@@ -39,10 +39,10 @@ test -t 0
|
|||||||
if [[ $? == 0 ]]; then
|
if [[ $? == 0 ]]; then
|
||||||
echo "Enter new password:"
|
echo "Enter new password:"
|
||||||
fi
|
fi
|
||||||
read -s PASS
|
read -s THEHIVE_PASS
|
||||||
|
|
||||||
# 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_PASSWORD\"}")
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user