Skip to content

Commit 465fdc5

Browse files
Merge pull request #2 from nvsecurity/task/update-cli-0.4.0
update cli to 0.4.0
2 parents 58177fa + 39735a0 commit 465fdc5

File tree

2 files changed

+575
-3
lines changed

2 files changed

+575
-3
lines changed

.github/workflows/nightvision.yml

+11-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ on:
66

77
env:
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

1113
jobs:
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

0 commit comments

Comments
 (0)