You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* On GitLab SaaS: If you have the Premium or Ultimate license tier, only one project access token is available with a [trial license](https://about.gitlab.com/free-trial/).
94
+
* On GitLab Self-Managed instances: With any license tier. If you have the Free tier, consider [restricting the creation of project access tokens](https://docs.gitlab.com/user/project/settings/project_access_tokens/#restrict-the-creation-of-project-access-tokens) to lower potential abuse.
93
95
94
-
- They can be created with varying expiration periods or set to never expire.
* On GitLab.com, you can use group access tokens if you have the Premium or Ultimate license tier. Group access tokens are not available with a [trial license](https://about.gitlab.com/free-trial/).
99
+
* On GitLab Dedicated and self-managed instances, you can use group access tokens with any license tier.
96
100
97
101
</TabItem>
98
102
</Tabs>
@@ -388,28 +392,26 @@ For more information on creating and using GitHub Actions Repository secrets, re
388
392
<TabItemvalue="gitlab"label="GitLab">
389
393
390
394
391
-
For GitLab, Pipelines requires a single machine user with `api` and `read_repository` access. This user will be used to authenticate API calls and access repositories within your GitLab group.
395
+
For GitLab, Gruntwork Pipelines two CI variables. The first, the `PIPELINES_GITLAB_TOKEN` requires the `Developer`, `Maintainer` or `Owner` role and the scopes listed below. This token will be used to authenticate API calls and access repositories within your GitLab group. The second, the `PIPELINES_GITLAB_READ_TOKEN` will be used to access your own code within GitLab. If not set, Pipelines will default to the `CI_JOB_TOKEN` when accessing internal GitLab hosted code.
392
396
393
-
### Creating the CI User
394
-
395
-
1. Create a dedicated GitLab user account to serve as your CI user
396
-
2. Add this user to your GitLab group with appropriate permissions:
397
-
- Developer access to your infrastructure repositories
398
-
399
-
**Checklist:**
400
-
<PersistentCheckboxid="via-machine-users-gitlab-1"label="GitLab CI user created" />
401
-
<PersistentCheckboxid="via-machine-users-gitlab-2"label="CI user added to GitLab group" />
402
397
403
398
### Creating the Access Token
404
399
405
-
Gruntwork recommends [creating](https://docs.gitlab.com/user/profile/personal_access_tokens/#create-a-personal-access-token) two Personal Access Tokens for the CI user as best practice:
406
-
-**PIPELINES_GITLAB_TOKEN** token with `api` scope for making API calls to e.g. create comments on merge requests
407
-
-**PIPELINES_GITLAB_READ_TOKEN** token with `read_repository` scope for accessing GitLab repositories e.g your catalog or infrastructure modules
400
+
Gruntwork recommends [creating](https://docs.gitlab.com/user/project/settings/project_access_tokens/#create-a-project-access-token) two Project or Group Access Tokens as best practice:
401
+
| Token Name | Required Scopes | Required Role | Purpose |
|**PIPELINES_GITLAB_TOKEN**|`api` (and `ai_features` if using GitLab AI) | Developer, Maintainer, or Owner | Making API calls (e.g., creating comments on merge requests) |
404
+
|**PIPELINES_GITLAB_READ_TOKEN**|`read_repository`| Any | Accessing GitLab repositories (e.g., your catalog or infrastructure modules) |
408
405
409
-
You may however generate a single token with both `api` and `read_repository` scopes if you prefer and use it for both purposes.
406
+
You may however generate a single token all scopes scopes if you prefer and use it for both purposes.
410
407
411
408
These tokens will be stored in your CI/CD variables.
412
409
410
+
:::note
411
+
412
+
If you have GitLab AI installed then you will also need the `ai_features` scope on `PIPELINES_GITLAB_TOKEN`. This requirement to add `ai_features` is driven by the mechanics of how GitLab operates and not because Pipelines itself behaves differently in the presence of GitLab AI.
413
+
:::
414
+
413
415
:::tip
414
416
Set an expiration date according to your organization's security policies. We recommend 90 days as a balance between security and maintenance.
0 commit comments