GitLab
Setting up a GitLab Integration in Corgea
Here’s the updated documentation with information about adding repositories from GitLab using the Dropsite:
Setting up the GitLab Integration with Corgea
Corgea’s GitLab integration allows you to seamlessly connect your GitLab repositories with Corgea’s powerful vulnerability scanning and remediation capabilities. With this integration, you can automatically scan your code for security vulnerabilities during merge requests, and Corgea will provide detailed comments with identified issues and suggested fixes. Additionally, you can add repositories from GitLab to Corgea using the Dropsite feature.
Prerequisites
Before setting up the GitLab integration, ensure that you have the following:
- A Corgea account
- A GitLab account with a repository you want to integrate
Setting up the Integration
Access Integrations
Log in to your Corgea account and navigate to the “Integrations” section.
Add GitLab Integration
Click on the “Add Integration” button and select “GitLab” from the list of available integrations.
Configure Integration
In the “Add GitLab Integration” form, provide the following information:
- Name: A descriptive name for your GitLab integration.
- GitLab URL: The URL of your GitLab instance (e.g.,
https://gitlab.com
or your self-hosted GitLab URL). - Secure Token: A personal access token with the necessary permissions to access your GitLab repository. You can generate a new token by following the GitLab documentation.
- Comment on Merge Requests: Check this option if you want Corgea to automatically comment on merge requests with identified vulnerabilities and suggested fixes.
Save Configuration
Click “Save” to create the GitLab integration.
Setting up GitLab
To enable Corgea to scan your repositories and comment on merge requests, you’ll need to configure a few settings in GitLab:
Create Personal Access Token
- Log in to your GitLab account
- Go to your User Settings > Access Tokens
- Create a new token with the following scopes:
api
(Read/Write API access)read_api
read_repository
write_repository
- Copy the generated token - you’ll need this for the Corgea integration setup
Configure Webhook
For Project-level webhook:
- Go to your project’s Settings > Webhooks
- Add a new webhook with the following settings:
- URL:
https://corgea.app/gitlab_webhook
(or your provided webhook URL) - Select triggers:
- Merge request events
- Comments
- URL:
- Click “Add webhook”
For Group-level webhook:
- Go to your group’s Settings > Webhooks
- Follow the same steps as above
- The webhook will apply to all projects in the group
Verify Configuration
- Create a test merge request
- Verify that Corgea receives the webhook and comments on the merge request
- Check the webhook’s recent deliveries in GitLab to ensure successful communication
Adding Repositories from GitLab using the Dropsite
Access Dropsite
Log in to your Corgea account and navigate to the Dropsite section.
Select Connection Method
In the “Add your code” step, select the “Connect Corgea” option.
Choose GitLab
Choose the “GitLab” integration from the list of available integrations.
Select Repository
Select the repository and branch you want to scan from your GitLab account.
Initiate Scan
Click “Confirm” to initiate the scan.
Corgea will retrieve the code from the selected repository and branch, and perform a comprehensive security scan.
How the Integration Works
Once the GitLab integration is set up, Corgea will automatically scan your code for vulnerabilities whenever a new merge request is created or updated. Here’s how the integration works:
- When a merge request is created or updated in your GitLab repository, Corgea receives a webhook notification from GitLab.
- Corgea retrieves the code changes from the merge request and performs a comprehensive security scan.
- If any vulnerabilities are detected, Corgea will post a comment on the merge request with details about the identified issues and suggested fixes.
- You can review the comments and apply the suggested fixes to remediate the vulnerabilities before merging the code.
Benefits of the GitLab Integration
By integrating Corgea with your GitLab repository, you can enjoy the following benefits:
- Automated Security Scanning: Corgea automatically scans your code for vulnerabilities during the merge request process, ensuring that security issues are caught early in the development cycle.
- Detailed Vulnerability Reports: Corgea provides detailed information about identified vulnerabilities, including their severity, location, and potential impact.
- Suggested Fixes: Corgea not only identifies vulnerabilities but also provides suggested fixes to help you remediate the issues quickly and efficiently.
- Seamless Integration: The GitLab integration seamlessly integrates with your existing development workflow, minimizing disruptions and ensuring a smooth security review process.
- Improved Code Quality: By addressing security vulnerabilities early in the development cycle, you can improve the overall quality and security of your codebase.
- Flexible Scanning Options: In addition to automatic merge request scanning, you can use the Dropsite feature to scan repositories from GitLab on-demand.
By leveraging Corgea’s GitLab integration and the Dropsite feature, you can enhance the security of your applications while streamlining your development processes, ultimately delivering more secure and reliable software to your users.