1. Resources
  2. Detection rules
  3. Webhook or System Hook Created or Changed in GitLab

Webhook or System Hook Created or Changed in GitLab detection rules

A webhook is added to a GitLab project or group, a system hook to the instance, or an existing one is changed, so GitLab sends a copy of every subscribed event to a server the attacker controls.

Platform
GitLab
Severity
Medium
Log source
GitLab audit events
Last updated
Rule formats
Sigmaand queries for: Splunk
What an attacker needs
The Maintainer or Owner role on a project, the Owner role on a group, or administrator access for a system hook.
Impact
GitLab sends the payloads of commits, merge requests, comments and pipelines to the attacker's server for as long as the hook exists.
Response
Delete or restore the hook, list what its recent requests sent, and secure the account that made the change.
Mitigation
Keep an inventory of webhooks and system hooks with their URLs and owners, and alert on every new or changed one.
Audit events
webhook_createdwebhook_updated
Threat groups
None listed in MITRE ATT&CK for this technique

How the attack works

A webhook tells GitLab to send an HTTP POST request with detailed information about an event to an external URL whenever that event happens. A project webhook covers one project. A group webhook (Premium and Ultimate) sends notifications for events across all projects in a group and its subgroups, and adds group events such as members, projects and subgroups being added or removed. A system hook, on GitLab Self-Managed and GitLab Dedicated, covers a whole organization, which on an instance with only the default organization is the entire instance: user creation, SSH keys, project and group changes, and optionally pushes and merge requests from any project. Teams use hooks to trigger deployments, to notify chat tools and to feed issue trackers.

The same mechanism gives an attacker a standing feed. A user with the Maintainer or Owner role can create a project webhook, a group Owner a group webhook, and an administrator a system hook. A new hook that points to an outside server, or an existing hook whose URL or triggers were changed, delivers the payloads of the subscribed events for as long as it exists, with no further sign-in by the attacker. A push event names the commits with their messages, authors and changed file paths, and other events carry merge requests, comments, pipelines, jobs and vulnerabilities. GitLab records the creation as webhook_created, a change as webhook_updated (GitLab 19.6 and later) and a deletion as webhook_destroyed, each for projects, groups and the instance.

What an attacker needs

  • The Maintainer or Owner role on the project for a project webhook.
  • The Owner role on the group for a group webhook, which needs Premium or Ultimate.
  • Administrator access for a system hook on GitLab Self-Managed or GitLab Dedicated.
  • A server that GitLab can reach to receive the requests.
  • Log collection: audit event streaming (Ultimate) for the top-level group or the instance, to an HTTP destination, received as JSON. System hook events need the instance stream.

Impact

GitLab pushes event payloads to the attacker's server as the events happen. Depending on the triggers these describe commits and the files they touch, the text of merge requests, issues and comments, pipeline and job results, releases and vulnerabilities, and for group webhooks and system hooks also new members, new projects, new users and SSH keys. The feed keeps running after the attacker's session or token is gone, because the hook belongs to the project, group or instance, and it shows the attacker when defenders start to change things. A hook that already feeds a build or deployment system can also be pointed elsewhere, which takes the events away from the system that was meant to receive them.

Detection rules

GitLab Project or Group Webhook Created or Updated

Detects a webhook being created (audit event type webhook_created, GitLab 17.1 and later) or updated (webhook_updated, GitLab 19.6 and later) on a project or a group. From then on GitLab sends the payload of every selected event to the URL of the webhook: for a group webhook the events of all projects in the group and its subgroups. The Maintainer or Owner role on a project and the Owner role on a group are enough to add one. The event type reference lists the events without their fields, so the rule cannot read the URL. It matches on the event type and keeps events whose entity_type is Project or Group. Open the webhook settings to see where the data goes.

