Add secret scanning for commits and Forgejo Actions #1

Closed
opened 2026-09-02 16:44:50 -05:00 by gitchegumi · 6 comments
Owner

Description

Add automated secret detection suitable for a public repository. Local checks and Forgejo Actions should catch common credentials and private material before or immediately after they enter repository history.

Scope

  • Select Gitleaks or an equivalent tool compatible with Forgejo Actions.
  • Add a repository configuration only where project-specific exclusions are necessary.
  • Scan current tracked content and future changes.
  • Document local invocation, CI behavior, false-positive handling, and credential-rotation response.
  • Keep workflows Forgejo-native rather than adding GitHub-specific assumptions.

Acceptance criteria

  • The complete repository history and working tree pass an initial secret scan.
  • Forgejo Actions runs secret scanning for relevant pushes and pull requests.
  • A safe synthetic test confirms the scanner fails on representative secret material without committing a real credential.
  • Suppressions are narrow, reviewed, and documented.
  • Response steps explain that exposed credentials must be revoked or rotated, not merely deleted from the latest commit.

Dependencies / blockers

Requires an available Linux Forgejo runner. This control should be established before secret-bearing deployment integrations are added.

## Description Add automated secret detection suitable for a public repository. Local checks and Forgejo Actions should catch common credentials and private material before or immediately after they enter repository history. ## Scope - Select Gitleaks or an equivalent tool compatible with Forgejo Actions. - Add a repository configuration only where project-specific exclusions are necessary. - Scan current tracked content and future changes. - Document local invocation, CI behavior, false-positive handling, and credential-rotation response. - Keep workflows Forgejo-native rather than adding GitHub-specific assumptions. ## Acceptance criteria - [x] The complete repository history and working tree pass an initial secret scan. - [x] Forgejo Actions runs secret scanning for relevant pushes and pull requests. - [x] A safe synthetic test confirms the scanner fails on representative secret material without committing a real credential. - [x] Suppressions are narrow, reviewed, and documented. - [x] Response steps explain that exposed credentials must be revoked or rotated, not merely deleted from the latest commit. ## Dependencies / blockers Requires an available Linux Forgejo runner. This control should be established before secret-bearing deployment integrations are added.
Member

Initial implementation is in PR #6: a callable Gitleaks workflow scans full fetched Git history and the working tree, redacts findings, and fails on findings, scanner errors or an unexpected tool version. Local invocation and rotation/exception guidance are included.

YAML/Bash validation and mocked gate-control tests passed. Real Gitleaks history/working-tree scans and synthetic detection on the selected runner are still required, so this issue remains open. Runner activation and cross-repository access are tracked in #3; broader scanning in #4.

Initial implementation is in PR #6: a callable Gitleaks workflow scans full fetched Git history and the working tree, redacts findings, and fails on findings, scanner errors or an unexpected tool version. Local invocation and rotation/exception guidance are included. YAML/Bash validation and mocked gate-control tests passed. Real Gitleaks history/working-tree scans and synthetic detection on the selected runner are still required, so this issue remains open. Runner activation and cross-repository access are tracked in #3; broader scanning in #4.
Member

Progress update: PR #12 adds the workflows repository's trusted self-scan caller. It targets pull requests, pushes to main, manual runs, and a weekly schedule while pinning the evaluated implementation to v1.1.0. The PR run has expanded into the released reusable workflow and is queued on the ci runner.

The Gitleaks gate, narrow mitigation format, and exposed-credential rotation procedure are implemented and documented. I am leaving the initial repository pass and safe synthetic live failure unchecked until Forgejo supplies direct run evidence; the issue remains open.

Progress update: PR #12 adds the workflows repository's trusted self-scan caller. It targets pull requests, pushes to main, manual runs, and a weekly schedule while pinning the evaluated implementation to v1.1.0. The PR run has expanded into the released reusable workflow and is queued on the ci runner. The Gitleaks gate, narrow mitigation format, and exposed-credential rotation procedure are implemented and documented. I am leaving the initial repository pass and safe synthetic live failure unchecked until Forgejo supplies direct run evidence; the issue remains open.
Member

Initial repository acceptance is now complete. PR #12 run 36 scanned the complete fetched history and working tree with the released v1.1.0 gate. The first run surfaced five Semgrep network audit warnings; each was reviewed and constrained by an exact expiring mitigation, and the corrected run passed with 0 unmitigated findings and 0 scanner errors.

The push criterion remains unchecked until the workflow is merged and the main-branch run succeeds. The safe synthetic failure criterion also remains open for a dedicated live negative run.

Initial repository acceptance is now complete. PR #12 run 36 scanned the complete fetched history and working tree with the released v1.1.0 gate. The first run surfaced five Semgrep network audit warnings; each was reviewed and constrained by an exact expiring mitigation, and the corrected run passed with 0 unmitigated findings and 0 scanner errors. The push criterion remains unchecked until the workflow is merged and the main-branch run succeeds. The safe synthetic failure criterion also remains open for a dedicated live negative run.
Member

Checked the push/pull-request execution criterion: the trusted self-scan is merged and now uses v1.2.1 through #16. PR scan 59 and main push scan 61 both succeeded. The owner also confirmed required scanner status checks are configured on main.

This issue is now 4/5. The remaining task is the dedicated safe synthetic-secret negative run on the live Forgejo runner, with evidence that detection fails the gate without committing a real credential. Earlier local fixtures do not replace that live acceptance test.

Checked the push/pull-request execution criterion: the trusted self-scan is merged and now uses v1.2.1 through #16. [PR scan 59](https://git.gitchegumi.com/Homelab/workflows/actions/runs/59) and [main push scan 61](https://git.gitchegumi.com/Homelab/workflows/actions/runs/61) both succeeded. The owner also confirmed required scanner status checks are configured on main. This issue is now 4/5. The remaining task is the dedicated safe synthetic-secret negative run on the live Forgejo runner, with evidence that detection fails the gate without committing a real credential. Earlier local fixtures do not replace that live acceptance test.
Member

The final acceptance criterion is now verified live. Run 63 from #17 executed the exact secret-scan step from the pinned v1.2.1 release using Gitleaks 8.30.1. It accepted clean history/tree, returned failure for a runtime-generated nonfunctional credential-shaped value in the working tree, and still returned failure after that synthetic value was committed and then deleted in a disposable local Git history. The tree was confirmed clean in the history-only case. Console output and JSON reports were checked for redaction.

Missing Gitleaks and an unexpected version also failed closed. All 12 acceptance cases passed and a sanitized summary artifact was retained. No real credential was committed or used; fixtures were temporary inside the runner job. Checklist: 5/5. #17 preserves the reusable acceptance suite for review and merge.

The final acceptance criterion is now verified live. [Run 63](https://git.gitchegumi.com/Homelab/workflows/actions/runs/63/jobs/0) from #17 executed the exact secret-scan step from the pinned v1.2.1 release using Gitleaks 8.30.1. It accepted clean history/tree, returned failure for a runtime-generated nonfunctional credential-shaped value in the working tree, and still returned failure after that synthetic value was committed and then deleted in a disposable local Git history. The tree was confirmed clean in the history-only case. Console output and JSON reports were checked for redaction. Missing Gitleaks and an unexpected version also failed closed. All 12 acceptance cases passed and a sanitized summary artifact was retained. No real credential was committed or used; fixtures were temporary inside the runner job. Checklist: 5/5. #17 preserves the reusable acceptance suite for review and merge.
Author
Owner

Closing as complete

Closing as complete
Sign in to join this conversation.
No milestone
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Homelab/workflows#1
No description provided.