Skip to content

Commit dcbc0f9

Browse files
author
P4T12ICK
committed
github detection
1 parent cc36f54 commit dcbc0f9

File tree

3 files changed

+79
-0
lines changed

3 files changed

+79
-0
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: GitHub Pull Request from Unknown User
2+
id: 9d7b9100-8878-4404-914e-ca5e551a641e
3+
version: 1
4+
date: '2021-09-01'
5+
author: Patrick Bareiss, Splunk
6+
type: Anomaly
7+
datamodel: []
8+
description: This search looks for Pull Request from unknown user.
9+
search: '`github` check_suite.pull_requests{}.id=*
10+
| stats count by check_suite.head_commit.author.name check_suite.pull_requests{}.base.repo.name
11+
check_suite.pull_requests{}.head.ref check_suite.head_commit.message
12+
| rename check_suite.head_commit.author.name as user check_suite.pull_requests{}.base.repo.name as repository
13+
check_suite.pull_requests{}.head.ref as ref_head check_suite.head_commit.message as commit_message
14+
| search NOT `github_known_users`
15+
| `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`
16+
| `github_pull_request_from_unknown_user_filter`'
17+
how_to_implement: You must index GitHub logs. You can follow the url in reference
18+
to onboard GitHub logs.
19+
known_false_positives: unknown
20+
references:
21+
- https://www.splunk.com/en_us/blog/tips-and-tricks/getting-github-data-with-webhooks.html
22+
tags:
23+
analytic_story:
24+
- Dev Sec Ops
25+
asset_type: GitHub
26+
cis20:
27+
- CIS 13
28+
confidence: 90
29+
impact: 30
30+
kill_chain_phases:
31+
- Actions on Objectives
32+
message: Vulnerabilities found in packages used by GitHub repository $repository$
33+
mitre_attack_id:
34+
- T1195.001
35+
nist:
36+
- PR.DS
37+
- PR.AC
38+
- DE.CM
39+
observable:
40+
- name: repository
41+
type: System
42+
role:
43+
- Victim
44+
product:
45+
- Splunk Enterprise
46+
- Splunk Enterprise Security
47+
- Splunk Cloud
48+
- Dev Sec Ops Analytics
49+
required_fields:
50+
- _time
51+
- alert.id
52+
- repository.full_name
53+
- repository.html_url
54+
- action
55+
- alert.affected_package_name
56+
- alert.affected_range
57+
- alert.created_at
58+
- alert.external_identifier
59+
- alert.external_reference
60+
- alert.fixed_in
61+
- alert.severity
62+
risk_score: 27
63+
security_domain: network
64+

macros/github_known_users.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
definition: user IN (user_names_here)
2+
description: specify the user allowed to create PRs in Github projects.
3+
name: github_known_users
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: GitHub Pull Request from Unknown User Unit Test
2+
tests:
3+
- name: GitHub Pull Request from Unknown User
4+
file: cloud/github_pull_request_from_unknown_user.yml
5+
pass_condition: '| stats count | where count > 0'
6+
earliest_time: '-365d'
7+
latest_time: 'now'
8+
attack_data:
9+
- file_name: github_pull_request.json
10+
data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1195.001/github_pull_request/github_pull_request.json
11+
sourcetype: aws:firehose:json
12+
source: github

0 commit comments

Comments
 (0)