Error: 403 Forbidden: The credentials were incorrect or the account specified has been locked - when performing a password update or remediate task for SDDC/NSX-T in SDDC Manager.
search cancel

Error: 403 Forbidden: The credentials were incorrect or the account specified has been locked - when performing a password update or remediate task for SDDC/NSX-T in SDDC Manager.

book

Article ID: 314647

calendar_today

Updated On:

Products

VMware Cloud Foundation VMware NSX

Issue/Introduction

VMware Cloud Foundation (VCF) environments may encounter issues where the SDDC Manager is unable to perform password rotations or remediations for NSX-T Manager accounts. This occurs when credentials expire, or when repeated failed login attempts trigger the automated lockout policy on the NSX Manager nodes.

Symptoms

  • SDDC Manager Password Management shows a disconnected state for NSX admin, root, audit, or service accounts.
  • The SDDC Manager UI displays:
    Failed to get NSX user details. Cause: The credentials were incorrect or the account specified has been locked.
  • The same disconnected state and HTTP 403 at TEST_BEFORE_REMEDIATE can occur when an NSX password has expired, not only when the account is locked.
  • An API check from the SDDC Manager returns 403 on the NSX Manager VIP and on the node hosting it, but 200 on the other NSX Manager nodes.
  • UI and SSH logins with the same credentials succeed on all NSX Manager nodes.
  • The logs demonstrate a 403 Forbidden error during any NsxtApiUtil operation to get user details.

Log entries

SDDC Manager: /var/log/vmware/vcf/operationsmanager/operationsmanager.log

URI created is : https://<NSX_VIP_FQDN>/api/v1/node/users

Failed to get NSXT user details ... "error_code":403 with status : Forbidden

Password operation failed for admin

Caused by: ...HttpClientErrorException$Forbidden: 403 Forbidden: ... "The credentials were incorrect or the account specified has been locked."

NSX Manager node hosting the VIP: /var/log/proxy/reverse-proxy.log

AuthenticationBlacklistService ... User admin@<SDDC_MANAGER_IP> login lockout expired

AuthenticationBlacklistService ... Account admin@<SDDC_MANAGER_IP> has been temporarily locked for 900 seconds after <N> consecutive failed login attempts.

NSX Manager node hosting the VIP: /var/log/proxy/envoy_access_log.txt

<SDDC_MANAGER_IP> <NSX_VIP_IP> "GET" "/api/v1/node/version" "HTTP/1.1" 403 UAEX

 

 

Environment

NSX 
SDDC Manager 5.x

Cause

An expired NSX password, or a mismatch between the credential stored in SDDC Manager and the password accepted by NSX, can cause the failure without a lockout. HTTP 403 alone does not distinguish incorrect credentials, expiry or lockout.

These continuous failed authentication attempts from the SDDC Manager violate the NSX-T API security policy, triggering an automatic account lockout.

Resolution

To resolve this issue, unlock the account in question on the NSX-T Manager nodes, synchronize the credentials between NSX-T and SDDC Manager, and restore the default security policies.

Step 1: Unlock Account and Disable Lockout Policy

  1. Log in to each NSX-T Manager node via SSH using the admin credentials.

  2. Reset the admin account lockout counter:
    Note: Need to switch to root user using "st en" and use the root user password to run the following command.

    /usr/sbin/faillock --user <username> --reset

    Note: The <username> will be either root, admin, audit, or the name of the service account that has become locked.
  3. Temporarily disable the API lockout policy. This allows synchronization to occur without triggering further lockouts:
    Notes:
    1. Need to switch back to admin user with "su admin" to run the following commands.

    2. Need to run the below commands on any one of the NSX nodes and those DB values will replicate to the other nodes. Replication should complete within a couple minutes.

      set auth-policy api lockout-period 0
      set auth-policy api lockout-reset-period 0
    3. On each NSX node run the following commands to confirm the status is now "disabled" for the two configurations.

      get auth-policy api lockout-period
      get auth-policy api lockout-reset-period

Step 2: Synchronize Passwords

Choose one of the following methods to synchronize the credentials.
Note: If the password listed in SDDC manager DB for the "admin" user works to log into the NSX nodes, there is no need to update (change) the password.

Method 1: Update the NSX-T password to match the SDDC Manager database

  1. Retrieve the current database password by running the lookup_passwords command on the SDDC Manager appliance.

  2. On the NSX-T Manager node, update the admin, audit or root password to match the retrieved database password:
    set user <user> password.
  3. Confirm login with the new password, and confirm the account's password-change and expiration information. If the account's expiration policy was altered, restore it, for example to 90 days.

Method 2: Update the SDDC Manager database to match a new password

Prerequisite: Take a snapshot of the SDDC Manager virtual machine before proceeding with this method.

  1. Log in to the SDDC Manager appliance as root via SSH.

  2. Generate an API token (replace <sso username> and <sso password> with your actual SSO administrator credentials):
    TOKEN=$(curl -d '{"username" : "<sso username>", "password" : "<sso password>"}' -H "Content-Type: application/json" -X POST http://127.0.0.1/v1/tokens | jq -r '.accessToken')

  3. Query the system for the NSX-T API credentials to locate its ID:
    curl -X GET 'localhost/v1/system/credentials?entityType=NSXT_MANAGER&credentialType=API' -H 'Content-Type: application/json' -H "Authorization: Bearer $TOKEN"

  4. Push the new password into the SDDC Manager database (replace <id from above step> and <new password> with the actual values):
    curl -X PUT 'localhost/v1/system/credentials/<id from above step>' -d '<new password>' -H "Content-type:application/json" -H "Authorization: Bearer $TOKEN" | json_pp

Step 3: Finalize and Remediate

  1. Perform a rolling reboot of all NSX-T Manager nodes. This clears any active sessions and cached authentication states.

  2. Log in to the NSX Manager UI and verify that the NSX cluster is stable and healthy.

  3. Log in to the SDDC Manager UI and navigate to Security > Password Management.

  4. Run the REMEDIATE operation for the user accounts that were updated.
    1. Enter the verified current admin password and wait for successful completion.
    2.  
      Repeat for audit using the verified audit password.
  5.  
    Once remediation is successful, SSH back into any one of the NSX-T Manager nodes and restore the original lockout policy values.
    Note: The DB values will replicate to the other nodes. Replication should complete within a couple minutes.

    set auth-policy api lockout-period 900
    set auth-policy api lockout-reset-period 900

Additional Information

For more information on Authentication Policy Settings

Impact/Risks:

NOTE: The process involves minimal configuration changes on the NSX-T Managers.

  • There are no risks involved with these configuration changes.

  • This issue is being checked by Diagnostics for VMware Cloud Foundation.

  • The check is as follows:
    • Product: SDDC
    • Log File: /var/log/vmware/vcf/operationsmanager/operationsmanager.log
    • Log Expression Check "The credentials were incorrect or the account specified has been locked"