Skip to content

armgit / AiSOC

Public Imported from GitHub
0

Open-source AI Security Operations Center: alert fusion, LLM-agent triage, MITRE ATT&CK investigation, and a replayable decision ledger for every agent step. Self-hostable, runs with no API keys, MIT licensed. Ships an MCP server for Claude, Cursor and Continue.

5.6 KB
Raw Blame
id: chronicle-detection-rules-github-access-granted-to-personal-access-token-followed-by-high-number-of-cloned
name: github_access_granted_to_personal_access_token_followed_by_high_number_of_cloned_non_public_repositories
description: github_access_granted_to_personal_access_token_followed_by_high_number_of_cloned_non_public_repositories
severity: medium
enabled: false
tags:
  mitre: []
  categories:
  - endpoint
references: []
logsource:
  product: chronicle
detection:
  chronicle_yaral: "/*\n * Copyright 2024 Google LLC\n *\n * Licensed under the Apache\
    \ License, Version 2.0 (the \"License\");\n * you may not use this file except\
    \ in compliance with the License.\n * You may obtain a copy of the License at\n\
    \ *\n *     https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required\
    \ by applicable law or agreed to in writing, software\n * distributed under the\
    \ License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS\
    \ OF ANY KIND, either express or implied.\n * See the License for the specific\
    \ language governing permissions and\n * limitations under the License.\n */\n\
    \nrule github_access_granted_to_personal_access_token_followed_by_high_number_of_cloned_non_public_repositories\
    \ {\n\n  meta:\n    author = \"Google Cloud Security\"\n    description = \"Detects\
    \ when a user grants access to a GitHub Personal Access Token prior to cloning\
    \ several GitHub non-public GitHub repositories. An adversary may grant access\
    \ to a Personal Access Token before attempting to steal the contents of several\
    \ GitHub repositories using a an automated script or offensive tool.\"\n    rule_id\
    \ = \"mr_11aaa6f7-7fcc-42cb-af2e-42ed39226c43\"\n    rule_name = \"GitHub Access\
    \ Granted To Personal Access Token Followed By High Number Of Cloned Non Public\
    \ Repositories\"\n    assumption = \"Your GitHub enterprise audit log settings\
    \ are configured to log the source IP address for events. Reference: https://docs.github.com/en/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/displaying-ip-addresses-in-the-audit-log-for-your-organization\"\
    \n    type = \"alert\"\n    severity = \"High\"\n    priority = \"High\"\n   \
    \ platform = \"GitHub\"\n    data_source = \"github\"\n    mitre_attack_tactic\
    \ = \"Collection\"\n    mitre_attack_technique = \"Data from Information Repositories:\
    \ Code Repositories\"\n    mitre_attack_url = \"https://attack.mitre.org/versions/v14/techniques/T1213/003/\"\
    \n    mitre_attack_version = \"v14\"\n    reference = \"https://docs.github.com/en/enterprise-cloud@latest/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/audit-log-events-for-your-enterprise\"\
    \n\n  events:\n    // GitHub Personal Access Token (PAT) access granted event\n\
    \    $github_pat.metadata.vendor_name = \"GITHUB\" nocase\n    $github_pat.metadata.product_name\
    \ = \"GITHUB\"\n    $github_pat.metadata.product_event_type = \"personal_access_token.access_granted\"\
    \n\n    // GitHub repository clone event\n    $github_pat.metadata.vendor_name\
    \ = \"GITHUB\" nocase\n    $github_clone.metadata.product_name = \"GITHUB\"\n\
    \    $github_clone.metadata.product_event_type = \"git.clone\"\n    $github_clone.target.resource.name\
    \ = $github_repo_name\n\n    // Join GitHub PAT access granted event to GitHub\
    \ repository clone event\n    $github_pat.principal.user.userid = $github_clone.principal.user.userid\n\
    \n    // Placeholder for match section\n    $github_pat.principal.user.userid\
    \ = $user_id\n\n    // Ensure PAT access granted event occurred before repository\
    \ clone events\n    $github_pat.metadata.event_timestamp.seconds < $github_clone.metadata.event_timestamp.seconds\n\
    \n  match:\n    $user_id over 30m\n\n  outcome:\n    $github_repo_name_distinct_count\
    \ = count_distinct($github_repo_name)\n    $risk_score = max(85)\n    $mitre_attack_tactic\
    \ = \"Collection\"\n    $mitre_attack_technique = \"Data from Information Repositories:\
    \ Code Repositories\"\n    $mitre_attack_technique_id = \"T1213.003\"\n    $event_count\
    \ = count_distinct($github_clone.metadata.id)\n    $principal_ip = array_distinct($github_pat.principal.ip)\n\
    \    $principal_user_userid = array_distinct($github_pat.principal.user.userid)\n\
    \    $principal_ip_country = array_distinct($github_pat.principal.ip_geo_artifact.location.country_or_region)\n\
    \    $principal_ip_state = array_distinct($github_pat.principal.ip_geo_artifact.location.state)\n\
    \    $principal_ip_city = array_distinct($github_pat.principal.location.city)\n\
    \    $security_result_summary = array_distinct($github_pat.security_result.summary)\n\
    \n  condition:\n    // Customize GitHub repo count to fit your environment\n \
    \   $github_pat and $github_clone and $github_repo_name_distinct_count > 5\n}"
  chronicle_rule_name: github_access_granted_to_personal_access_token_followed_by_high_number_of_cloned_non_public_repositories
provenance:
  source: chronicle/detection-rules
  source_id: github_access_granted_to_personal_access_token_followed_by_high_number_of_cloned_non_public_repositories
  source_commit: 74dd490
  license: Apache-2.0
  license_url: https://github.com/chronicle/detection-rules/blob/main/LICENSE
  imported_at: '2026-05-04'
  imported_by: chronicle_importer
  upstream_path: rules/community/github/github_access_granted_to_personal_access_token_followed_by_high_number_of_cloned_non_public_repositories.yaral
notes:
  chronicle_meta: {}
  quarantine_reason: raw YARA-L — needs translation to AiSOC schema