ops0ops0

GitLab Integration

ops0 supports GitLab as a version control provider alongside GitHub. You can sync IaC projects, configurations, and discovery assets to GitLab repositories, create merge requests, and manage branches directly from ops0.


Supported Features

FeatureDescription
Repository SyncPush and pull IaC code to/from GitLab repos
Merge RequestsCreate MRs with templated descriptions from ops0
Branch ManagementCreate branches, switch between them
Multi-PurposeConnect GitLab for IaC, Configurations, Discovery, or Assets
Self-HostedSupports self-hosted GitLab instances with custom URLs

Adding a GitLab Integration

Go to Settings > Integrations > Add Integration.

Select GitLab

Choose GitLab from the provider list.

Choose Token Type

Select the type of access token you want to use.

Enter Credentials

Provide your token and, if using a self-hosted instance, your GitLab URL.

Connect

Click Connect to verify the integration.

GitLab integration setup in ops0

Authentication Methods

Personal Access Token
Full access tied to your user account
Group Access Token
Scoped to a specific GitLab group
Project Access Token
Scoped to a single repository

Integration Fields

FieldRequiredDescription
NameYesIntegration name
Token TypeYesPersonal, Group, or Project
Access TokenYesGitLab access token
GitLab URLNoCustom URL for self-hosted instances (defaults to gitlab.com)

Required Token Scopes

ScopePurpose
apiFull API access for repository operations
read_repositoryRead repository content
write_repositoryPush code and create branches

Self-Hosted GitLab

If your organization runs a self-hosted GitLab instance, enter the full URL (e.g., https://gitlab.yourcompany.com) when adding the integration. ops0 will use the GitLab API v4 at that URL instead of gitlab.com.

Network Access

Your self-hosted GitLab instance must be reachable from ops0's servers. If it's behind a VPN or firewall, ensure the appropriate network rules are in place.


Connecting a Project to GitLab

After adding a GitLab integration, you can link it to IaC projects, configuration projects, or discovery sessions.

Open Project Settings

In your IaC or Configuration project, go to Settings > Version Control.

Select GitLab

Choose your GitLab integration from the dropdown.

Choose Repository

Browse your GitLab groups and select the target repository.

Configure Branch

Set the default branch for syncing (e.g., main or develop).

Sync Direction

Choose whether to push from ops0 to GitLab, pull from GitLab to ops0, or bidirectional sync.


Creating Merge Requests

When you sync changes from ops0 to GitLab, ops0 can automatically create a merge request with a templated description that includes the change summary, affected resources, and policy check results.

MR FieldAuto-populated
TitleChange description from ops0
DescriptionResources changed, policy results, cost impact
Source Branchops0 working branch
Target BranchConfigured default branch

Credential Security

All GitLab access tokens are encrypted at rest using AES-256-GCM encryption. Tokens are only decrypted in memory during API calls. ops0 never logs or displays tokens after the initial connection.


Troubleshooting

Token Invalid
Verify the token hasn't expired. GitLab tokens can have expiration dates. Generate a new token if needed.
Repository Not Found
Ensure the token has access to the target group or project. Group tokens only see repositories within that group.
Self-Hosted Connection Refused
Check that your GitLab URL is correct and the instance is reachable. Verify SSL certificates are valid.