diff --git a/.gitattributes b/.gitattributes index 600595f1..2282f684 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5,6 +5,7 @@ ci/ export-ignore ci-requirements.md export-ignore renovate.json export-ignore +.gitleaks.toml export-ignore internal/server/release_gate_test.go export-ignore internal/server/release_version_test.go export-ignore .gitattributes export-ignore diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index b5901a6d..0606871e 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -700,7 +700,7 @@ jobs: rm -rf "${EXPORT}" mkdir -p "${EXPORT}" git archive HEAD | tar -x -C "${EXPORT}" - for private in .gitea .forgejo .github ci ci-requirements.md .gitattributes renovate.json; do + for private in .gitea .forgejo .github ci ci-requirements.md .gitattributes renovate.json .gitleaks.toml; do if [ -e "${EXPORT}/${private}" ]; then echo "::error::the export carries ${private}; .gitattributes export-ignore no longer covers it" exit 1 diff --git a/.gitleaks.toml b/.gitleaks.toml new file mode 100644 index 00000000..997e55a3 --- /dev/null +++ b/.gitleaks.toml @@ -0,0 +1,22 @@ +# The weekly security sweep reads this file in place of the family gitleaks +# config, so it extends that config and adds only this repository's +# allowlist. The path is where the sweep's image keeps the family rules. +# +# Every entry says why the matched value is not a secret. + +[extend] +path = "/opt/security-rules/gitleaks-family.toml" + +[allowlist] +description = "Minstrel: test values that look like credentials and are not" +regexes = [ + # AWS's published SigV4 example credentials ("Examples: Signature + # Calculations in AWS Signature Version 4", Amazon S3 API reference). + # internal/backup/s3_test.go signs AWS's own worked example with them and + # checks the signature AWS prints, so they must stay exactly as published. + '''AKIAIOSFODNN7EXAMPLE''', + '''wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY''', + # An invite token that a register test inserts into the throwaway test + # database and then redeems (internal/api/auth_register_test.go). + '''test-invite-abc123''', +]