Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/mobb-checkmarx.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Mobb/Checkamrx Fixer on pull requests
# This workflow defines the needed steps to run Checkmarx on every pull request and pass the results to Mobb Fixer.
#
# Secrets in use (add your missing ones):
# CX_TENANT - your Checkmarx tenant name (found in your Checkmarx settings)
# CX_API_TOKEN - your Checkmarx credentials (find how to get it here: https://checkmarx.com/resource/documents/en/34965-68775-generating-a-refresh-token--api-key-.html)
# CX_BASE_URI - your Checkmarx app url, e.g. "https://ast.checkmarx.net/"
# CX_BASE_AUTH_URI - your Checkmarx auth url, e.g. "https://iam.checkmarx.net/"
# MOBB_API_TOKEN - your mobb user credentials (autumatially set if you used the Mobb app to configure the integration)
# GITHUB_TOKEN - automatically set by GitHub

name: "Mobb/Checkmarx"

on:
pull_request:
branches: ["*"]

jobs:
scan-and-fix:
name: Scan with Checkmarx and fix with Mobb
runs-on: 'ubuntu-latest'
timeout-minutes: 360
permissions:
pull-requests: write
statuses: write
contents: read
actions: read

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Download and configure Checkmarx CLI
run: |
wget https://github.com/Checkmarx/ast-cli/releases/download/2.0.54/ast-cli_2.0.54_linux_x64.tar.gz -O checkmarx.tar.gz
tar -xf checkmarx.tar.gz
./cx configure set --prop-name cx_apikey --prop-value ${{ secrets.CX_API_TOKEN }}
./cx configure set --prop-name cx_base_auth_uri --prop-value ${{ secrets.CX_BASE_AUTH_URI }}
./cx configure set --prop-name cx_base_uri --prop-value ${{ secrets.CX_BASE_URI }}
./cx configure set --prop-name cx_tenant --prop-value ${{ secrets.CX_TENANT }}
shell: bash -l {0}

- name: Run Checkmarx SAST scan
run: ./cx scan create --project-name ${{ github.repository }} -s ./ --report-format json --scan-types sast --branch nobranch --threshold "sast-high=1; sast-medium=1; sast-low=1"
shell: bash -l {0}

- name: Run Mobb on the findings and get fixes
if: always()
uses: mobb-dev/action/review@v1.1
with:
report-file: cx_result.json
api-key: ${{ secrets.MOBB_API_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
scanner: checkmarx