LevelMediumStatusExperimentalLog sourceGitLab audit events
title: GitLab Project or Group Webhook Created or Updated
id: bf778592-8d8a-4d05-93be-42e51f31da61
status: experimental
description: >-
  Detects a webhook being created (audit event type webhook_created,
  GitLab 17.1 and later) or updated (webhook_updated, GitLab 19.6 and
  later) on a project or a group. From then on GitLab sends the payload
  of every selected event to the URL of the webhook: for a group webhook
  the events of all projects in the group and its subgroups. The
  Maintainer or Owner role on a project and the Owner role on a group
  are enough to add one. The event type reference lists the events
  without their fields, so the rule cannot read the URL. It matches on
  the event type and keeps events whose entity_type is Project or Group.
  Open the webhook settings to see where the data goes.
references:
  - https://docs.gitlab.com/user/compliance/audit_event_types/
  - https://docs.gitlab.com/user/compliance/audit_event_schema/
  - https://docs.gitlab.com/user/project/integrations/webhooks/
  - https://attack.mitre.org/techniques/T1567/004/
author: Forestall
date: 2026-11-18
tags:
  - attack.exfiltration
  - attack.t1567.004
logsource:
  product: gitlab
  service: audit
detection:
  selection:
    event_type:
      - webhook_created
      - webhook_updated
    entity_type:
      - Project
      - Group
  condition: selection
falsepositives:
  - Teams that connect a project to a chat tool, an issue tracker or a deployment system. Confirm the receiving URL with the owner of the project.
  - Infrastructure as code that manages webhooks and writes them again on every run. Exclude its account by author_id once confirmed.
level: medium

False positives

  • Teams that connect a project to a chat tool, an issue tracker or a deployment system. Confirm the receiving URL with the owner of the project.
  • Infrastructure as code that manages webhooks and writes them again on every run. Exclude its account by author_id once confirmed.

GitLab System Hook Created or Updated

Detects a hook being created (audit event type webhook_created) or updated (webhook_updated, GitLab 19.6 and later) outside a project or a group. The event types have the Project, Group and Instance scopes, and the instance scope is the system hook of GitLab Self-Managed and GitLab Dedicated. A system hook receives events from the whole organization: user creation, SSH keys, project and group changes, and optionally pushes and merge requests from any project. Only an administrator can create one. GitLab does not document the entity_type value of an instance event, so the rule excludes the documented values Project and Group instead of naming the instance. Confirm on a test hook that a system hook reaches the rule on your version.

LevelHighStatusExperimentalLog sourceGitLab audit events
title: GitLab System Hook Created or Updated
id: a926e1f4-ba17-4f84-bf98-8979989360ec
status: experimental
description: >-
  Detects a hook being created (audit event type webhook_created) or
  updated (webhook_updated, GitLab 19.6 and later) outside a project or
  a group. The event types have the Project, Group and Instance scopes,
  and the instance scope is the system hook of GitLab Self-Managed and
  GitLab Dedicated. A system hook receives events from the whole
  organization: user creation, SSH keys, project and group changes, and
  optionally pushes and merge requests from any project. Only an
  administrator can create one. GitLab does not document the entity_type
  value of an instance event, so the rule excludes the documented values
  Project and Group instead of naming the instance. Confirm on a test
  hook that a system hook reaches the rule 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/administration/system_hooks/
  - https://attack.mitre.org/techniques/T1567/004/
author: Forestall
date: 2026-11-18
tags:
  - attack.exfiltration
  - attack.t1567.004
logsource:
  product: gitlab
  service: audit
detection:
  selection:
    event_type:
      - webhook_created
      - webhook_updated
  filter_project_or_group:
    entity_type:
      - Project
      - Group
  condition: selection and not filter_project_or_group
falsepositives:
  - An administrator who adds a system hook for a known integration, for example user provisioning or a mirror of repository events. System hooks change rarely, so confirm each one against a change request.
level: high

False positives

  • An administrator who adds a system hook for a known integration, for example user provisioning or a mirror of repository events. System hooks change rarely, so confirm each one against a change request.

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.

Webhook created and destroyed again within a short time

