Skip to content

feat(gitlab): verify self-hosted tokens in scanner#622

Merged
frjcomp merged 3 commits intomainfrom
feat/gitlab-selfhosted-token-verification
May 6, 2026
Merged

feat(gitlab): verify self-hosted tokens in scanner#622
frjcomp merged 3 commits intomainfrom
feat/gitlab-selfhosted-token-verification

Conversation

@frjcomp
Copy link
Copy Markdown
Collaborator

@frjcomp frjcomp commented May 6, 2026

No description provided.

Copilot AI review requested due to automatic review settings May 6, 2026 06:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a custom GitLab token detector that can verify GitLab tokens against a user-supplied/self-hosted GitLab instance URL, and wires that URL into GitLab scan commands so verification can be performed against non-gitlab.com targets.

Changes:

  • Add GitLabURLDetector that detects multiple GitLab token types and (optionally) verifies API-capable tokens against a configured GitLab base URL.
  • Integrate the custom detector into the scanner engine alongside default TruffleHog detectors.
  • Propagate the configured GitLab URL from gl scan and gluna scan commands into the detector, and tidy minor docs formatting.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
pkg/scanner/engine/engine.go Runs the new GitLab URL-aware detector in the TruffleHog detection phase.
pkg/scanner/engine/engine_test.go Adds engine-level tests asserting the custom detector is active and detects GitLab token formats.
pkg/scanner/detectors/gitlab_url_detector.go Introduces the URL-aware GitLab token detector with optional self-hosted verification.
pkg/scanner/detectors/gitlab_url_detector_test.go Adds unit tests for detection behavior and URL setter/getter helpers.
internal/cmd/gitlab/scan/scan.go Sets the GitLab instance URL for self-hosted verification during authenticated scans.
internal/cmd/gitlab/scanpublic/scan_public.go Sets the GitLab instance URL for self-hosted verification during unauthenticated/public scans.
docs/introduction/secrets_verification.md Removes extra blank lines in the custom rules section.

Comment thread pkg/scanner/detectors/gitlab_url_detector.go
Comment thread pkg/scanner/detectors/gitlab_url_detector.go Outdated
Comment thread pkg/scanner/detectors/gitlab_url_detector.go
Comment thread pkg/scanner/detectors/gitlab_url_detector.go
Comment thread pkg/scanner/detectors/gitlab_url_detector_test.go
Comment thread pkg/scanner/engine/engine.go Outdated
@frjcomp frjcomp enabled auto-merge (squash) May 6, 2026 06:38
@frjcomp frjcomp merged commit 98b4874 into main May 6, 2026
13 checks passed
@frjcomp frjcomp deleted the feat/gitlab-selfhosted-token-verification branch May 6, 2026 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants