Workaround for FleetDM PW Req

This commit is contained in:
Josh Brower
2023-02-08 13:03:33 -05:00
parent 6adb586bb4
commit e07f4bd0ed
2 changed files with 7 additions and 2 deletions

View File

@@ -53,8 +53,10 @@ if [[ $? -ne 0 ]]; then
exit 2
fi
TEMPPW=$FLEET_SA_PW!
# Create New User
CREATE_OUTPUT=$(docker exec so-fleet fleetctl user create --email $USER_EMAIL --name $USER_EMAIL --password $USER_PASS --global-role admin 2>&1)
CREATE_OUTPUT=$(docker exec so-fleet fleetctl user create --email $USER_EMAIL --name $USER_EMAIL --password $TEMPPW --global-role admin 2>&1)
if [[ $? -eq 0 ]]; then
echo "Successfully added user to Fleet"
@@ -64,6 +66,9 @@ else
exit 2
fi
# Reset New User Password to user supplied password
echo "$USER_PW" | so-fleet-user-update "$USER_EMAIL"
# Disable forced password reset
MYSQL_OUTPUT=$(docker exec so-mysql mysql -u root --password=$MYSQL_PW fleet -e \
"UPDATE users SET admin_forced_password_reset = 0 WHERE email = '$USER_EMAIL'" 2>&1)

View File

@@ -1511,7 +1511,7 @@ generate_passwords(){
PLAYBOOKADMINPASS=$(get_random_value)
PLAYBOOKAUTOMATIONPASS=$(get_random_value)
FLEETPASS=$(get_random_value)
FLEETSAPASS=$(get_random_value)
FLEETSAPASS="$(get_random_value)!"
FLEETJWT=$(get_random_value)
GRAFANAPASS=$(get_random_value)
SENSORONIKEY=$(get_random_value)