1. Resources
  2. Detection rules
  3. SAML SSO Configuration Changed for a GitLab Group

SAML SSO Configuration Changed for a GitLab Group detection rules

The SAML single sign-on settings of a GitLab.com top-level group are created or changed. A new identity provider URL and certificate, or SSO enforcement switched off, changes who can sign in to the whole group.

Platform
GitLab
Severity
High
Log source
GitLab audit events
Last updated
Rule formats
Sigmaand queries for: Splunk
What an attacker needs
The Owner role on the top-level group, because only an Owner can change the SAML SSO settings.
Impact
Control over how every member signs in to the group, from accepting the sign-ins a replaced identity provider asserts to making a stolen password or token enough again.
Response
Put the approved identity provider URL and certificate fingerprint back, switch SSO enforcement on again, and take the Owner role from the account that made the change.
Mitigation
Keep the Owners of each top-level group few, on dedicated accounts with two-factor authentication, and compare the live settings with the approved record on a schedule.
Audit events
group_saml_provider_creategroup_saml_provider_updateupdate_mismatched_group_saml_extern_uid

How the attack works

On GitLab.com (Premium and Ultimate), the Owner of a top-level group configures SAML single sign-on on the group's Settings > SAML SSO page: the identity provider single sign-on URL, the fingerprint of the certificate that signs its responses, the default membership role for users who arrive through SSO, and the options that enforce SSO-only authentication for web and Git activity or disable password authentication for enterprise users. These few fields decide which identity provider GitLab trusts for the group and whether members must pass through it.

An attacker who holds an Owner account can point the group at an identity provider they control by replacing the URL and the certificate fingerprint, raise the default membership role, or clear the enforcement options so that members reach the group without the identity provider's multi-factor and conditional access checks. GitLab records the first configuration as group_saml_provider_create and every later change as group_saml_provider_update, one event per changed attribute, with the attribute and its old and new value in details.custom_message. SAML for a whole GitLab Self-Managed instance is set in the GitLab configuration file, not on this page. Next to the provider settings, each member's SAML identity holds the NameID by which GitLab.com identifies the user, and group Owners can change that value through the SAML API. GitLab records a changed value as update_mismatched_group_saml_extern_uid, which a separate rule on this page reads.

What an attacker needs

  • The Owner role on the top-level group.
  • Log collection: audit event streaming (Ultimate) for the top-level group, to an HTTP destination, received as JSON.

Impact

Control over how every member signs in to the group. With a replaced identity provider, GitLab accepts for the group the sign-ins that provider asserts; with enforcement off, a stolen password or token is enough again; with a higher default membership role, every account created through SSO starts with more access than intended.

Detection rules

GitLab Group SAML SSO Configuration Created or Updated

Detects the SAML single sign-on configuration of a GitLab group being created or changed (audit event types group_saml_provider_create and group_saml_provider_update). GitLab writes one event per changed attribute and names the attribute and its old and new value in details.custom_message.

LevelMediumStatusExperimentalLog sourceGitLab audit events
title: GitLab Group SAML SSO Configuration Created or Updated
id: 1a7fd2dd-6ad1-4424-87fb-8a85f025f4a5
status: experimental
description: >-
  Detects the SAML single sign-on configuration of a GitLab group being
  created or changed (audit event types group_saml_provider_create and
  group_saml_provider_update). GitLab writes one event per changed attribute
  and names the attribute and its old and new value in details.custom_message.
references:
  - https://docs.gitlab.com/user/compliance/audit_event_types/
  - https://docs.gitlab.com/user/group/saml_sso/
  - https://attack.mitre.org/techniques/T1484/002/
author: Forestall
date: 2026-11-11
tags:
  - attack.defense-impairment
  - attack.privilege-escalation
  - attack.t1484.002
logsource:
  product: gitlab
  service: audit
detection:
  selection:
    event_type:
      - group_saml_provider_create
      - group_saml_provider_update
  condition: selection
falsepositives:
  - First setup of SAML SSO and planned certificate rotation by the identity team. These changes are rare, so confirm each one.
level: medium

False positives

  • First setup of SAML SSO and planned certificate rotation by the identity team. These changes are rare, so confirm each one.

GitLab Group SAML Identity Provider Replaced or SSO Enforcement Turned Off

Detects the changes to a GitLab group's SAML SSO configuration that alter trust or weaken sign-in: a new identity provider URL or certificate fingerprint, SAML SSO disabled, or SSO enforcement for web or Git activity turned off. The rule matches the attribute names that GitLab writes into details.custom_message for group_saml_provider_update. That wording was checked against the GitLab source and is not part of a documented schema, so validate it on your version.

LevelHighStatusExperimentalLog sourceGitLab audit events
title: GitLab Group SAML Identity Provider Replaced or SSO Enforcement Turned Off
id: a3cf839c-6deb-4859-a13a-e450b1db404e
status: experimental
description: >-
  Detects the changes to a GitLab group's SAML SSO configuration that alter
  trust or weaken sign-in: a new identity provider URL or certificate
  fingerprint, SAML SSO disabled, or SSO enforcement for web or Git activity
  turned off. The rule matches the attribute names that GitLab writes into
  details.custom_message for group_saml_provider_update. That wording was
  checked against the GitLab source and is not part of a documented schema, so
  validate it on your version.
references:
  - https://docs.gitlab.com/user/compliance/audit_event_types/
  - https://docs.gitlab.com/user/compliance/audit_event_schema/
  - https://docs.gitlab.com/user/group/saml_sso/
  - https://attack.mitre.org/techniques/T1484/002/
author: Forestall
date: 2026-11-11
tags:
  - attack.defense-impairment
  - attack.privilege-escalation
  - attack.t1484.002
