Detection rules › Kusto

GitLab - Repository visibility to Public

Status
available
Severity
medium
Time window
1d
Source
github.com/Azure/Azure-Sentinel

'This query leverages GitLab Audit Logs. A repository in GitLab changed visibility from Private or Internal to Public which could indicate compromise, error or misconfiguration leading to exposing the repository to the public.'

MITRE ATT&CK coverage

Rule body kusto

id: 8b291c3d-90ba-4ebf-af2c-0283192d430e
name: GitLab - Repository visibility to Public
description: |
  'This query leverages GitLab Audit Logs. A repository in GitLab changed visibility from Private or Internal to Public which could indicate compromise, error or misconfiguration leading to exposing the repository to the public.'
severity: Medium
status: Available
requiredDataConnectors:
  - connectorId: SyslogAma
    dataTypes: 
      - Syslog
queryFrequency: 1h
queryPeriod: 1d
triggerOperator: gt
triggerThreshold: 0
tactics:
  - Persistence
  - DefenseEvasion
  - CredentialAccess
relevantTechniques:
  - T1556
query: |
  GitLabAudit
  | where SourceVisibility != "Public" and ChangeType == "visibility" and TargetVisibility == "Public"
  | project TimeGenerated, EventTime, IPAddress, AuthorName, ChangeType, TargetType, SourceVisibility,  TargetVisibility, EntityName
entityMappings:
  - entityType: IP
    fieldMappings:
      - identifier: Address
        columnName: IPAddress
  - entityType: Account
    fieldMappings:
      - identifier: FullName
        columnName: AuthorName
  - entityType: URL
    fieldMappings:
      - identifier: Url
        columnName: EntityName        
version: 1.0.1
kind: Scheduled

Stages and Predicates

Stage 1: source

GitLabAudit

Stage 2: where

| where SourceVisibility != "Public" and ChangeType == "visibility" and TargetVisibility == "Public"

Stage 3: project

| project TimeGenerated, EventTime, IPAddress, AuthorName, ChangeType, TargetType, SourceVisibility,  TargetVisibility, EntityName

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
ChangeTypeeq
  • visibility transforms: cased
SourceVisibilityne
  • Public transforms: cased
TargetVisibilityeq
  • Public transforms: cased

Output fields

Fields the rule emits when it matches. Chronicle authors list these in the outcome block; they appear on the detection and $risk_score drives alerting. Sentinel / Defender XDR rules build them up through project / summarize / extend stages. Sentinel maps these into alert fields via entityMappings and customDetails; Defender XDR custom detections surface them as alert fields directly.

FieldSource
AuthorNameproject
ChangeTypeproject
EntityNameproject
EventTimeproject
IPAddressproject
SourceVisibilityproject
TargetTypeproject
TargetVisibilityproject
TimeGeneratedproject