Commit 57b2486e authored by Michael Eddington's avatar Michael Eddington Committed by James Lopez

Enable security report for API Fuzzing

parent 942746b8
---
title: API Fuzzing results integrated into security dashboard
merge_request: 49434
author:
type: added
...@@ -15,7 +15,8 @@ variables: ...@@ -15,7 +15,8 @@ variables:
FUZZAPI_VERSION: latest FUZZAPI_VERSION: latest
FUZZAPI_CONFIG: .gitlab-api-fuzzing.yml FUZZAPI_CONFIG: .gitlab-api-fuzzing.yml
FUZZAPI_TIMEOUT: 30 FUZZAPI_TIMEOUT: 30
FUZZAPI_REPORT: gl-api-fuzzing-report.xml FUZZAPI_REPORT: gl-api-fuzzing-report.json
FUZZAPI_REPORT_ASSET_PATH: assets
# #
FUZZAPI_D_NETWORK: testing-net FUZZAPI_D_NETWORK: testing-net
# #
...@@ -45,6 +46,7 @@ apifuzzer_fuzz: ...@@ -45,6 +46,7 @@ apifuzzer_fuzz:
variables: variables:
FUZZAPI_PROJECT: $CI_PROJECT_PATH FUZZAPI_PROJECT: $CI_PROJECT_PATH
FUZZAPI_API: http://apifuzzer:80 FUZZAPI_API: http://apifuzzer:80
FUZZAPI_NEW_REPORT: 1
TZ: America/Los_Angeles TZ: America/Los_Angeles
services: services:
- name: $FUZZAPI_IMAGE - name: $FUZZAPI_IMAGE
...@@ -75,6 +77,9 @@ apifuzzer_fuzz: ...@@ -75,6 +77,9 @@ apifuzzer_fuzz:
# Run user provided pre-script # Run user provided pre-script
- sh -c "$FUZZAPI_PRE_SCRIPT" - sh -c "$FUZZAPI_PRE_SCRIPT"
# #
# Make sure asset path exists
- mkdir -p $FUZZAPI_REPORT_ASSET_PATH
#
# Start scanning # Start scanning
- worker-entry - worker-entry
# #
...@@ -82,8 +87,12 @@ apifuzzer_fuzz: ...@@ -82,8 +87,12 @@ apifuzzer_fuzz:
- sh -c "$FUZZAPI_POST_SCRIPT" - sh -c "$FUZZAPI_POST_SCRIPT"
# #
artifacts: artifacts:
when: always
paths:
- $FUZZAPI_REPORT_ASSET_PATH
- $FUZZAPI_REPORT
reports: reports:
junit: $FUZZAPI_REPORT api_fuzzing: $FUZZAPI_REPORT
apifuzzer_fuzz_dnd: apifuzzer_fuzz_dnd:
stage: fuzz stage: fuzz
...@@ -115,6 +124,9 @@ apifuzzer_fuzz_dnd: ...@@ -115,6 +124,9 @@ apifuzzer_fuzz_dnd:
# Run user provided pre-script # Run user provided pre-script
- sh -c "$FUZZAPI_PRE_SCRIPT" - sh -c "$FUZZAPI_PRE_SCRIPT"
# #
# Make sure asset path exists
- mkdir -p $FUZZAPI_REPORT_ASSET_PATH
#
# Start peach testing engine container # Start peach testing engine container
- | - |
docker run -d \ docker run -d \
...@@ -155,6 +167,8 @@ apifuzzer_fuzz_dnd: ...@@ -155,6 +167,8 @@ apifuzzer_fuzz_dnd:
-e FUZZAPI_PROFILE \ -e FUZZAPI_PROFILE \
-e FUZZAPI_CONFIG \ -e FUZZAPI_CONFIG \
-e FUZZAPI_REPORT \ -e FUZZAPI_REPORT \
-e FUZZAPI_REPORT_ASSET_PATH \
-e FUZZAPI_NEW_REPORT=1 \
-e FUZZAPI_HAR \ -e FUZZAPI_HAR \
-e FUZZAPI_OPENAPI \ -e FUZZAPI_OPENAPI \
-e FUZZAPI_POSTMAN_COLLECTION \ -e FUZZAPI_POSTMAN_COLLECTION \
...@@ -168,6 +182,8 @@ apifuzzer_fuzz_dnd: ...@@ -168,6 +182,8 @@ apifuzzer_fuzz_dnd:
-e FUZZAPI_SERVICE_START_TIMEOUT \ -e FUZZAPI_SERVICE_START_TIMEOUT \
-e FUZZAPI_HTTP_USERNAME \ -e FUZZAPI_HTTP_USERNAME \
-e FUZZAPI_HTTP_PASSWORD \ -e FUZZAPI_HTTP_PASSWORD \
-e CI_PROJECT_URL \
-e CI_JOB_ID \
-e CI_COMMIT_BRANCH=${CI_COMMIT_BRANCH} \ -e CI_COMMIT_BRANCH=${CI_COMMIT_BRANCH} \
$FUZZAPI_D_WORKER_ENV \ $FUZZAPI_D_WORKER_ENV \
$FUZZAPI_D_WORKER_PORTS \ $FUZZAPI_D_WORKER_PORTS \
...@@ -193,6 +209,8 @@ apifuzzer_fuzz_dnd: ...@@ -193,6 +209,8 @@ apifuzzer_fuzz_dnd:
-e FUZZAPI_PROFILE \ -e FUZZAPI_PROFILE \
-e FUZZAPI_CONFIG \ -e FUZZAPI_CONFIG \
-e FUZZAPI_REPORT \ -e FUZZAPI_REPORT \
-e FUZZAPI_REPORT_ASSET_PATH \
-e FUZZAPI_NEW_REPORT=1 \
-e FUZZAPI_HAR \ -e FUZZAPI_HAR \
-e FUZZAPI_OPENAPI \ -e FUZZAPI_OPENAPI \
-e FUZZAPI_POSTMAN_COLLECTION \ -e FUZZAPI_POSTMAN_COLLECTION \
...@@ -206,7 +224,10 @@ apifuzzer_fuzz_dnd: ...@@ -206,7 +224,10 @@ apifuzzer_fuzz_dnd:
-e FUZZAPI_SERVICE_START_TIMEOUT \ -e FUZZAPI_SERVICE_START_TIMEOUT \
-e FUZZAPI_HTTP_USERNAME \ -e FUZZAPI_HTTP_USERNAME \
-e FUZZAPI_HTTP_PASSWORD \ -e FUZZAPI_HTTP_PASSWORD \
-e CI_PROJECT_URL \
-e CI_JOB_ID \
-v $CI_PROJECT_DIR:/app \ -v $CI_PROJECT_DIR:/app \
-v `pwd`/$FUZZAPI_REPORT_ASSET_PATH:/app/$FUZZAPI_REPORT_ASSET_PATH:rw \
-p 81:80 \ -p 81:80 \
-p 8001:8000 \ -p 8001:8000 \
-p 515:514 \ -p 515:514 \
...@@ -239,7 +260,9 @@ apifuzzer_fuzz_dnd: ...@@ -239,7 +260,9 @@ apifuzzer_fuzz_dnd:
paths: paths:
- ./gl-api_fuzzing*.log - ./gl-api_fuzzing*.log
- ./gl-api_fuzzing*.zip - ./gl-api_fuzzing*.zip
- $FUZZAPI_REPORT_ASSET_PATH
- $FUZZAPI_REPORT
reports: reports:
junit: $FUZZAPI_REPORT api_fuzzing: $FUZZAPI_REPORT
# end # end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment