GitHub repository Severitylow builtIn

Description

Rulesets target one of three ref kinds: 'branch' (most common for Git protection), 'tag' (for release tag immutability), or 'push' (for org-wide push restrictions). For repositories that enforce branch-based protection, the primary rulesets should target 'branch' refs. Use additional rulesets for tag immutability and push policies.

Recommandation

1. Go to Repository Settings -> Rules -> Rulesets. 
2. For your primary protection ruleset, ensure 'Target' is 'Branch'. 
3. Add separate rulesets for tag and push protection as needed.

Règle de politique

{
  "target": "GHRuleset",
  "if": {
    "allOf": [
      {
        "resource": "GHRuleset",
        "property": "Target",
        "operator": "equals",
        "value": "branch"
      }
    ]
  },
  "then": {
    "effect": "Audit"
  }
}
Détails de la règle
  • ID de la règle: DOS5710
  • Code: GH_Repository_Rulesets_Should_Target_Branch_Refs
  • Plateforme: GitHub
  • Catégorie: repository
  • Sévérité: Severitylow
  • Type: builtIn