Detection hypothesisSequence of events

A webhook that an integration needs stays in place. A webhook that is created and deleted again within hours or days was either a test or a feed that someone wanted for a limited time and then removed, which also removes it from the next review of the webhook inventory.

  1. A webhook is created: the audit event type webhook_created. Keep the project or group (entity_type, entity_path), the account (author_id) and the time.
  2. Look for webhook_destroyed with the same entity_path within the next 7 days.
  3. Compare the author_id of both events, and read the events of that account in between, such as new tokens, exports and changes of role.

Eventswebhook_createdwebhook_destroyed

LimitsGitLab does not document a field that identifies the webhook in these events, so on a project with several webhooks the deleted one may not be the one that was created. Developers who test an integration produce the same pair. The 7 days are a starting point.

Triage

  • Identify who made the change (author_name, author_id, ip_address) and where (entity_type, entity_path).
  • Open the webhook in Settings, Webhooks of the project or group, or the system hook in the Admin area, and read its URL, its triggers, its custom headers and whether a custom webhook template is set.
  • Ask who owns the receiving server. A URL on a domain the organization does not own, a URL with masked portions that nobody can explain or a webhook with SSL verification switched off needs an answer.
  • Read the Recent events section of the webhook. It shows all requests of the last two days, and the details of each request hold the body and the headers that GitLab sent.
  • Check whether the acting account was given the Maintainer or Owner role shortly before, and whether it created tokens, deploy keys or other webhooks in the same period.

Response

Once the attack is confirmed:

  1. Delete the hook, or set its URL and triggers back to the previous values when an existing hook was changed.
  2. Before the deletion, list from Recent events what was sent in the last two days, and treat everything the triggers cover since the change as disclosed.
  3. Secure the account that made the change. Reset its credentials, end its sessions, revoke its tokens and remove a role it should not have.
  4. Review the other webhooks, deploy keys, deploy tokens and access tokens of the same project or group, because the same roles manage those as well.
  5. Generate a new signing token or secret token for an integration whose webhook was edited, since the editor could set a new one.

Mitigation

  • Keep an inventory of the webhooks of every group and project and of the system hooks, with their URLs and owners, and review it on a schedule.
  • Keep the Maintainer and Owner roles to the people who need them, because these roles manage webhooks.
  • Select only the triggers a webhook needs, so that an existing webhook has little to offer when it is pointed elsewhere.
  • Use a signing token on the webhooks your own systems receive, so that a receiver can verify that a request comes from GitLab and was not changed.
  • Stream audit events to your SIEM and alert on every new or changed webhook and on every system hook.

Frequently asked questions

Does the audit event show where a GitLab webhook sends its data?

Not in a documented field. The event type reference lists `webhook_created`, `webhook_updated` and `webhook_destroyed` without their fields, and the `details` object of an audit event has no defined schema. Open the webhook in the settings of the project or group, or the system hook in the Admin area, to read the URL. Portions of a URL can be masked, and GitLab states that masked portions are not logged.

Who can create a webhook or a system hook in GitLab?

GitLab requires the Maintainer or Owner role for a project webhook and the Owner role for a group webhook, which is a Premium and Ultimate feature. A system hook needs administrator access and exists on GitLab Self-Managed and GitLab Dedicated. The Developer role is not enough for any of them.

Does a webhook receive source code?

A webhook delivers data about events, not a copy of the repository. The payload of a push event lists up to the newest 20 commits with their messages, authors and the paths of added, modified and removed files, and other events carry merge requests, comments and pipeline results. That is a continuous view of the work in a private project, and it reaches the receiver without a credential that could be revoked later.

Why does the rule for changed webhooks need GitLab 19.6?

GitLab lists `webhook_updated` as introduced in GitLab 19.6, while `webhook_created` exists from 17.1 and `webhook_destroyed` from 17.0. On earlier versions a webhook whose URL is changed does not produce this event type, so review the webhook inventory on a schedule as well.

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.