|
| 1 | +name: GitHub Organizations Repository Deleted |
| 2 | +id: 9ff4ca95-fdae-4eea-9ffa-6d8e1c202a71 |
| 3 | +version: 1 |
| 4 | +date: '2025-01-17' |
| 5 | +author: Patrick Bareiss, Splunk |
| 6 | +status: production |
| 7 | +type: Anomaly |
| 8 | +description: The following analytic identifies when a repository is deleted within a GitHub organization. |
| 9 | + The detection monitors GitHub Organizations audit logs for repository deletion events by tracking actor details, |
| 10 | + repository information, and associated metadata. This behavior is concerning for SOC teams as malicious actors may |
| 11 | + attempt to delete repositories to destroy source code, intellectual property, or evidence of compromise. Repository |
| 12 | + deletion can result in permanent loss of code, documentation, and project history if proper backups are not maintained. |
| 13 | + Additionally, unauthorized repository deletion could indicate account compromise, insider threats, or attempts to disrupt |
| 14 | + business operations. The impact of a repository deletion attack includes loss of intellectual property, disruption to |
| 15 | + development workflows, and potential financial losses from lost work. Early detection of unauthorized repository deletions |
| 16 | + allows security teams to investigate potential compromises and restore from backups if needed. |
| 17 | +data_source: |
| 18 | +- GitHub Organizations Audit Logs |
| 19 | +search: '`github_organizations` vendor_action=repo.destroy |
| 20 | + | fillnull |
| 21 | + | stats count min(_time) as firstTime max(_time) as lastTime by actor, actor_id, actor_is_bot, actor_location.country_code, business, business_id, org, org_id, repo, repo_id, user_agent, visibility, vendor_action |
| 22 | + | eval user=actor |
| 23 | + | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)` |
| 24 | + | `github_organizations_repository_deleted_filter`' |
| 25 | +how_to_implement: You must ingest GitHub Organizations logs using Splunk Add-on for Github using a Personal Access Token https://docs.splunk.com/Documentation/AddOns/released/GitHub/Configureinputs . |
| 26 | +known_false_positives: unknown |
| 27 | +references: |
| 28 | +- https://docs.splunk.com/Documentation/AddOns/released/GitHub/Configureinputs |
| 29 | +- https://www.googlecloudcommunity.com/gc/Community-Blog/Monitoring-for-Suspicious-GitHub-Activity-with-Google-Security/ba-p/763610 |
| 30 | +drilldown_searches: |
| 31 | +- name: View the detection results for - "$user$" |
| 32 | + search: '%original_detection_search% | search user = "$user$"' |
| 33 | + earliest_offset: $info_min_time$ |
| 34 | + latest_offset: $info_max_time$ |
| 35 | +- name: View risk events for the last 7 days for - "$user$" |
| 36 | + search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$user$") starthoursago=168 | stats count min(_time) as firstTime max(_time) as lastTime values(search_name) as "Search Name" values(risk_message) as "Risk Message" values(analyticstories) as "Analytic Stories" values(annotations._all) as "Annotations" values(annotations.mitre_attack.mitre_tactic) as "ATT&CK Tactics" by normalized_risk_object | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`' |
| 37 | + earliest_offset: $info_min_time$ |
| 38 | + latest_offset: $info_max_time$ |
| 39 | +tags: |
| 40 | + analytic_story: |
| 41 | + - GitHub Malicious Activity |
| 42 | + asset_type: GitHub |
| 43 | + confidence: 90 |
| 44 | + impact: 30 |
| 45 | + message: $user$ deleted a repository in GitHub Organizations |
| 46 | + mitre_attack_id: |
| 47 | + - T1485 |
| 48 | + observable: |
| 49 | + - name: user |
| 50 | + type: User |
| 51 | + role: |
| 52 | + - Victim |
| 53 | + product: |
| 54 | + - Splunk Enterprise |
| 55 | + - Splunk Enterprise Security |
| 56 | + - Splunk Cloud |
| 57 | + required_fields: |
| 58 | + - actor |
| 59 | + - actor_id |
| 60 | + - actor_is_bot |
| 61 | + - actor_location.country_code |
| 62 | + - business |
| 63 | + - business_id |
| 64 | + - org |
| 65 | + - org_id |
| 66 | + - repo |
| 67 | + - repo_id |
| 68 | + - user |
| 69 | + - user_agent |
| 70 | + - user_id |
| 71 | + risk_score: 27 |
| 72 | + security_domain: network |
| 73 | +tests: |
| 74 | +- name: True Positive Test |
| 75 | + attack_data: |
| 76 | + - data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1485/github_delete_repository/github.json |
| 77 | + source: github |
| 78 | + sourcetype: github:cloud:audit |
| 79 | + |
0 commit comments