How the attack works
GitHub Enterprise Cloud organizations and enterprises can require members to authenticate through an external identity provider with SAML single sign-on (SSO); enterprises with managed users use SAML or OpenID Connect. The identity provider then carries the controls that matter, such as multi-factor authentication, conditional access and offboarding. Organization owners configure SSO for one organization and enterprise owners for the whole enterprise, which overrides the organization settings. Owners can also hold recovery codes that bypass SSO when the identity provider is unavailable; each code can be used once and grants access for 24 hours.
An attacker who controls an owner account can disable SSO, so the identity provider no longer sees or stops access to the organization's resources. They can change the provider settings (issuer, sign-on URL, certificate) so that an identity provider they control vouches for sign-ins; with Enterprise Managed Users that provider authenticates every managed user account in the enterprise, enterprise owners included. Or they use a stolen recovery code and change nothing. Each of these is a single audit log event, and the SAML setting changes record the issuer and the sign-on URL. The provisioning side has its own events: enabling SCIM provisioning for custom integrations that use the REST API, and enabling team synchronization or changing its Okta credentials, change who can create accounts and team memberships from outside GitHub.
What an attacker needs
- Control of an organization owner or enterprise owner account, or of the setup user of an enterprise with managed users.
- For the recovery code path, one of the stored recovery codes as well.
Impact
The identity provider's controls (multi-factor authentication, conditional access, session lifetime, offboarding) stop applying to the organization or enterprise. With an attacker-controlled identity provider on an enterprise with managed users, the attacker can sign in as any managed user, including enterprise owners. Disabling SAML SSO for an organization also removes every linked external identity, so recovery means each member has to link their identity again.
Detection rules
GitHub Single Sign-On Identity Provider Settings Changed
Detects single sign-on being enabled, or the SAML provider settings (issuer, sign-on URL, certificate) being updated, for an organization or an enterprise. A changed issuer or sign-on URL can hand authentication to an identity provider the defenders do not control.
title: GitHub Single Sign-On Identity Provider Settings Changed
id: 26e16153-edeb-48db-bca7-2b3d65af7c52
status: experimental
description: >-
Detects single sign-on being enabled, or the SAML provider settings (issuer,
sign-on URL, certificate) being updated, for an organization or an
enterprise. A changed issuer or sign-on URL can hand authentication to an
identity provider the defenders do not control.
references:
- https://attack.mitre.org/techniques/T1484/002/
- https://docs.github.com/en/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/audit-log-events-for-your-organization
- https://docs.github.com/en/enterprise-cloud@latest/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/audit-log-events-for-your-enterprise
author: Forestall
date: 2026-11-11
tags:
- attack.defense-impairment
- attack.privilege-escalation
- attack.t1484.002
logsource:
product: github
service: audit
detection:
selection:
action:
- org.update_saml_provider_settings
- business.update_saml_provider_settings
- org.enable_saml
- business.enable_saml
- business.enable_oidc
condition: selection
falsepositives:
- Certificate rotation or a planned identity provider migration by the identity team. Compare the issuer and sso_url fields with the expected values and confirm the change record.
level: medium
False positives
- Certificate rotation or a planned identity provider migration by the identity team. Compare the issuer and sso_url fields with the expected values and confirm the change record.
GitHub Identity Provisioning Channel Enabled or Changed
Detects a change to the channel through which an identity system creates accounts and team memberships in GitHub. business.enable_open_scim is written when SCIM provisioning for custom integrations that use the REST API is enabled for the enterprise. With that configuration users and groups are provisioned by REST calls made with a personal access token of the enterprise's setup user. team_sync_tenant.enabled and team_sync_tenant.update_okta_credentials are written when team synchronization with an identity provider tenant is enabled and when its Okta credentials are changed. After such a change, whoever controls the token or the tenant decides who gets an account or joins a team. The actions are part of a planned identity setup as well, so each one needs the change record.
title: GitHub Identity Provisioning Channel Enabled or Changed
id: c9ac3684-7840-4644-b932-d1a343f6f80b
status: experimental
description: >-
Detects a change to the channel through which an identity system creates
accounts and team memberships in GitHub. business.enable_open_scim is
written when SCIM provisioning for custom integrations that use the REST
API is enabled for the enterprise. With that configuration users and
groups are provisioned by REST calls made with a personal access token of
the enterprise's setup user. team_sync_tenant.enabled and
team_sync_tenant.update_okta_credentials are written when team
synchronization with an identity provider tenant is enabled and when its
Okta credentials are changed. After such a change, whoever controls the
token or the tenant decides who gets an account or joins a team. The
actions are part of a planned identity setup as well, so each one needs
the change record.
references:
- https://docs.github.com/en/enterprise-cloud@latest/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/audit-log-events-for-your-enterprise
- https://docs.github.com/en/enterprise-cloud@latest/admin/managing-iam/provisioning-user-accounts-with-scim/provisioning-users-and-groups-with-scim-using-the-rest-api
- https://docs.github.com/en/enterprise-cloud@latest/organizations/managing-saml-single-sign-on-for-your-organization/managing-team-synchronization-for-your-organization
- https://attack.mitre.org/techniques/T1484/002/
author: Forestall
date: 2026-11-18
tags:
- attack.defense-impairment
- attack.privilege-escalation
- attack.t1484.002
logsource:
product: github
service: audit
detection:
selection:
action:
- business.enable_open_scim
- team_sync_tenant.enabled
- team_sync_tenant.update_okta_credentials
condition: selection
falsepositives:
- A planned move to another identity management system, the first setup of provisioning, and the rotation of the Okta token that team synchronization uses. Confirm the change with the team that runs the identity provider.
level: medium
False positives
- A planned move to another identity management system, the first setup of provisioning, and the rotation of the Okta token that team synchronization uses. Confirm the change with the team that runs the identity provider.
GitHub Single Sign-On Disabled
Detects SAML single sign-on being disabled for an organization or an enterprise, or OIDC single sign-on being disabled for an enterprise. After the change the identity provider no longer controls access to the affected resources.
title: GitHub Single Sign-On Disabled
id: 235f73cb-a753-42da-ad54-3998a060f90d
status: experimental
description: >-
Detects SAML single sign-on being disabled for an organization or an
enterprise, or OIDC single sign-on being disabled for an enterprise. After
the change the identity provider no longer controls access to the affected
resources.
references:
- https://attack.mitre.org/techniques/T1484/002/
- https://docs.github.com/en/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/audit-log-events-for-your-organization
- https://docs.github.com/en/enterprise-cloud@latest/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/audit-log-events-for-your-enterprise
author: Forestall
date: 2026-11-11
tags:
- attack.defense-impairment
- attack.privilege-escalation
- attack.t1484.002
logsource:
product: github
service: audit
detection:
selection:
action:
- org.disable_saml
- business.disable_saml
- business.disable_oidc
condition: selection
falsepositives:
- A planned migration to another identity provider, or from organization-level to enterprise-level single sign-on; a matching enable event usually follows within the same change window.
level: high
False positives
- A planned migration to another identity provider, or from organization-level to enterprise-level single sign-on; a matching enable event usually follows within the same change window.
GitHub Single Sign-On Bypassed With a Recovery Code
Detects an organization owner or enterprise owner signing in with a single sign-on recovery code, which bypasses the identity provider for 24 hours.
title: GitHub Single Sign-On Bypassed With a Recovery Code
id: 5f237a71-b408-4a0c-b325-7749715c4ddd
status: experimental
description: >-
Detects an organization owner or enterprise owner signing in with a single
sign-on recovery code, which bypasses the identity provider for 24 hours.
references:
- https://attack.mitre.org/techniques/T1484/002/
- https://docs.github.com/en/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/audit-log-events-for-your-organization
- https://docs.github.com/en/enterprise-cloud@latest/admin/managing-iam/managing-recovery-codes-for-your-enterprise/accessing-your-enterprise-account-if-your-identity-provider-is-unavailable
author: Forestall
date: 2026-11-11
tags:
- attack.defense-impairment
- attack.privilege-escalation
- attack.t1484.002
logsource:
product: github
service: audit
detection:
selection:
action:
- org.recovery_code_used
- business.recovery_code_used
condition: selection
falsepositives:
- An identity provider outage or a planned authentication change, during which owners use recovery codes as intended. Confirm the outage or the change record.
level: medium
False positives
- An identity provider outage or a planned authentication change, during which owners use recovery codes as intended. Confirm the outage or the change record.
Detection logic
Patterns that need more than one event, a baseline or knowledge of your own environment. Each is a hypothesis to build and tune in your SIEM, not a ready rule.
Identity provider group linked to a team that holds privileged access
Where team membership comes from identity provider groups, linking a group to a team gives every member of that group the access of the team, and later changes happen in the identity provider where GitHub writes no setting change. A link to a team that administers repositories or holds a privileged organization role is therefore a grant of that access to a group somebody else maintains.
- Keep a list of the teams that hold admin access to important repositories or a privileged organization role.
- A group is linked:
external_group.link. Taketeam,external_group,organdactor. - Alert when
teamis on the list, and name the group so that its members can be reviewed in the identity provider.
Eventsexternal_group.link
LimitsThe list of privileged teams is yours to maintain. Linking groups to teams is the normal way to manage membership in an enterprise with managed users, so most events are routine. Members who are later added to the group in the identity provider appear as external_group.add_member and not as a new link.
Triage
- Identify the owner who made the change (actor) and compare the issuer and sso_url fields of the event with your identity provider's values.
- Look for new owners, members, tokens or app installations by the same actor around the change.
- For a recovery code, confirm an identity provider outage or a planned change with the owner; otherwise treat the codes as stolen and generate new ones.
- If unexplained, restore the configuration, reset the actor's credentials and sessions, and review activity by accounts that signed in while the controls were off.
Response
Once the attack is confirmed:
- Restore single sign-on with the issuer, sign-on URL and certificate of your own identity provider. Take the values from your own record, not from what is in the settings now.
- Secure the owner account that made the change, or the setup user of an enterprise with managed users. Reset its password and second factor, end its sessions and revoke its tokens and SSH keys.
- Generate new recovery codes and store them with separate custody. Do this even if no code was used, as a precaution against codes that were copied.
- If an identity provider that the attacker controls was configured on an enterprise with managed users, treat every managed user account as possibly used, enterprise owners first, and review what those accounts did in that period.
- Plan the recovery for members. Disabling SAML single sign-on for an organization removes every linked external identity, so each member has to link their identity again once it is enabled.
- Remove what was added while the identity provider's controls were off, such as new owners, members, personal access tokens, SSH keys and app installations.
Mitigation
- Configure single sign-on at enterprise level where you can, so an organization owner cannot change it for one organization.
- Keep the number of owners small with phishing-resistant two-factor authentication, and store recovery codes and the setup user's credentials in a vault with separate custody.
- Stream the audit log to your SIEM and alert on every single sign-on setting change and every recovery code use.
- Keep a record of the expected issuer and sign-on URL, and compare each change against it.
Frequently asked questions
Why do members have to link their identities again after single sign-on is restored?
Disabling SAML single sign-on for an organization removes every linked external identity. Recovery therefore means that each member has to authenticate through the identity provider and link their identity again. Plan for this when you restore the configuration after an incident.
What does a single sign-on recovery code allow?
A recovery code lets an owner bypass single sign-on when the identity provider is unavailable. Each code can be used once and grants access for 24 hours. With a stolen code an attacker who holds an owner's credentials gets in without the identity provider, and no setting changes, so the use of the code is the only event.
Does the settings rule fire on a routine certificate rotation?
Yes. It matches every update of the SAML provider settings and every time single sign-on is enabled, and a certificate rotation or a planned identity provider migration looks the same. The event records the issuer and the sign-on URL, so compare the `issuer` and `sso_url` fields with the values of your own identity provider and confirm the change record.
Why is a changed identity provider worse on an enterprise with managed users?
With Enterprise Managed Users the identity provider authenticates every managed user account in the enterprise, enterprise owners included. If the settings point to an identity provider the attacker controls, that provider vouches for sign-ins, and the attacker can sign in as any managed user.
References
- MITRE ATT&CK T1484.002: Domain or Tenant Policy Modification: Trust Modification
- About identity and access management with SAML single sign-on
- Disabling SAML single sign-on for your organization
- Enforcing SAML single sign-on for your organization
- Accessing your enterprise account if your identity provider is unavailable
- Audit log events for your organization
- Audit log events for your enterprise