mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
influx upgrade
This commit is contained in:
@@ -61,7 +61,6 @@ if [[ "$OP" == "add" ]]; then
|
|||||||
log "Creating new $KIND user"
|
log "Creating new $KIND user"
|
||||||
response=$(curl -sk https://localhost:8086/api/v2/users -X POST -d "{\"name\":\"$USER_EMAIL\"}" -H "Authorization: Token $TOKEN")
|
response=$(curl -sk https://localhost:8086/api/v2/users -X POST -d "{\"name\":\"$USER_EMAIL\"}" -H "Authorization: Token $TOKEN")
|
||||||
check_response "$response"
|
check_response "$response"
|
||||||
OP=password
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
log "Looking up user ID"
|
log "Looking up user ID"
|
||||||
@@ -73,6 +72,22 @@ if [[ -z "$USER_ID" ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
log "Looking up organization ID"
|
||||||
|
response=$(curl -sk https://localhost:8086/api/v2/orgs?limit=100 -H "Authorization: Token $TOKEN")
|
||||||
|
check_response "$response"
|
||||||
|
ORG_ID=$(echo "$response" | jq -r ".orgs[] | select(.name == \"Security Onion\").id")
|
||||||
|
if [[ -z "$ORG_ID" ]]; then
|
||||||
|
log "$KIND organization not found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$OP" == "add" ]]; then
|
||||||
|
log "Adding new $KIND user to organization"
|
||||||
|
response=$(curl -sk https://localhost:8086/api/v2/orgs/$ORG_ID/members -X POST -d "{\"id\":\"$USER_ID\"}" -H "Authorization: Token $TOKEN")
|
||||||
|
check_response "$response"
|
||||||
|
OP=password
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "$OP" == "password" ]]; then
|
if [[ "$OP" == "password" ]]; then
|
||||||
read_password
|
read_password
|
||||||
log "Updating $KIND user password"
|
log "Updating $KIND user password"
|
||||||
|
|||||||
Reference in New Issue
Block a user