File tree 2 files changed +575
-3
lines changed
2 files changed +575
-3
lines changed Original file line number Diff line number Diff line change 6
6
7
7
env :
8
8
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
10
12
11
13
jobs :
12
14
test :
@@ -23,13 +25,19 @@ jobs:
23
25
python -m pip install semgrep --user
24
26
25
27
- 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
27
33
28
34
- name : (4) Start the app
29
35
run : docker-compose up -d; sleep 10
30
36
31
37
- 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
33
41
34
42
- name : (6) Upload SARIF file to GitHub Security Alerts if vulnerabilities are found
35
43
uses : github/codeql-action/upload-sarif@v2
You can’t perform that action at this time.
0 commit comments