PTA - Risky SPN detection
Question
How does RiskySPN detection work in PTA
Environment
11.6;12.6;13.2;14.0 Privileged Access Manager (PAM, self-hosted) PTA
Answer
A number of conditions must be true for PTA to alert on a RiskySPN on an AD account
We can find the ldap query in the diamond log when the backgroundscheduler is in debug mode (changeLogLevel.sh -c 3 -l debug) and it will look like this:-
(&(samaccounttype=805306368)(!(userAccountControl:1.2.840.113556.1.4.803:=2))(serviceprincipalname=*))
The samaccountype and userAccountControl pair is looking for user accounts that aren't disabled, and then it searches for anything in the serviceprincipalname property.
If there is anything in the serviceprincipalname property then PTA needs to work out if the account is privileged. It picks this up from a couple of parameters in LOCALPARM. If PTA doesn't see that the account is privileged, you will see the following in the diamond.log and there will be no Risky SPN flag
user '<username>' is not privileged by the platform service, checking if account exists in privileged accounts collection user '<username>' is not in privileged accounts collection. user '<username>' is not privileged by the platform service
For PTA to decide that the account is privileged by the platform service, the account needs to be defined in the privileged_users_list parameter in LOCALPARM. Specifically, for a Windows user, it needs to be defined in the mUsers part of this line:-
{"mPlatform":"WINDOWS","mIsCaseSensitive":false,"mUsers":['.*admin.*']}
Usernames can be matched with a regex expression. If this line is changed then the Risky SPN will be detected after a 'service appmgr restart' is run on the PTA console and when the Risky SPN detection task next runs.
For PTA to decide that the account is in the privileged accounts collection, the user needs to be in one of the AD groups defined in the privileged_groups_list parameter in LOCALPARM.
However, adding a user to one of the defined groups does not mean the account will be detected immediately after a 'service appmgr restart' and the next running of the RiskySPN detection task. PTA has to evaluate the AD group membership first, which is done when the background AD tasks (DomainAccountsAttributesQueryTask and PrivilegeAccountQueryTask) run. By default these tasks are run once per day overnight.