How to connect one or more of your GitLab Self-Managed projects to new or existing applications in Polaris. This can be done either by using a secure tunnel or by adding the Polaris integration IPs to your allow list.
Connect Polaris to GitLab Self-Managed
Use one of the following methods depending on your network configuration:
- IP allowlisting - For internet-accessible instances, add the Polaris integration IP ranges to your allow list. See the Integrations section of Polaris IP ranges.
- Polaris Secure Tunnel - For instances on a private network, create a secure tunnel for GitLab Self-Managed first. We strongly recommend that Bridge can switch to the
nobodyuser when it starts the tunnel. See Add and manage secure tunnels in the Polaris UI and Create a secure tunnel using Bridge CLI.
Creating an access token
Authentication between GitLab and Polaris is managed with an access token that you create in GitLab. If you haven't done so already, create an access token. For additional information: GitLab Docs > GitLab token overview.
- Select your avatar.
- Select Edit profile.
- On the left sidebar, select Access tokens.
- Select Add new token.
- Set the token's expiration date. We recommend setting a maximum expiration period, to avoid issues.
- Select the role (for Project/Group Access Tokens). Select any role above “Guest”.
- Under Select scopes, select read_repository, read_api, write_repository and api.
Onboard to Polaris applications and projects
This procedure describes how to onboard one or more GitLab projects to new or existing Polaris applications. During this process, you'll have the option of importing all GitLab projects in your SCM instance or choosing specific projects to import.
The import mappings are as follows:
- (Automatic import only) GitLab groups are mapped to Polaris applications
- GitLab projects are mapped to Polaris projects
- GitLab branches are mapped to Polaris branches
The names of new Polaris applications and projects will match your GitLab group and project names, respectively.
See General Prerequisites before starting.
Onboard GitLab projects into an application
This procedure describes how to onboard one or more GitLab projects to a single existing Polaris application. Each GitLab project you select is mapped to a new Polaris project within that application.
See General Prerequisites before starting.
Next steps
- Organization admins can monitor activity in audit logs (My Organization > Audit Logs).
- After onboarding, you can change settings or add the following:
- You can also scan on demand (see How to test from the web UI) or schedule automatic testing on a daily or weekly basis (see Test scheduling policies). Note: From the Tests screen, before beginning a test manually, make sure to test the connection.
- To scan from a CI/CD pipeline or local machine, add Bridge CLI to your build process. For posting merge request comments to an on-premises GitLab instance, the CI environment or local machine requires
HTTPS_PROXYorHTTP_PROXYconfigured to route traffic through the tunnel. See Using Bridge CLI with Polaris.