secscanner2junit: Convert Security Scanner Output to JUnit Format · Pythie
.gitlab-ci.yml
Which scanning types are supported? All scanning types available under the free tier:
Secret Scanning
Static Application Security Testing (SAST)
Container Scanning
Infrastructure as Code Scanning
How to use?
Overwrite the existing job so that the report can be used by future jobs.
Convert report
Upload converted report as junit report
Report input types: You can use following report types as inputs with ss2ju command. (f.e ss2ju sast ....)
Example for Secret Scanning This example can be used as is.
stages:
- test
- convert
- include:
- template: Security/Secret-Detection.gitlab-ci.yml
secret_detection:
artifacts:
paths:
- gl-secret-detection-report.json
when: always
secret_convert:
stage: convert
dependencies:
- secret_detection
script:
- pip3 install SecScanner2JUnit
- ss2ju secrets gl-secret-detection-report.json gl-secret-detection-report.xml
artifacts:
reports:
junit: gl-secret-detection-report.xml
Example for SAST Since GitLab decides dynamically which scanners to use depending on project languages, it makes sense to first perform a testrun only including the template. This way one can see which jobs are executed and then overwrite them.
stages:
- test
- convert
- include:
- template: Security/SAST.gitlab-ci.yml
semgrep-sast:
after_script:
- cp gl-sast-report.json gl-sast-semgrep-report.json
artifacts:
paths:
- gl-sast-semgrep-report.json
when: always
brakeman-sast:
after_script:
- cp gl-sast-report.json gl-sast-brakeman-report.json
artifacts:
paths:
- gl-sast-brakeman-report.json
when: always
semgrep-sast-convert:
stage: convert
dependencies:
- semgrep-sast
script:
- pip3 install SecScanner2JUnit
- ss2ju sast gl-sast-semgrep-report.json gl-sast-semgrep-report.xml
artifacts:
reports:
junit: gl-sast-semgrep-report.xml
brakeman-sast-convert:
stage: convert
dependencies:
- brakeman-sast
script:
- pip3 install SecScanner2JUnit
- ss2ju sast gl-sast-brakeman-report.json gl-sast-brakeman-report.xml
artifacts:
reports:
junit: gl-sast-brakeman-report.xml
Example for Container Scanning - include:
- template: Jobs/Build.gitlab-ci.yml #Build and push the container image
- template: Security/Container-Scanning.gitlab-ci.yml #Scan the built image
container_scanning:
artifacts:
paths:
- gl-container-scanning-report.json
when: always
container_scanning-convert:
stage: convert
dependencies:
- container_scanning
script:
- pip3 install SecScanner2JUnit
- ss2ju container_scanning gl-container-scanning-report.json gl-container-scanning-report.xml
artifacts:
reports:
junit: gl-container-scanning-report.xml
Suppression You can provide a file with suppression which will allow to ignore some vulnerabilities.
You have to create a file ss2ju-config.yml f.e. in .gitlab directory which includes:
sast:
suppressions:
- type: "cwe"
value: "2555"
- type: "find_sec_bugs_type"
value: "SPRING_ENDPOINT"
- id: "db914ce5737b49650ae650fc3b0fe38a531eadd8ea780f48a013419c4adec7f0"
And now you can modify execution commands as follows:
- ss2ju sast gl-sast-semgrep-report.json gl-sast-semgrep-report.xml .gitlab/ss2ju-config.yml
Usage with docker ...
secret_convert:
stage: convert
image:
name: logchange/secscanner2junit:latest
entrypoint: [""]
dependencies:
- secret_detection
script:
- ss2ju secrets gl-secret-detection-report.json gl-secret-detection-report.xml
artifacts:
reports:
junit: gl-secret-detection-report.xml
Development Create Python Virtual Environment
Activate Python Virtual Environment
source ./venv/bin/activate
Popularity
Downloads, last 7 days 12.9K-35%
Stars, last 7 days –
Direct dependents 0
All dependents 0 28
Low activity
Maintenance, out of 100
Recent release
last release 658 days ago
Commit activity
0/26 weeks with commits
Release cadence
0 releases in 12 months
Issues & PRs handled
50% closed in the past year
Contributor spread
5 authors in last 100 commits
OpenSSF Scorecard
not evaluated
Releases
Latest 1.1.0
Released Feb 8, 2025
Releases, 12 months 0
First release Feb 8, 2022 Compatibility
Requires Python <4.0,>=3.10
Tested on 3.10 · 3.11 · 3.12 · 3.13
License GPL-3.0-only (Copyleft)