|
| 1 | +# This workflow uses actions that are not certified by GitHub. |
| 2 | +# They are provided by a third-party and are governed by |
| 3 | +# separate terms of service, privacy policy, and support |
| 4 | +# documentation. |
| 5 | +# |
| 6 | +# SOOS is the easy-to-integrate and affordable software security solution for your whole team. |
| 7 | +# |
| 8 | +# Learn more at https://soos.io/ |
| 9 | +# |
| 10 | +# To use this action, perform the following steps: |
| 11 | +# |
| 12 | +# 1. Create an account on https://app.soos.io. SOOS offers a free 30 day trial for our SCA, DAST, and SBOM products. |
| 13 | +# |
| 14 | +# 2. Navigate to the "Integrate" page in the SOOS app (https://app.soos.io/integrate/dast/). Note the "API Credentials" section of this page; the keys you will need for the next step are here. |
| 15 | +# |
| 16 | +# 3. Set up your SOOS API Key and SOOS Client Id as Github Secrets named SOOS_API_KEY and SOOS_CLIENT_ID. |
| 17 | +# |
| 18 | +# 4. (Optional) If you'd like to upload SARIF results of DAST scans to GitHub, set SOOS_GITHUB_PAT with your Github Personal Access Token. |
| 19 | +# |
| 20 | +# Check for the latest version here: https://github.com/marketplace/actions/soos-dast |
| 21 | + |
| 22 | +name: "SOOS DAST Scan" |
| 23 | + |
| 24 | +on: |
| 25 | + push: |
| 26 | + branches: [ "master" ] |
| 27 | + pull_request: |
| 28 | + branches: [ "master" ] |
| 29 | + |
| 30 | +jobs: |
| 31 | + soos: |
| 32 | + permissions: |
| 33 | + security-events: write # for uploading code scanning alert info |
| 34 | + actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status |
| 35 | + name: SOOS DAST Analysis |
| 36 | + runs-on: ubuntu-latest |
| 37 | + steps: |
| 38 | + - name: Run SOOS DAST Analysis |
| 39 | + uses: soos-io/soos-dast-github-action@a7eb40b94c1c81eb76b178ba1befdc21823f86fa |
| 40 | + with: |
| 41 | + client_id: ${{ secrets.SOOS_CLIENT_ID }} |
| 42 | + api_key: ${{ secrets.SOOS_API_KEY }} |
| 43 | + project_name: "<YOUR-PROJECT-NAME>" |
| 44 | + scan_mode: "baseline" |
| 45 | + target_url: "https://www.example.com/" |
| 46 | + export_format: "Sarif" |
| 47 | + export_file_type: "Json" |
| 48 | + - name: Find and rename SARIF file since it is unique |
| 49 | + run: | |
| 50 | + file=$(find . -name "*.sarif.json" | head -n 1) |
| 51 | + if [ -n "$file" ]; then |
| 52 | + mv "$file" output.sarif.json |
| 53 | + echo "Renamed $file to output.sarif.json" |
| 54 | + else |
| 55 | + echo "No SARIF file found" && exit 1 |
| 56 | + fi |
| 57 | + - name: Upload SOOS DAST SARIF Report |
| 58 | + uses: github/codeql-action/upload-sarif@v3 |
| 59 | + with: |
| 60 | + sarif_file: output.sarif.json |
0 commit comments