Detection rules › Kusto
GitLab - Repository visibility to Public
'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
| Tactic | Techniques |
|---|---|
| Persistence | |
| Credential Access |
Rule body
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
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
ChangeType | eq |
| field:"ChangeType" kind:eq value:"visibility" |
SourceVisibility | ne |
| field:"SourceVisibility" kind:ne value:"Public" |
TargetVisibility | eq |
| field:"TargetVisibility" kind:eq value:"Public" |
Output fields
These fields are emitted when the rule matches.
| Field | Source |
|---|---|
AuthorName | project |
ChangeType | project |
EntityName | project |
EventTime | project |
IPAddress | project |
SourceVisibility | project |
TargetType | project |
TargetVisibility | project |
TimeGenerated | project |