generic.secrets.security.detected-github-token.detected-github-token

Author
221
Download Count*
License
GitHub Token detected
Run Locally
Run in CI
Defintion
rules:
- id: detected-github-token
patterns:
- pattern-either:
- pattern: |
$VAR = $SECRET
- pattern: |
$VAR: $SECRET
- pattern: |
$VAR = '$SECRET'
- pattern: |
$VAR: '$SECRET'
- pattern: |
'$VAR' = '$SECRET'
- pattern: |
'$VAR': '$SECRET'
- pattern: |
"[hH][tT][tT][pP][sS]?://.*$SECRET.*"
- metavariable-regex:
metavariable: $SECRET
regex: gh[pousr]_[A-Za-z0-9_]{36,251}
- metavariable-analysis:
analyzer: entropy
metavariable: $SECRET
languages:
- generic
message: GitHub Token detected
severity: ERROR
metadata:
cwe:
- "CWE-798: Use of Hard-coded Credentials"
source-rule-url: https://github.blog/changelog/2021-03-04-authentication-token-format-updates/
category: security
technology:
- secrets
- github
confidence: LOW
owasp:
- A07:2021 - Identification and Authentication Failures
references:
- https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures
cwe2022-top25: true
cwe2021-top25: true
subcategory:
- audit
likelihood: LOW
impact: MEDIUM
license: Commons Clause License Condition v1.0[LGPL-2.1-only]
Examples
detected-github-token.txt
# ruleid: detected-github-token
GITHUB_TOKEN=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
# ruleid: detected-github-token
github_token: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
# ruleid: detected-github-token
clone="git clone https://phaticusthiccy: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@github.com/phaticusthiccy/WhatsAsenaDuplicated"
# ruleid: detected-github-token
githubToken = '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'
# ok: detected-github-token
gitfake_token:ghp_abababababababababababababababababab
Short Link: https://sg.run/PpOv