-
Notifications
You must be signed in to change notification settings - Fork 4
70 lines (63 loc) · 2.38 KB
/
fortify.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
on: [pull_request]
permissions:
actions: write
checks: write
contents: write
pull-requests: write
statuses: write
jobs:
test_fortify:
runs-on: ubuntu-latest
steps:
- name: Setup Java on this machine
uses: actions/setup-java@v3
with:
distribution: "oracle"
java-version: "19"
- name: Setup Maven on this machine
uses: stCarolas/[email protected]
with:
maven-version: 3.8.6
- name: Setup Node on this machine
uses: actions/[email protected]
with:
node-version: 18
- name: Install sed
run: sudo apt-get update && sudo apt-get install -y sed
- name: Checkout repo to get code
uses: actions/checkout@v3
- name: Download Fortify uploader CLI
run: |
wget https://tools.fortify.com/scancentral/Fortify_ScanCentral_Client_21.2.0_x64.zip -O fcs.zip
unzip fcs.zip
chmod +x bin/scancentral
wget https://github.com/fod-dev/fod-uploader-java/releases/download/v5.4.0/FodUpload.jar -O FodUpload.jar
- name: Run Fortify SAST scan
run: |
./bin/scancentral package -bt mvn -o fortify_package.zip
UPLOAD_OUTPUT=$(java -jar FodUpload.jar \
-z fortify_package.zip \
-ep SingleScanOnly \
-portalurl https://ams.fortify.com/ \
-apiurl https://api.ams.fortify.com/ \
-userCredentials ${{ secrets.FORTIFY_USER }} ${{ secrets.FORTIFY_TOKEN }} \
-tenantCode ${{ secrets.FORTIFY_TENANT }} \
-releaseId ${{ secrets.FORTIFY_RELEASE_ID }} \
-pp Queue)
SCAN_ID=$(echo "$UPLOAD_OUTPUT" | sed -n 's/Scan \([0-9]*\).*$/\1/p')
FORTIFY_USER=${{ secrets.FORTIFY_USER }} FORTIFY_TOKEN=${{ secrets.FORTIFY_TOKEN }} FORTIFY_TENANT=${{ secrets.FORTIFY_TENANT }} node .github/scripts/fortify-wait-fpr.js "$SCAN_ID"
- name: Archive fpr
if: always()
uses: actions/upload-artifact@v3
with:
name: fpr
path: scandata.fpr
- name: Run Mobb on the findings and get fixes
if: always()
uses: mobb-dev/[email protected]
with:
report-file: "scandata.fpr"
api-key: ${{ secrets.MOBB_API_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
scanner: fortify
mobb-project-name: Action