From c7abb93fa597774313ad260c8a10b7995a62eb94 Mon Sep 17 00:00:00 2001 From: satyamchaurasiapersistent <102941840+satyamchaurasiapersistent@users.noreply.github.com> Date: Wed, 26 Apr 2023 12:38:03 +0530 Subject: [PATCH] Added Documentaition for scanID as output variable (#1222) --- docs/Configuration.md | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/docs/Configuration.md b/docs/Configuration.md index f9256e210..2ae9af141 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -30,6 +30,7 @@ * [BugTrackers](#bugtrackers) * [Encryption](#encryption) * [External Scripting](#external) +* [SAST Scan ID in Github Action Output variable](#outputscanid) CxFlow uses **Spring Boot** and for Server Mode, it requires an `application.yml` file to drive the execution. The sections below outlines available properties and when/how they can be used in different execution modes. In addition, all the Spring Boot configuration rules apply. For additional information on Spring Boot, refer to https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html @@ -1027,4 +1028,34 @@ There are places where a custom **groovy** script can be used while executing Cx * The project name to be used. * The team to be used. -For additional information, refer to the [External Scripting](https://github.com/checkmarx-ltd/cx-flow/wiki/External-Scripts) chapter. \ No newline at end of file +For additional information, refer to the [External Scripting](https://github.com/checkmarx-ltd/cx-flow/wiki/External-Scripts) chapter. + +## SAST Scan ID in Github Action Output variable +If user want to use SAST Scan ID for further usage cx-flow stores SCAN ID in githuab output variable name : **cxflowscanid** + +``` +- name: Checkmarx CxFlow Action + id: step1 + uses: cx-flow/checkmarx-cxflow-github-action@v1.6 + project: ${{ github.event.repository.name }} + team: ${{ secrets.CHECKMARX_TEAMS }} + checkmarx_url: ${{ secrets.CHECKMARX_URL }} + checkmarx_username: ${{ secrets.CHECKMARX_USERNAME }} + checkmarx_password: ${{ secrets.CHECKMARX_PASSWORD }} + checkmarx_client_secret: ${{ secrets.CHECKMARX_CLIENT_SECRET }} + scanners: sast + params: --github --checkmarx.incremental=false --checkmarx.settings-override=true --namespace=${{ github.repository_owner }} --repo-name=${{ github.event.repository.name }} --branch=${{ github.ref_name }} --cx-flow.filter-severity --cx-flow.filter-category --checkmarx.disable-clubbing=true --repo-url=${{ github.event.repository.url }} + +``` +Steps to retrieve SCAN ID**** in output variable - + +* Since Scan ID we are getting only after run of cx-flow, So we will use ID of Checkmarx CxFlow Action steps in output variable to fetch SCAN ID +``` +outputs: + output1: ${{ steps.step1.outputs.cxflowscanid }} +``` +* Now SCAN ID is stored in output1 variable which can be used in any jobs as per user convince. + + +**NOTE**: If SAST scan is taking time to scan files and other jobs are stuck due to this so user can run cx-flow in Async mode and with the help of SCAN ID from output variable, User can fetch results. +In This way there is no jobs will be blocked due to processing of cx-flow. \ No newline at end of file