Skip to content

Commit 48188b3

Browse files
authored
Merge pull request #13 from nvsecurity/NV-4412-ci-pipeline-fixes
NV-4412 Fix GitLab/Azure CI: Compose v2, drop removed scan -a flag, pin ubuntu
2 parents 962d24a + 4471a6f commit 48188b3

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

.gitlab-ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ workflow:
3333

3434
extract_spec:
3535
stage: extract
36-
image: ubuntu:latest
36+
image: ubuntu:24.04
3737
before_script:
3838
- apt-get update && apt-get install -y wget ca-certificates
3939
- wget -c https://downloads.nightvision.net/binaries/latest/nightvision_latest_linux_amd64.tar.gz -O - | tar -xz
@@ -59,24 +59,24 @@ extract_spec:
5959

6060
dast_scan:
6161
stage: scan
62-
image: ubuntu:latest
62+
image: ubuntu:24.04
6363
services:
6464
- docker:dind
6565
before_script:
66-
- apt-get update && apt-get install -y wget ca-certificates docker.io docker-compose
66+
- apt-get update && apt-get install -y wget ca-certificates docker.io docker-compose-v2
6767
- wget -c https://downloads.nightvision.net/binaries/latest/nightvision_latest_linux_amd64.tar.gz -O - | tar -xz
6868
- mv nightvision /usr/local/bin/
6969
script:
7070
# Fail the job on a scan error even though the scan output is piped to tee:
7171
# without pipefail the pipeline's exit status would be tee's (always 0).
7272
- set -o pipefail
7373
# Start the target application.
74-
- docker-compose up -d
74+
- docker compose up -d
7575
- sleep 15
7676
# Run the scan and capture its id robustly: extract the scan UUID from the
7777
# output (rather than assuming it is the first line) and fail loudly if none
7878
# is produced, instead of feeding an empty -s to the export.
79-
- nightvision scan "${NIGHTVISION_TARGET}" -a "${NIGHTVISION_APP}" --auth "${NIGHTVISION_AUTH}" | tee scan-results.txt
79+
- nightvision scan "${NIGHTVISION_TARGET}" --auth "${NIGHTVISION_AUTH}" | tee scan-results.txt
8080
- SCAN_ID=$(grep -oiE '[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}' scan-results.txt | head -n1)
8181
- 'test -n "${SCAN_ID}" || { echo "ERROR no scan id found in scan output" >&2; exit 1; }'
8282
# Native GitLab DAST report (replaces the former fetch-and-run Python converter).

azure-pipelines.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
## Optional steps can be preformed locally or in the pipeline
99
# nightvision swagger extract ./ -t javaspringvulny-api --lang spring
10-
# nightvision scan javaspringvulny-api -a javaspringvulny-api
10+
# nightvision scan javaspringvulny-api --auth javaspringvulny-api
1111

1212
trigger:
1313
- main
@@ -53,7 +53,7 @@ stages:
5353
displayName: 'Start the App'
5454
5555
- script: |
56-
nightvision scan $NIGHTVISION_TARGET -a $NIGHTVISION_APP --auth $NIGHTVISION_AUTH > scan-results.txt
56+
nightvision scan $NIGHTVISION_TARGET --auth $NIGHTVISION_AUTH > scan-results.txt
5757
nightvision export sarif -s "$(head -n 1 scan-results.txt)" --swagger-file openapi-spec.yml
5858
displayName: 'Scan the API'
5959
env:

0 commit comments

Comments
 (0)