-
Notifications
You must be signed in to change notification settings - Fork 110
docs: add GitLab OAuth setup and provider enrollment guide #6477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
evankanderson
merged 3 commits into
mindersec:main
from
intelligent-ears:docs/gitlab-provider-setup
May 28, 2026
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
c6ccdc5
docs: add GitLab OAuth setup and provider enrollment guide
intelligent-ears 42e1874
docs: add group-owned OAuth app option, tested both user and group ow…
intelligent-ears 24b1186
docs: address review comments - fix scopes, add access model section,…
intelligent-ears File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,106 @@ | ||
| --- | ||
| title: Create a GitLab OAuth application | ||
| sidebar_position: 75 | ||
| --- | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - [GitLab](https://gitlab.com) account | ||
| - A [local Minder server](run_the_server) running with the `gitlab_provider` | ||
| feature flag enabled (see [Using feature flags](../developer_guide/feature_flags)) | ||
|
|
||
| ## Steps | ||
|
|
||
| 1. Create a GitLab OAuth application. GitLab supports three ownership levels — | ||
| choose the one that fits your setup: | ||
|
|
||
| - **User-owned:** Go to [User Settings > Applications](https://gitlab.com/-/user_settings/applications) | ||
| - **Group-owned:** Go to your GitLab group → **Settings** → **Applications** | ||
| - **Instance-wide:** Go to **Admin Area** → **Applications** (self-managed only) | ||
|
|
||
| 2. Click **Add new application** and enter the following details: | ||
| - **Name:** `Minder` (or any name you prefer) | ||
| - **Redirect URI** (add both URIs, one per line): | ||
| ``` | ||
| http://localhost:8080/api/v1/auth/callback/gitlab/cli | ||
| http://localhost:8080/api/v1/auth/callback/gitlab/web | ||
| ``` | ||
| - **Confidential:** Yes (checked) | ||
| - **Scopes:** Check `api`, `profile`, and `read_repository` | ||
|
|
||
| 3. Click **Save application**. Copy the **Application ID** and **Secret** — the | ||
| secret is only shown once. | ||
|
|
||
| 4. Add the following to your `server-config.yaml` under the `provider:` section: | ||
|
|
||
| ```yaml | ||
| provider: | ||
| gitlab: | ||
| client_id: "YOUR_APPLICATION_ID" | ||
| client_secret: "YOUR_SECRET" | ||
| redirect_uri: "http://localhost:8080/api/v1/auth/callback/gitlab" | ||
| webhook_secret: "a-random-secret-string" | ||
| scopes: | ||
| - "api" | ||
| - "profile" | ||
| - "read_repository" | ||
| ``` | ||
|
|
||
| The `redirect_uri` should be the base path without `/cli` or `/web` — Minder | ||
| appends the correct suffix automatically. | ||
|
|
||
| 5. Enable the `gitlab_provider` feature flag by creating `flags-config.yaml` in | ||
| the root of your Minder directory: | ||
|
|
||
| ```yaml | ||
| gitlab_provider: | ||
| variations: | ||
| enabled: true | ||
| disabled: false | ||
| defaultRule: | ||
| variation: enabled | ||
| ``` | ||
|
|
||
| 6. (Re)start the Minder server: | ||
|
|
||
| ```bash | ||
| make run-docker | ||
| ``` | ||
|
|
||
| 7. Enroll the GitLab provider using the CLI: | ||
|
|
||
| ```bash | ||
| minder provider enroll --class gitlab | ||
| ``` | ||
|
|
||
| A browser window will open to GitLab's OAuth authorization page. After | ||
| authorizing, the browser will show **Minder enrollment complete** and the CLI | ||
| will print `Provider enrolled successfully`. | ||
|
|
||
| ## Access model | ||
|
|
||
| Minder acts as the authenticated GitLab user when managing repositories. This | ||
| means: | ||
|
|
||
| - If the enrolling user loses access to a repository (e.g. leaves a project or | ||
| organization), Minder will no longer be able to enforce policy on that | ||
| repository. | ||
| - To restore access, re-enroll the provider with a user who has access: | ||
| `minder provider enroll --class gitlab` | ||
|
|
||
| For production use, consider using a dedicated service account or group-owned | ||
| OAuth application to avoid disruption if individual team members leave. | ||
|
|
||
| ## Known limitations | ||
|
|
||
| - GitLab support is currently only available on self-hosted Minder instances. | ||
| The hosted instance at `api.custcodian.dev` does not yet support GitLab | ||
| enrollment. | ||
| - Webhook-based event delivery requires an externally reachable URL. For local | ||
| development, tools like [ngrok](https://ngrok.com) can expose your local | ||
| server. | ||
| - PR remediation (auto-creating branches/PRs) is not yet implemented for GitLab. | ||
| - Container registry and artifact support is not yet implemented for GitLab. | ||
| - GitLab service account PATs are not currently supported due to a validation | ||
| issue with the `.` character in PAT tokens. | ||
|
Comment on lines
+104
to
+105
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PAT is the only mechanism for service accounts, but it should be easy to fix the validation problem. |
||
| - Token identity verification after enrollment is not yet implemented. | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At some point, we should have per-provider documentation that covers this, but I think this is fine for now.