Sign inSign up

aikidosecurity/gitlab-ci-integration

By aikidosecurity

Updated over 1 year ago

GitLab Pipelines job from Aikido Security to scan for vulnerabilities introduced in merge requests

Image
0

1.3K

aikidosecurity/gitlab-ci-integration repository overview

Aikido Security Gitlab CI security scanner

This repository contains an application that can be used in GitLab Pipelines. It will trigger a scan in Aikido to make sure no new critical issues are introduced into your application. This action is available in any paid plan at Aikido.

Using this job

We recommend to only run this job on merge requests. This will make sure only your latest changes are scanned and the scan will happen faster. It is therefore important to include the following bit to the job:

only:
    - merge_requests

Firstly, you need to obtain the CI Integration Token from the Aikido settings page and add it to the variables of your CI CD pipeline in Gitlab.

Note: Make sure the variable is available on all branches (uncheck the protect variable checkbox).

Next you can use our docker image to run the action using the example snippet below:

stages:
    - verify

aikido_security_dependency_scanning:
    stage: verify
    image:
        name: registry.gitlab.com/aikido-security/gitlab-ci-integration/dependency-scanner:latest
        entrypoint: ['/bin/sh', '-c']
    only:
        - merge_requests
    script:
        - node /app/index.js --secret_key $AIKIDO_SECRET_KEY

By default, the job will fail if the scan did not complete within 2 minutes. You can control this behaviour by providing the fail_on_timeout parameter to the script and set it to false:

stages:
    - verify

aikido_security_dependency_scanning:
    stage: verify
    image:
        name: registry.gitlab.com/aikido-security/gitlab-ci-integration/dependency-scanner:latest
        entrypoint: ['/bin/sh', '-c']
    only:
        - merge_requests
    script:
        - node /app/index.js --secret_key $AIKIDO_SECRET_KEY --fail_on_timeout false

This integration will block a pipeline when it detects of critical severity by default. If you'd like to be more conservative and fail on another severity, you can also do so via a parameter to the script:

stages:
    - verify

aikido_security_dependency_scanning:
    stage: verify
    image:
        name: registry.gitlab.com/aikido-security/gitlab-ci-integration/dependency-scanner:latest
        entrypoint: ['/bin/sh', '-c']
    only:
        - merge_requests
    script:
        - node /app/index.js --secret_key $AIKIDO_SECRET_KEY --minimum_severity MEDIUM

Now the action will still shut down after 2 minutes, but it won't fail and block your pipeline.

Below we listed a table with all properties you can provide to the action

propertyrequireddefaultdescription
secret_keyyesN/AThe secret you generated when enabling the CI integration in your Aikido account
fail_on_timeoutnoyesWhether or not the scan will fail in case of a timeout
timeout_secondsno120The amount of seconds the scan runs before throwing a timeout error
fail_on_dependency_scannotrueWhether or not the scan will fail if new open source dependency issues are detected
fail_on_sast_scannofalseWhether or not the scan will fail if new SAST issues are detected
fail_on_iac_scannofalseWhether or not the scan will fail if new IAC issues are detected
minimum_severitynoCRITICALThe minimum severity of the issues which will cause the scan to fail. Must be one of the following values: CRITICAL, HIGH, MEDIUM, LOW.

Tag summary

Content type

Image

Digest

sha256:47587e466

Size

25.2 MB

Last updated

over 1 year ago

docker pull aikidosecurity/gitlab-ci-integration