GitHub repository Severitymedium builtIn

Description

A Dependabot secret literally named 'TOKEN' (or TOKEN_1, TOKEN_PROD) is a maintenance hazard - rotating it requires hunting through every workflow because the name conveys no scope or purpose. Brand-specific names (NPM_REGISTRY_TOKEN, GITHUB_PAT_PRIVATE_PKGS, AZURE_DEVOPS_PAT) make rotation surgical. Generic token names also strongly suggest credential reuse across registries, which amplifies blast radius on compromise.

Recommandation

1. Go to Repository or Organization Settings -> Secrets and variables -> Dependabot. 
2. Rename TOKEN / TOKEN_* secrets to reflect the specific registry or service they unlock. 
3. Update Dependabot config (dependabot.yml) registries entries that reference the renamed secret.

Règle de politique

{
  "target": "GHDependabotSecret",
  "if": {
    "allOf": [
      {
        "resource": "GHDependabotSecret",
        "property": "Name",
        "operator": "notMatch",
        "value": "^TOKEN(_.*)?$"
      }
    ]
  },
  "then": {
    "effect": "Audit"
  }
}
Détails de la règle
  • ID de la règle: DOS5907
  • Code: GH_Repository_Dependabot_Secret_Name_Should_Not_Be_Generic_Token
  • Plateforme: GitHub
  • Catégorie: repository
  • Sévérité: Severitymedium
  • Type: builtIn