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.
This rule requires Github Repository Discovery Evidence. See here for more details.
Signed Evidence for this rule IS NOT required by default but is recommended.
Rule requires evaluation with a target. Without one, it will be disabled unless the --all-evidence
flag is provided.
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:
- Checks the repository settings for secrets.
- 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
Field | Value |
---|---|
signed | False |
content_body_type | generic |
target_type | data |
predicate_type | http://scribesecurity.com/evidence/discovery/v0.1 |
asset_platform | github |
asset_type | repo |
asset_name | Template value (see below) |
Template Value (see here for more details)
{{- if eq .Context.asset_type "repo" -}}
{{- on_target .Context.asset_name -}}
{{- else -}}
{{- on_target nil -}}
{{- end -}}
Rule Parameters (with
)
Parameter | Default |
---|---|
max_secret_age | 12 |