1+ name : Fortify Scan
2+ on :
3+ workflow_dispatch :
4+ workflow_call :
5+ inputs :
6+ identifier :
7+ required : true
8+ type : string
9+ push :
10+ branches-ignore :
11+ - main
12+ - release
13+
14+ permissions :
15+ id-token : write
16+ contents : read
17+
18+ concurrency :
19+ group : ${{ inputs.identifier || github.workflow }}-${{ github.event.pull_request.number || github.ref }}
20+ cancel-in-progress : ${{ github.ref_name != 'main'}}
21+
22+ jobs :
23+ fortify-scan :
24+ runs-on : macos-latest
25+ environment : Fortify
26+ steps :
27+ - uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
28+ with :
29+ persist-credentials : false
30+
31+ - name : Configure AWS credentials for fetching fortify resources
32+ uses : aws-actions/configure-aws-credentials@8c3f20df09ac63af7b3ae3d7c91f105f857d8497 # v4
33+ with :
34+ role-to-assume : ${{ secrets.AWS_ROLE_TO_ASSUME }}
35+ aws-region : ${{ secrets.AWS_REGION }}
36+ role-session-name : GHAFortifySession
37+ role-duration-seconds : 900
38+ mask-aws-account-id : true
39+
40+ - name : Download License
41+ run : |
42+ aws s3 cp s3://${{ secrets.AWS_S3_FORTIFY_BUCKET }}${{ vars.LICENSE_PATH }} fortify.license
43+
44+ - name : Download Installer
45+ run : |
46+ aws s3 cp s3://${{ secrets.AWS_S3_FORTIFY_BUCKET }}${{ vars.INSTALLER_PATH }} Fortify_SCA_and_Apps_22.1.1_Mac.tar.gz
47+ tar -xvf Fortify_SCA_and_Apps_22.1.1_Mac.tar.gz
48+ unzip Fortify_SCA_and_Apps_22.1.1_osx_x64.app.zip
49+
50+ - name : Download Scripts
51+ run : |
52+ aws s3 cp s3://${{ secrets.AWS_S3_FORTIFY_BUCKET }}${{ vars.SCRIPTS_PATH }} liveness_swift_fortify_scan.sh
53+
54+ - name : Run Installer
55+ run : |
56+ Fortify_SCA_and_Apps_22.1.1_osx_x64.app/Contents/MacOS/installbuilder.sh --mode unattended --installdir ~/amplify-ui-swift-liveness/Fortify --InstallSamples 0 --fortify_license_path fortify.license --MigrateSCA 0
57+ export PATH=~/amplify-ui-swift-liveness/Fortify/bin:$PATH
58+ fortifyupdate -acceptKey
59+ sourceanalyzer -version
60+
61+ - name : Run Scan
62+ run : |
63+ export PATH=~/amplify-ui-swift-liveness/Fortify/bin:$PATH
64+ sh ./liveness_swift_fortify_scan.sh Sources
65+
66+ confirm-pass :
67+ runs-on : ubuntu-latest
68+ name : Confirm Passing Fortify Scan
69+ if : ${{ !cancelled() }}
70+ needs : [ fortify-scan ]
71+ env :
72+ EXIT_CODE : ${{ contains(needs.*.result, 'failure') && 1 || 0 }}
73+ steps :
74+ - run : exit $EXIT_CODE
0 commit comments