Skip to content

Commit

Permalink
Merge pull request #8 from soos-io/feature/PA-5101
Browse files Browse the repository at this point in the history
PA-5101 Sarif changes
  • Loading branch information
SOOS-JAlvarez authored Jun 10, 2022
2 parents d906eeb + 3e0e5ff commit b524e2c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 21 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Run SOOS DAST Analysis
uses: soos-io/[email protected].2
uses: soos-io/[email protected].3
with:
client_id: ${{ secrets.SOOS_CLIENT_ID }}
api_key: ${{ secrets.SOOS_API_KEY }}
Expand Down Expand Up @@ -61,8 +61,7 @@ The `soos-io/soos-dast-github-action` Action has properties which are passed to
| build_version | [none] | Version of application build artifacts |
| build_uri | [none] | URI to CI build info |
| operating_environment | [none] | System info regarding operating system, etc. |
| sarif | false | Enable Uploading the SARIF Report to GitHub. |
| gpat | [none] | GitHub Personal Access Token. Required to upload SARIF Report
| output_format | [none] | Output in which the vulnerability report will be generated, only sarif is supported at the moment |
| zap_options | [none] | ZAP Additional Options.
| request_header | [none] | Set extra header requests.
| request_cookies | [none] | Set Cookie values for the requests to the target URL.
Expand Down
11 changes: 3 additions & 8 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,8 @@ inputs:
description: 'System info regarding operating system, etc.'
required: false
default: ${{ runner.os }}
sarif:
description: 'Generate SARIF Report'
required: false
default: 'false'
gpat:
description: 'Github Personal Access Token to upload SARIF Report.'
output_format:
description: 'Output format for report to be generated (only sarif supported at the moment)'
required: false
default: ''
zap_options:
Expand Down Expand Up @@ -110,6 +106,5 @@ runs:
- ${{ inputs.zap_options }}
- ${{ inputs.request_cookies }}
- ${{ inputs.request_header }}
- ${{ inputs.sarif }}
- ${{ inputs.gpat }}
- ${{ inputs.output_format }}
- ${{ inputs.target_url }}
16 changes: 6 additions & 10 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,14 @@ SOOS_OPERATING_ENVIRONMENT=${17}
SOOS_ZAP_OPTIONS=${18}
SOOS_REQUEST_COOKIES=${19}
SOOS_REQUEST_HEADERS=${20}
SOOS_GENERATE_SARIF_REPORT=${21}
SOOS_GITHUB_PAT=${22}
SOOS_OUTPUT_FORMAT=${21}

SOOS_TARGET_URL=${23}
SOOS_TARGET_URL=${22}

SOOS_INTEGRATION_NAME="GitHub"
SOOS_INTEGRATION_TYPE="Plugin"

PARAMS="--clientId ${SOOS_CLIENT_ID} --apiKey ${SOOS_API_KEY} --projectName ${SOOS_PROJECT_NAME} --scanMode ${SOOS_SCAN_MODE} --apiURL ${SOOS_API_BASE_URL} --integrationName ${SOOS_INTEGRATION_NAME} --integrationType ${SOOS_INTEGRATION_TYPE} --commitHash ${GITHUB_SHA} --branchName ${GITHUB_REF}"
PARAMS="--clientId ${SOOS_CLIENT_ID} --apiKey ${SOOS_API_KEY} --projectName ${SOOS_PROJECT_NAME} --scanMode ${SOOS_SCAN_MODE} --apiURL ${SOOS_API_BASE_URL} --integrationName ${SOOS_INTEGRATION_NAME} --integrationType ${SOOS_INTEGRATION_TYPE} --commitHash ${GITHUB_SHA} --branchName ${GITHUB_REF} --checkoutDir ${GITHUB_WORKSPACE}"

if [ "$SOOS_DEBUG" == "true"]; then
PARAMS+=" --debug True"
Expand Down Expand Up @@ -79,11 +78,8 @@ fi
if [ -n "$SOOS_REQUEST_HEADERS" ]; then
PARAMS+=" --requestHeader ${SOOS_REQUEST_HEADERS}"
fi
if [ "$SOOS_GENERATE_SARIF_REPORT" == "true" ]; then
PARAMS+=" --sarif=true"
fi
if [ -n "${SOOS_GITHUB_PAT}" ]; then
PARAMS+=" --gpat ${SOOS_GITHUB_PAT}"
if [ -n "$SOOS_OUTPUT_FORMAT" ]; then
PARAMS+=" --outputFormat ${SOOS_OUTPUT_FORMAT}"
fi

python3 main.py ${SOOS_TARGET_URL} ${PARAMS}
python3 main.py ${SOOS_TARGET_URL} ${PARAMS}

0 comments on commit b524e2c

Please sign in to comment.