File tree Expand file tree Collapse file tree 2 files changed +575
-3
lines changed
Expand file tree Collapse file tree 2 files changed +575
-3
lines changed Original file line number Diff line number Diff line change 66
77env :
88 NIGHTVISION_TOKEN : ${{ secrets.NIGHTVISION_TOKEN }}
9- NIGHTVISION_TARGET : https://localhost:9000
9+ NIGHTVISION_TARGET : javaspringvulny-api
10+ NIGHTVISION_APP : javaspringvulny-api
11+ NIGHTVISION_AUTH : javaspringvulny-api
1012
1113jobs :
1214 test :
@@ -23,13 +25,19 @@ jobs:
2325 python -m pip install semgrep --user
2426
2527 - name : (3) Extract API documentation from code
26- run : nightvision swagger-extract ./ -u ${NIGHTVISION_TARGET} --lang spring
28+ run : |
29+ nightvision swagger extract ./ -t ${NIGHTVISION_TARGET} --lang spring || true
30+ if [ ! -e openapi-spec.yml ]; then
31+ cp backup-openapi-spec.yml openapi-spec.yml
32+ fi
2733
2834 - name : (4) Start the app
2935 run : docker-compose up -d; sleep 10
3036
3137 - name : (5) Scan the API
32- run : nightvision scan --api ${NIGHTVISION_TARGET} --export-sarif
38+ run : |
39+ nightvision scan -t ${NIGHTVISION_TARGET} -a ${NIGHTVISION_APP} --auth ${NIGHTVISION_AUTH} > scan-results.txt
40+ nightvision export sarif -s "$(head -n 1 scan-results.txt)" --swagger-file openapi-spec.yml
3341
3442 - name : (6) Upload SARIF file to GitHub Security Alerts if vulnerabilities are found
3543 uses : github/codeql-action/upload-sarif@v2
You can’t perform that action at this time.
0 commit comments