T1606.002 SAML Tokens
An adversary may forge SAML tokens with any permissions claims and lifetimes if they possess a valid SAML token-signing certificate.1 The default lifetime of a SAML token is one hour, but the validity period can be specified in the NotOnOrAfter
value of the conditions …
element in a token. This value can be changed using the AccessTokenLifetime
in a LifetimeTokenPolicy
.2 Forged SAML tokens enable adversaries to authenticate across services that use SAML 2.0 as an SSO (single sign-on) mechanism.3
An adversary may utilize Private Keys to compromise an organization’s token-signing certificate to create forged SAML tokens. If the adversary has sufficient permissions to establish a new federation trust with their own Active Directory Federation Services (AD FS) server, they may instead generate their own trusted token-signing certificate.4 This differs from Steal Application Access Token and other similar behaviors in that the tokens are new and forged by the adversary, rather than stolen or intercepted from legitimate users.
An adversary may gain administrative Azure AD privileges if a SAML token is forged which claims to represent a highly privileged account. This may lead to Use Alternate Authentication Material, which may bypass multi-factor and other authentication protection mechanisms.4
Item | Value |
---|---|
ID | T1606.002 |
Sub-techniques | T1606.001, T1606.002 |
Tactics | TA0006 |
Platforms | Azure AD, Google Workspace, IaaS, Office 365, SaaS, Windows |
Permissions required | Administrator |
Version | 1.2 |
Created | 17 December 2020 |
Last Modified | 20 September 2021 |
Procedure Examples
ID | Name | Description |
---|---|---|
S0677 | AADInternals | AADInternals can be used to create SAML tokens using the AD Federated Services token signing certificate.8 |
G0016 | APT29 | APT29 created tokens using compromised SAML signing certificates.910 |
Mitigations
ID | Mitigation | Description |
---|---|---|
M1015 | Active Directory Configuration | For containing the impact of a previously forged SAML token, rotate the token-signing AD FS certificate in rapid succession twice, which will invalidate any tokens generated using the previous certificate.7 |
M1047 | Audit | Enable advanced auditing on AD FS. Check the success and failure audit options in the AD FS Management snap-in. Enable Audit Application Generated events on the AD FS farm via Group Policy Object.6 |
M1026 | Privileged Account Management | Restrict permissions and access to the AD FS server to only originate from privileged access workstations.6 |
M1018 | User Account Management | Ensure that user accounts with administrative rights follow best practices, including use of privileged access workstations, Just in Time/Just Enough Administration (JIT/JEA), and strong authentication. Reduce the number of users that are members of highly privileged Directory Roles.4 |
Detection
ID | Data Source | Data Component |
---|---|---|
DS0028 | Logon Session | Logon Session Creation |
DS0002 | User Account | User Account Authentication |
DS0006 | Web Credential | Web Credential Creation |
References
-
Lambert, J. (2020, December 13). Important steps for customers to protect themselves from recent nation-state cyberattacks. Retrieved December 17, 2020. ↩
-
Microsoft. (2020, December 14). Configurable token lifetimes in Microsoft Identity Platform. Retrieved December 22, 2020. ↩
-
Reiner, S. (2017, November 21). Golden SAML: Newly Discovered Attack Technique Forges Authentication to Cloud Apps. Retrieved December 17, 2020. ↩
-
MSRC. (2020, December 13). Customer Guidance on Recent Nation-State Cyber Attacks. Retrieved December 17, 2020. ↩↩↩
-
Sygnia. (2020, December). Detection and Hunting of Golden SAML Attack. Retrieved January 6, 2021. ↩
-
Bierstock, D., Baker, A. (2019, March 21). I am AD FS and So Can You. Retrieved December 17, 2020. ↩↩
-
Mandiant. (2021, January 19). Remediation and Hardening Strategies for Microsoft 365 to Defend Against UNC2452. Retrieved January 22, 2021. ↩
-
Dr. Nestori Syynimaa. (2018, October 25). AADInternals. Retrieved February 18, 2022. ↩
-
MSRC. (2020, December 13). Customer Guidance on Recent Nation-State Cyber Attacks. Retrieved December 30, 2020. ↩
-
Secureworks CTU. (n.d.). IRON RITUAL. Retrieved February 24, 2022. ↩