GitLab CI
Cimon integrates seamlessly with GitLab CI/CD, providing robust support for automating your pipeline workflows.
GitLab CI/CD Runners Support
GitLab CI/CD offers flexible runner options, and Cimon is designed to adapt to various environments. Here's how Cimon supports GitLab CI/CD runners:
- Runner Compatibility: Cimon is compatible with GitLab CI/CD runners running on Ubuntu or any other supported OS.
- Host Whitelisting: GitLab-related hosts are automatically whitelisted to ensure smooth communication.
- Ignored IPs: Cimon ignores internal IP addresses to streamline communication.
- Performance Optimization: Cimon tracks descendant processes of the pipeline runner process to enhance performance.
- Custom Reporting: Cimon generates reports tailored to the GitLab CI/CD job artifacts.
Cimon Installation
Cimon can be easily installed within GitLab CI/CD pipelines using a predefined setup script. This script facilitates the download and installation of Cimon within seconds.
Usage
To install Cimon within your GitLab CI/CD pipeline, include the predefined setup script in your .gitlab-ci.yml
file:
- Detect Mode
- Prevent Mode
variables:
CIMON_CLIENT_ID: $CIMON_CLIENT_ID
CIMON_SECRET: $CIMON_SECRET
install_and_start_cimon:
before_script: |
# Download Cimon
curl -sSfL https://cimon-releases.s3.amazonaws.com/install.sh | sh
# Start Cimon
sudo -E ./bin/cimon agent start-background
script: |
# Run commands
curl -sm 1 https://34.121.34.97 || true
...
after_script: |
# Stop Cimon
sudo -E ./bin/cimon agent stop
variables:
CIMON_CLIENT_ID: $CIMON_CLIENT_ID
CIMON_SECRET: $CIMON_SECRET
CIMON_PREVENT: 1
CIMON_ALLOWED_HOSTS: |
github.com
registry.npmjs.org
cycode.com
CIMON_ALLOWED_IPS: |
34.121.34.97
test:
before_script: |
# Download Cimon
curl -sSfL https://cimon-releases.s3.amazonaws.com/install.sh | sh
# Start Cimon
sudo -E ./bin/cimon agent start-background
script: |
# Run commands
curl -sm 1 https://34.121.34.97 || true
...
after_script: |
# Stop Cimon
sudo -E ./bin/cimon agent stop
Refer to CLI for additional information regarding the supported environment variables.
Job Summary Report
Cimon can upload the final report as a job artifact. Simply specify the CIMON_REPORT_ARTIFACT
environment variable, and Cimon will utilize the CI_JOB_TOKEN
to upload the report as a job artifact. For example:
variables:
CIMON_REPORT_ARTIFACT: 1