GitLab CI/CD Integration
Set up Invicti AppSec with GitLab CI/CD for automated security scanning.
Gitlab
Gitlab pipeline that contains SAST, SCA, CS scans and SBOM import
1. Staging
Specify the each stage in here.
2. Image
The pipeline runs on the Ubuntu image.
3. Pre Scan Jobs
Installs the Kondukto CLI via curl command & exports environment variables for KONDUKTO_HOST and KONDUKTO_TOKEN.
4. Create New Project
Create a new project from CI_PROJECT_ID, and add it to product & team.
5. SAST Scan
Runs a SAST scan with the Kondukto CLI using the Checkmarx scanner. Parameters used in the scan command: Project name from Gitlab CI/CD environment variables: $CI_PROJECT_NAME. The branch or tag name for the current commit: $CI_COMMIT_REF_NAME.
6. SCA Scan
Runs an SCA scan with the Kondukto CLI using the DependencyCheck scanner. Parameters used in the scan command: Project name from Gitlab CI/CD environment variables: $CI_PROJECT_NAME. The branch or tag name for the current commit: $CI_COMMIT_REF_NAME. The --async option is added to the scan command to enable the scan to run in the background.
7. SBOM Import
Imports a Software Bill of Materials (SBOM) file named cyclonedx.json via the Kondukto CLI.
8. CS Scan
Runs a Container Security (CS) scan with the Kondukto CLI using the Trivy scanner. Parameters used in the scan command: Project name from Gitlab CI/CD environment variables: $CI_PROJECT_NAME. The branch or tag name for the current commit: $CI_COMMIT_REF_NAME. The --async option is added to the scan command to enable the scan to run in the background.
YAML
1stages:2- test3 4image: ubuntu5 6before_script:7- curl -sSL https://cli.kondukto.io | sh8- export KONDUKTO_HOST=$KONDUKTO_HOST9- export KONDUKTO_TOKEN=$KONDUKTO_TOKEN10 11Create Project:12stage: test13script:14 - kdt create project --repo-id $CI_PROJECT_ID -P "VulnerableApplications" -t "Presentation" --exit-code 015 16SAST Test:17stage: test18script:19 - echo "SAST via Kondukto"20 - kdt scan -p $CI_PROJECT_NAME -t checkmarx -b $CI_COMMIT_REF_NAME21 22SCA Test:23stage: test24script:25 - echo "SCA via Kondukto"26 - kdt scan -p $CI_PROJECT_NAME -t dependencycheck-b $CI_COMMIT_REF_NAME --async27 28SBOM Import:29stage: test30script:31 - echo "Import SBOM file"32 - kdt sbom import -f cyclonedx.json -p $CI_PROJECT_NAME33 34CS Test:35stage: test36script:37 - echo "CS via Kondukto"38 - kdt scan -p $CI_PROJECT_NAME -t trivy --image=ubuntu:latest39 - b $CI_COMMIT_REF_NAME --asyncNeed help?
Invicti Support team is ready to provide you with technical help. Go to Help Center