|
| 1 | +name: veracode |
| 2 | +on: |
| 3 | + workflow_dispatch: |
| 4 | + pull_request: |
| 5 | + merge_group: |
| 6 | +jobs: |
| 7 | + Veracode_SAST: |
| 8 | + runs-on: |
| 9 | + - ubuntu-latest |
| 10 | + steps: |
| 11 | + - uses: actions/checkout@v4.2.2 |
| 12 | + - name: Zip Scannable Files |
| 13 | + run: > |
| 14 | + find . -path '*test*' -prune -o \( -name '*.py' -o -name '*.js' -o |
| 15 | + -name '*.ts' -o -name '*.htm*' -o -name '*.json' -o -name '*.yml' \) |
| 16 | + -print | zip cfgov-gha.zip -@ |
| 17 | + - name: See Included Files |
| 18 | + run: | |
| 19 | + ls -la |
| 20 | + - name: Setup Veracode |
| 21 | + run: | |
| 22 | + curl -fsS https://tools.veracode.com/veracode-cli/install | sh |
| 23 | + - name: Get baseline from private repo |
| 24 | + run: | |
| 25 | + gh api repos/cfpb/veracode-baselines/contents/cfgov/baseline.json \ |
| 26 | + --jq '.content' | base64 -d > baseline.json |
| 27 | + env: |
| 28 | + GH_TOKEN: ${{ secrets.VERACODE_PAT }} |
| 29 | + |
| 30 | + - name: Download Veracode Static Pipeline Scanner |
| 31 | + run: > |
| 32 | + curl |
| 33 | + https://downloads.veracode.com/securityscan/pipeline-scan-LATEST.zip |
| 34 | + -o veracode.zip |
| 35 | +
|
| 36 | + unzip -o veracode.zip |
| 37 | + - name: Verify No Secret Leak |
| 38 | + continue-on-error: true |
| 39 | + run: | |
| 40 | + echo ${{secrets.VERACODE_API_ID}} |
| 41 | + - name: Veracode Static Pipeline Scanner |
| 42 | + continue-on-error: true |
| 43 | + run: > |
| 44 | + java -jar pipeline-scan.jar --veracode_api_id |
| 45 | + "${{secrets.VERACODE_API_ID}}" --veracode_api_key |
| 46 | + "${{secrets.VERACODE_API_KEY}}" --file |
| 47 | + "./cfgov-gha.zip" --baseline_file baseline.json --app_id="cfgov" |
| 48 | + --fail_on_severity="Very High, High" --summary_output true |
| 49 | +
|
| 50 | + - name: Archive Results.json & Results.txt from Veracode Static Pipeline Scanner |
| 51 | + uses: actions/upload-artifact@v4.6.2 |
| 52 | + with: |
| 53 | + name: Veracode SAST Pipeline Results |
| 54 | + path: results.* |
| 55 | + Veracode_SCA: |
| 56 | + runs-on: |
| 57 | + - ubuntu-latest |
| 58 | + steps: |
| 59 | + - uses: actions/checkout@v4.2.2 |
| 60 | + - name: SCA Scan |
| 61 | + env: |
| 62 | + SRCCLR_API_TOKEN: ${{secrets.SRCCLR_API_TOKEN}} |
| 63 | + SRCCLR_REGION: FED |
| 64 | + working-directory: ./ |
| 65 | + run: > |
| 66 | + curl -sSL https://download.sourceclear.com/ci.sh | sh -s scan |
| 67 | + --json=SCA-App-Issues.json |
| 68 | + - name: Upload SCA issues artifact |
| 69 | + uses: actions/upload-artifact@v4.6.2 |
| 70 | + with: |
| 71 | + name: Veracode SCA Scan Results |
| 72 | + path: SCA-App-Issues.json |
0 commit comments