Detailed guide

1. Add XEIZE_TOKEN

In Settings > CI/CD, add XEIZE_TOKEN as a CI/CD variable. This example posts merge request comments, so also add a GitLab personal access token with the api scope as XEIZE_GITLAB_API_TOKEN.

To share a token across projects, add it as a group variable.

GitLab CI/CD variable settings
Adding a GitLab CI/CD variable

2. Add the GitLab workflow

At the repository root, choose New file from the + menu and name the file .gitlab-ci.yml. If the file already exists, open it.

Creating the pipeline file

Paste the SAST configuration example into the new file, or incorporate it into your existing pipeline.

  • To change the language of SAST, Secret, and IaC results, add LANG: "EN" (English) or LANG: "JP" (Japanese) to variables. An unset or unsupported value defaults to Korean.
  • For a Secret scan job, set MODE: secret in variables.
  • For a self-hosted runner, match the job’s tags to the runner’s tags.

Select Commit changes to save the pipeline configuration.

Saving the pipeline configuration

3. Verify with an MR

Clone the repository

Clone the repository containing the GitLab pipeline, using its actual URL in place of the example git clone https://gitlab.com/....

Create a branch

  1. Run cd repository to enter the cloned directory, replacing repository with its actual name.
  2. Run git checkout -b pr-test to create the pr-test branch.
  3. Create the following intentionally vulnerable files.

vuln_crypto.py

python
# Unsafe Crypto Algorithm + Hardcoded key
from Crypto.Cipher import DES
ENCRYPTION_KEY = b"weak_key"
cipher = DES.new(ENCRYPTION_KEY, DES.MODE_ECB)

vuln_exec.py

python
# Unsafe Flask RCE
from flask import Flask, request

app = Flask(__name__)

@app.route('/exec')
def unsafe_exec():
    code = request.args.get('code')
    eval(code)
    return "Dangerous Code executed"
  1. Commit the changes and push the pr-test branch.
text
git add . 
git commit -m "add tests"
git push origin pr-test
  1. Return to the project containing the GitLab workflow and select New merge request.
Opening a merge request

Choose pr-test as the source branch and select the target branch. Select Compare branches and continue, complete the form, then select Create merge request.

Selecting the test branch
  1. Once the pipeline finishes, look for the XEIZE findings in the merge request comments.
XEIZE comments on the merge request
XEIZE finding details