TPF error when using gMSA database authentication: Could not switch to service account context

TPF error when using gMSA database authentication: Could not switch to service account context

203
Created On 11/10/26 11:02 AM - Last Modified 11/10/26 12:58 PM


Symptom


Attempting to install Trust Protection Foundation (TPF) using gMSA database authentication method will return the following error message:

Could not impersonate for database access permissions. Error: Could not switch to service account context

(Trying to switch credentials on an existing TPF instance to gMSA will also encounter this error).

 



Environment


24.3;25.1;25.3;26.1 TPP/TLSPDC TLSPDC

Operating System: 

Database Authentication Method:



Cause


A recent Microsoft update designed to harden the LSASS.exe system process has resulted in this gMSA error. This affects newer and patched versions of Windows Server OS.

 

Run the below PowerShell commands to verify if your system has LSASS protection enabled. If you see "LSASS.exe was started as a protected process with level: 4" and the event timestamp matches the boot time, this is the problem. 

Get-WinEvent -FilterHashtable @{LogName="System"; ProviderName="Microsoft-Windows-Wininit"; Id=12} -MaxEvents 1 | Format-List TimeCreated, Message

(Get-CimInstance Win32_OperatingSystem).LastBootUpTime


Resolution


There is a fix for this issue for each of the most recent patch to all supported versions. Please see the Marketplace to find the latest release and check the release notes, then determine if a patch is the best solution.

The recommended workaround is to use SQL Accounts or Windows Authentication to authenticate to the database. Alternatively, you can disable LSASS.exe protection with the steps below.

 

  1. Backup your TPP node (e.g. VM snapshot).
  2. Set registry flag to zero:
    1. reg add "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v RunAsPPL /t REG_DWORD /d 0 /f
  3. Shutdown the server (Full shutdown, not a restart).
  4. Disable Secure Boot (BIOS, vSphere VM settings, or Hyper-V settings).
  5. Run this PowerShell command and verify the event timestamp is older than the boot time:
    1. Get-WinEvent -FilterHashtable @{LogName="System"; ProviderName="Microsoft-Windows-Wininit"; Id=12} -MaxEvents 1 | Format-List TimeCreated, Message
      (Get-CimInstance Win32_OperatingSystem).LastBootUpTime
  6. Retry the gMSA operation.
  7. If it still fails, reboot the server again.
  8. Once gMSA is confirmed working, we can re-enable secure boot.
  9. Shut down the server.
  10. Re-enable secure boot (BIOS, vSphere VM settings, or Hyper-V settings).
  11. Start the server.
  12. Verify gMSA still works.
  13. Since RunAsPPL is set to zero, re-enabling secure boot should not reactivate the protection.
  14. Process complete.
  15. Please see security risk associated with this change below.

 

Security risks when disabling RunAsPPL:

RunAsPPL is a registry switch that tells Windows: "protect LSASS — don't let other programs read its memory, even admin tools."

  With it on, the easy credential-stealing tools (Mimikatz, ProcDump against LSASS, etc.) just fail.

  Risks of turning it off

  1. Credential dumping becomes trivial. Any admin-level malware can read LSASS and walk out with:
    - Windows password hashes for every recently-logged-on user
    - Kerberos tickets (which can be replayed)
    - gMSA service-account keys
    - Saved browser/Wi-Fi/RDP passwords (via DPAPI keys)
  2. One compromised server = many. Because gMSAs are shared across machines, losing the key from one box gives the attacker that identity everywhere it runs.
  3. No safety net. If you also don't have Credential Guard (the stronger, hardware-backed version), LSASS has zero protection.
  4. Compliance failure. CIS, DISA, Microsoft baselines, and most cyber-insurance audits expect RunAsPPL on. Turning it off is a documented finding.
  5. Wider door for driver-based attacks. RunAsPPL also blocks unsigned/dodgy drivers from poking at LSASS; without it, "bring your own vulnerable driver" attacks get easier.


Actions
  • Print
  • Copy Link

    https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA1hj0000000jn0CAA&lang=en_US&refURL=http%3A%2F%2Fknowledgebase.paloaltonetworks.com%2FKCSArticleDetail