Skip to main content

Verify No Old Secrets Exist in Repository

Type: Rule
ID: github-repo-old-secrets
Source: v2/rules/github/repository/old-secrets.yaml
Rego Source: old-secrets.rego
Labels: GitHub, Repository

Verify secrets in the GitHub repository are not older than the specified threshold.

note

This rule requires Github Repository Discovery Evidence. See here for more details.

tip

Signed Evidence for this rule IS NOT required by default but is recommended.

warning

Rule requires evaluation with a target or an asset input. Without one, it will be disabled unless the --all-evidence flag is provided.

info

Rule is scoped by product and target.

Usage example

uses: github/repository/old-secrets@v2

Mitigation

Ensures that secrets are rotated regularly, reducing the risk of compromised secrets.

Description

This rule ensures that secrets in the GitHub repository are not older than the specified threshold. It performs the following steps:

  1. Checks the repository settings for secrets.
  2. Verifies that the age of each secret does not exceed the specified threshold.

Evidence Requirements:

  • Evidence must be provided by the Scribe Platform's CLI tool through scanning GitHub repository settings.

Evidence Requirements

FieldValue
filter-by['product', 'target']
signedFalse
content_body_typegeneric
target_typedata
predicate_typehttp://scribesecurity.com/evidence/discovery/v0.1
asset_platformgithub
asset_typerepo

Input Definitions

ParameterTypeRequiredDescriptionDefault
max_secret_ageintegerFalseMaximum age of secrets in months.12