Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new GitLab gl jobToken exploit command path intended to validate a CI job token, download secure files, and attempt a repo write as an exploitation workflow within Pipeleek’s GitLab tooling.
Changes:
- Introduces new Cobra command group
gl jobTokenwithexploitsubcommand and config bindings. - Adds
pkg/gitlab/jobtokenimplementation plus unit tests and GitLab e2e tests. - Updates example configuration and documentation to include the new
gitlab.jobToken.exploit.projectsetting.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/e2e/gitlab/jobtoken/exploit_test.go | New e2e coverage for the gl jobToken exploit CLI flow (mock GitLab API). |
| pkg/gitlab/jobtoken/exploit.go | Implements job token validation, secure file download, and repo write attempt via git. |
| pkg/gitlab/jobtoken/exploit_test.go | Unit tests for URL normalization, branch naming, auth URL formatting, and token scrubbing. |
| internal/cmd/gitlab/jobToken/jobtoken.go | Adds jobToken root command with token prefix validation and inherited flag/config binding. |
| internal/cmd/gitlab/jobToken/exploit/exploit.go | Adds exploit subcommand and binds project config key. |
| internal/cmd/gitlab/gitlab.go | Registers the new jobToken command under gl. |
| pipeleek.example.yaml | Documents new gitlab.jobToken.exploit.project config entry. |
| docs/introduction/configuration.md | Documents new gitlab.jobToken.exploit.project config entry. |
| internal/cmd/gitlab/jobToken/jobtoken_test.go | Basic command wiring tests for jobToken root cmd. |
| internal/cmd/gitlab/jobToken/exploit/exploit_test.go | Basic command wiring tests for exploit subcommand. |
| log.Fatal().Err(err).Msg("required configuration missing") | ||
| } | ||
|
|
||
| gitlabApiToken := config.GetString("gitlab.token") |
There was a problem hiding this comment.
This assigns to a new local gitlabApiToken variable (shadowing the package-level var used for flag binding). It’s easy to misread as setting the persistent flag value. Consider using a differently named local variable (e.g., token) or assign to the existing variable to avoid shadowing confusion.
Suggested change
| gitlabApiToken := config.GetString("gitlab.token") | |
| gitlabApiToken = config.GetString("gitlab.token") |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.