For the complete StackGuardian documentation index, see llms.txt. An extended version with full page content is available at llms-full.txt.
Skip to main content

GitLab

Configure Connector

StackGuardian supports integration with both GitLab Cloud and GitLab Self-Managed, enabling you to deploy directly from your source code repositories. You have the freedom to use connectors for single repositories, groups of repositories but also multiple GitLab instances.

To integrate GitLab with StackGuardian, proceed with one of the following options:

Option 1: Use a Personal Access Token

This method grants StackGuardian access to your GitLab account and all accessible projects.

Steps to Create a Personal Access Token:
  1. Log in to GitLab.
  2. Click on your avatar and select Edit profile.
  3. Go to Access Tokens in the sidebar.
  4. Click Add New Token.
  5. Provide a name for the token.
  6. Optionally, set an expiry date (default is 365 days).
  7. Select the api scope.
  8. Click Create Personal Access Token.
  9. Copy and store the token securely. It will not be shown again.

GitLab Token Creation


Option 2: Use a Project Access Token

This method limits StackGuardian’s access to a specific GitLab project.

Steps to Create a Project Access Token:
  1. Log in to GitLab.
  2. Open the desired project.
  3. Go to Settings > Access Tokens.
  4. Click Add new token.
  5. Enter a token name.
  6. Set an expiry date (up to 365 days).
  7. Choose a role: Reporter or higher.
  8. Select scopes:
    • read_repository: Allows reading the repository.
    • api: Permits API access that includes various read and write actions.
  9. Click Create project access token.
  10. Save the token securely. It won't be shown again.
note

Handle the Project Access Token with care, as it grants repository access. Project Access Token

Set Up the Connector in StackGuardian

Once you have the token, follow these steps:

  1. Go to the Orchestrator > Connectors tab.
  2. Select Connect to GitLab.
  3. Fill in the details:
    • Connector Name: Enter a descriptive name, like MyCompanyGitLabConnector.
    • GitLab Username: GitLab username
    • Access Token Paste your previously generated Access Token here.
    • GitLab HTTP URLThe web address for GitLab access, typically https://gitlab.com for GitLab's cloud service or a custom domain for self-hosted instances.
    • GitLab API URL The endpoint for API calls, generally https://gitlab.com/api/v4 for GitLab's cloud-hosted users.
  4. Click Create.

Successful GitLab Connector

You can configure VCS triggers to automatically run workflows in response to GitLab events such as pushes, pull requests, and tag creation. See Workflow triggers.