logsource:
  product: gitlab
  service: audit
detection:
  selection:
    event_type: group_saml_provider_update
    details.custom_message|contains:
      - 'sso_url changed'
      - 'certificate_fingerprint changed'
      - 'enabled changed from true to false'
      - 'enforced_sso changed from true to false'
      - 'git_check_enforced changed from true to false'
  condition: selection
falsepositives:
  - Planned certificate rotation, which changes the fingerprint, and a planned move to another identity provider. Match each alert to a change record.
level: high

False positives

  • Planned certificate rotation, which changes the fingerprint, and a planned move to another identity provider. Match each alert to a change record.

GitLab SAML Identity External UID Changed

Detects the external UID of a user's SAML identity being changed (audit event type update_mismatched_group_saml_extern_uid, which GitLab describes as "The external UID is changed on a SAML identity"). GitLab.com identifies a SAML user by the NameID that the identity provider sends, and group Owners can change the stored value for their members through the SAML API. A changed value ties the GitLab account to another identity at the identity provider, so a sign-in with that identity reaches the account. GitLab does not document which actions write this event or what its details hold, so the rule matches on the event type alone. The event has the User scope.

LevelMediumStatusExperimentalLog sourceGitLab audit events
title: GitLab SAML Identity External UID Changed
id: 69483518-cc10-444c-b361-e863906e9e47
status: experimental
description: >-
  Detects the external UID of a user's SAML identity being changed (audit
  event type update_mismatched_group_saml_extern_uid, which GitLab describes
  as "The external UID is changed on a SAML identity"). GitLab.com identifies
  a SAML user by the NameID that the identity provider sends, and group
  Owners can change the stored value for their members through the SAML API.
  A changed value ties the GitLab account to another identity at the
  identity provider, so a sign-in with that identity reaches the account.
  GitLab does not document which actions write this event or what
  its details hold, so the rule matches on the event type alone. The event
  has the User scope.
references:
  - https://docs.gitlab.com/user/compliance/audit_event_types/
  - https://docs.gitlab.com/user/group/saml_sso/
  - https://docs.gitlab.com/api/saml/
  - 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: gitlab
  service: audit
detection:
  selection:
    event_type: update_mismatched_group_saml_extern_uid
  condition: selection
falsepositives:
  - A planned change of the NameID format at the identity provider, after which the stored values of many members are corrected in one batch. Match the events to that change and look closely at a single account that changes outside it.
level: medium

False positives

  • A planned change of the NameID format at the identity provider, after which the stored values of many members are corrected in one batch. Match the events to that change and look closely at a single account that changes outside it.

Triage

  • Read details.custom_message to see which attribute changed and its old and new value, and entity_path for the group.
  • Identify the actor (author_name, ip_address) and confirm the change with the identity team through a separate channel. Certificate rotation changes the fingerprint only and should match a planned rotation.
  • If the URL or fingerprint is not yours, restore the approved values, then review sign-ins and new members of the group since the change.
  • Check what else the actor did in the same session, such as new Owners, SAML group links or access tokens.

Response

Once the attack is confirmed:

  1. Put the approved identity provider URL and certificate fingerprint back, switch SSO enforcement for web and Git activity on again, and return the default membership role to its recorded value.
  2. Take the Owner role from the account that made the change until it is explained, reset its credentials and revoke its tokens. Only an Owner can change these settings.
  3. Remove the members that joined the group through SSO while the unapproved provider was configured, and check the role of each remaining new member against the default membership role that was set at the time.
  4. For accounts that signed in through the unapproved provider or while enforcement was off, revoke the access tokens and SSH keys they added since the change and review what they did in the group.
  5. Compare every field of the SAML SSO page and the group's SAML group links with your record, and watch for the next group_saml_provider_update event.

Mitigation

  • Keep the Owners of each top-level group few, on dedicated accounts with two-factor authentication, because only Owners can change these settings.
  • Record the approved identity provider URL and certificate fingerprint, and compare the live settings with that record on a schedule.
  • Keep Enforce SSO-only authentication on for web and Git activity, and keep the default membership role at the lowest role that works.
  • Alert on every change to the SAML SSO configuration and treat a new URL or fingerprint as an incident until it is explained.

Frequently asked questions

How do I tell a planned certificate rotation from a replaced identity provider?

A rotation changes the certificate fingerprint only, and the new fingerprint belongs to a certificate your identity team issued. A new single sign-on URL, or a fingerprint that team does not recognise, is an incident until it is explained. Read the old and new values in `details.custom_message` and compare them with the approved URL and fingerprint on record.

Why does one edit of the SAML settings raise several alerts?

GitLab records the first configuration as `group_saml_provider_create` and every later change as `group_saml_provider_update`, one event per changed attribute. An edit that saves a new URL, a new fingerprint and a changed enforcement option therefore produces three events. Group them by actor and time before you count incidents.

Do these rules cover SAML for a GitLab Self-Managed instance?

No. The rules read the events for the SAML SSO page of a GitLab.com top-level group. SAML for a whole GitLab Self-Managed instance is set in the GitLab configuration file, not on that page, so changes there have to be caught by monitoring that file on the server.

Which rule reports a raised default membership role?

Only the broader rule, at medium level. The high rule matches a new URL or fingerprint, SAML SSO disabled, and enforcement for web or Git activity switched off. A raised default membership role arrives as an ordinary `group_saml_provider_update`, and every account created through SSO afterwards starts with that role.

References

We respect your privacy

We use cookies to keep this site secure and working properly. With your permission, we also use optional cookies to understand usage and improve the experience. Cookie Policy

You can change your choice at any time.