Skip to content

Commit f4dc4b0

Browse files
authored
Create veracode.yml
1 parent 298edda commit f4dc4b0

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

.github/workflows/veracode.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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+
# This workflow will initiate a Veracode Static Analysis Pipeline scan, return a results.json and convert to SARIF for upload as a code scanning alert
7+
8+
name: Veracode Static Analysis Pipeline Scan
9+
10+
on:
11+
push:
12+
branches: [ "main" ]
13+
pull_request:
14+
# The branches below must be a subset of the branches above
15+
branches: [ "main" ]
16+
schedule:
17+
- cron: '39 22 * * 5'
18+
19+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
20+
permissions:
21+
contents: read
22+
23+
jobs:
24+
# This workflow contains a job to build and submit pipeline scan, you will need to customize the build process accordingly and make sure the artifact you build is used as the file input to the pipeline scan file parameter
25+
build-and-pipeline-scan:
26+
# The type of runner that the job will run on
27+
permissions:
28+
contents: read # for actions/checkout to fetch code
29+
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
30+
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
31+
runs-on: ubuntu-latest
32+
steps:
33+
34+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it and copies all sources into ZIP file for submitting for analysis. Replace this section with your applications build steps
35+
- uses: actions/checkout@v4
36+
with:
37+
repository: ''
38+
39+
- run: zip -r veracode-scan-target.zip ./
40+
41+
# download the Veracode Static Analysis Pipeline scan jar
42+
- run: curl --silent --show-error --fail -O https://downloads.veracode.com/securityscan/pipeline-scan-LATEST.zip
43+
- run: unzip -o pipeline-scan-LATEST.zip
44+
45+
- uses: actions/setup-java@v4
46+
with:
47+
java-version: 8
48+
distribution: 'temurin'
49+
- run: java -jar pipeline-scan.jar --veracode_api_id "${{secrets.VERACODE_API_ID}}" --veracode_api_key "${{secrets.VERACODE_API_KEY}}" --fail_on_severity="Very High, High" --file veracode-scan-target.zip
50+
continue-on-error: true
51+
- name: Convert pipeline scan output to SARIF format
52+
id: convert
53+
uses: veracode/veracode-pipeline-scan-results-to-sarif@ff08ae5b45d5384cb4679932f184c013d34da9be
54+
with:
55+
pipeline-results-json: results.json
56+
- uses: github/codeql-action/upload-sarif@v3
57+
with:
58+
# Path to SARIF file relative to the root of the repository
59+
sarif_file: veracode-results.sarif

0 commit comments

Comments
 (0)