Commit 26a4edb5 authored by Michael Eddington's avatar Michael Eddington

Move defaults into script for DAST API

parent 2fc93a86
---
title: Move defaults into script for DAST API
merge_request: 60064
author:
type: changed
...@@ -23,17 +23,7 @@ variables: ...@@ -23,17 +23,7 @@ variables:
# (SAST, Dependency Scanning, ...) # (SAST, Dependency Scanning, ...)
SECURE_ANALYZERS_PREFIX: "registry.gitlab.com/gitlab-org/security-products/analyzers" SECURE_ANALYZERS_PREFIX: "registry.gitlab.com/gitlab-org/security-products/analyzers"
# #
DAST_API_PROFILE: Full
DAST_API_VERSION: "1" DAST_API_VERSION: "1"
DAST_API_CONFIG: .gitlab-dast-api.yml
DAST_API_TIMEOUT: 30
DAST_API_REPORT: gl-dast-api-report.json
DAST_API_REPORT_ASSET_PATH: assets
#
# Wait up to 5 minutes for API Security and target url to become
# available (non 500 response to HTTP(s))
DAST_API_SERVICE_START_TIMEOUT: "300"
#
DAST_API_IMAGE: registry.gitlab.com/gitlab-org/security-products/analyzers/api-fuzzing:${DAST_API_VERSION}-engine DAST_API_IMAGE: registry.gitlab.com/gitlab-org/security-products/analyzers/api-fuzzing:${DAST_API_VERSION}-engine
dast: dast:
...@@ -76,16 +66,7 @@ dast: ...@@ -76,16 +66,7 @@ dast:
dast_api: dast_api:
stage: dast stage: dast
image: image: $DAST_API_IMAGE
name: $DAST_API_IMAGE
entrypoint: ["/bin/bash", "-l", "-c"]
variables:
API_SECURITY_MODE: DAST
DAST_API_NEW_REPORT: 1
DAST_API_PROJECT: $CI_PROJECT_PATH
DAST_API_API: http://127.0.0.1:5000
DAST_API_LOG_SCANNER: gl-dast-api-scanner.log
TZ: America/Los_Angeles
allow_failure: true allow_failure: true
rules: rules:
- if: $DAST_API_BETA == null - if: $DAST_API_BETA == null
...@@ -110,33 +91,12 @@ dast_api: ...@@ -110,33 +91,12 @@ dast_api:
- if: $CI_COMMIT_BRANCH && - if: $CI_COMMIT_BRANCH &&
$GITLAB_FEATURES =~ /\bdast\b/ $GITLAB_FEATURES =~ /\bdast\b/
script: script:
# - /peach/analyzer-dast-api
# Run user provided pre-script
- sh -c "$DAST_API_PRE_SCRIPT"
#
# Make sure asset path exists
- mkdir -p $DAST_API_REPORT_ASSET_PATH
#
# Start API Security background process
- dotnet /peach/Peach.Web.dll &> $DAST_API_LOG_SCANNER &
- APISEC_PID=$!
#
# Start scanning
- worker-entry
#
# Run user provided post-script
- sh -c "$DAST_API_POST_SCRIPT"
#
# Shutdown API Security
- kill $APISEC_PID
- wait $APISEC_PID
#
artifacts: artifacts:
when: always when: always
paths: paths:
- $DAST_API_REPORT_ASSET_PATH - gl-assets
- $DAST_API_REPORT - gl-dast-api-report.json
- $DAST_API_LOG_SCANNER
- gl-*.log - gl-*.log
reports: reports:
dast: $DAST_API_REPORT dast: gl-dast-api-report.json
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