2021-09-30 23:02:18 +05:30
|
|
|
# To contribute improvements to CI/CD templates, please follow the Development guide at:
|
|
|
|
# https://docs.gitlab.com/ee/development/cicd/templates.html
|
|
|
|
# This specific template is located at:
|
2021-12-11 22:18:48 +05:30
|
|
|
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Security/API-Fuzzing.latest.gitlab-ci.yml
|
2021-04-29 21:17:54 +05:30
|
|
|
|
2022-06-21 17:19:12 +05:30
|
|
|
# To use this template, add the following to your .gitlab-ci.yml file:
|
|
|
|
#
|
|
|
|
# include:
|
|
|
|
# template: API-Fuzzing.latest.gitlab-ci.yml
|
|
|
|
#
|
|
|
|
# You also need to add a `fuzz` stage to your `stages:` configuration. A sample configuration for API Fuzzing:
|
|
|
|
#
|
|
|
|
# stages:
|
|
|
|
# - build
|
|
|
|
# - test
|
|
|
|
# - deploy
|
|
|
|
# - fuzz
|
|
|
|
|
2021-09-30 23:02:18 +05:30
|
|
|
# Read more about this feature here: https://docs.gitlab.com/ee/user/application_security/api_fuzzing/
|
|
|
|
#
|
2022-06-21 17:19:12 +05:30
|
|
|
# Configure API Fuzzing with CI/CD variables (https://docs.gitlab.com/ee/ci/variables/index.html).
|
2021-09-04 01:27:46 +05:30
|
|
|
# List of available variables: https://docs.gitlab.com/ee/user/application_security/api_fuzzing/#available-cicd-variables
|
2021-04-29 21:17:54 +05:30
|
|
|
|
|
|
|
variables:
|
2022-06-21 17:19:12 +05:30
|
|
|
# Setting this variable affects all Security templates
|
|
|
|
# (SAST, Dependency Scanning, ...)
|
2022-08-27 11:52:29 +05:30
|
|
|
SECURE_ANALYZERS_PREFIX: "$CI_TEMPLATE_REGISTRY_HOST/security-products"
|
2022-06-21 17:19:12 +05:30
|
|
|
#
|
2022-07-16 23:28:13 +05:30
|
|
|
FUZZAPI_VERSION: "2"
|
2022-06-21 17:19:12 +05:30
|
|
|
FUZZAPI_IMAGE_SUFFIX: ""
|
2022-07-16 23:28:13 +05:30
|
|
|
FUZZAPI_IMAGE: api-security
|
2021-04-29 21:17:54 +05:30
|
|
|
|
|
|
|
apifuzzer_fuzz:
|
|
|
|
stage: fuzz
|
2022-06-21 17:19:12 +05:30
|
|
|
image: $SECURE_ANALYZERS_PREFIX/$FUZZAPI_IMAGE:$FUZZAPI_VERSION$FUZZAPI_IMAGE_SUFFIX
|
2021-04-29 21:17:54 +05:30
|
|
|
allow_failure: true
|
|
|
|
rules:
|
|
|
|
- if: $API_FUZZING_DISABLED
|
|
|
|
when: never
|
|
|
|
- if: $API_FUZZING_DISABLED_FOR_DEFAULT_BRANCH &&
|
|
|
|
$CI_DEFAULT_BRANCH == $CI_COMMIT_REF_NAME
|
|
|
|
when: never
|
2022-11-25 23:54:43 +05:30
|
|
|
|
|
|
|
# Add the job to merge request pipelines if there's an open merge request.
|
|
|
|
- if: $CI_PIPELINE_SOURCE == "merge_request_event" &&
|
|
|
|
$CI_GITLAB_FIPS_MODE == "true"
|
|
|
|
variables:
|
|
|
|
DAST_API_IMAGE_SUFFIX: "-fips"
|
|
|
|
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
|
|
|
|
|
|
# Don't add it to a *branch* pipeline if it's already in a merge request pipeline.
|
|
|
|
- if: $CI_OPEN_MERGE_REQUESTS
|
|
|
|
when: never
|
|
|
|
|
|
|
|
# Add the job to branch pipelines.
|
2022-06-21 17:19:12 +05:30
|
|
|
- if: $CI_COMMIT_BRANCH &&
|
|
|
|
$CI_GITLAB_FIPS_MODE == "true"
|
|
|
|
variables:
|
|
|
|
FUZZAPI_IMAGE_SUFFIX: "-fips"
|
2021-06-08 01:23:25 +05:30
|
|
|
- if: $CI_COMMIT_BRANCH
|
2021-04-29 21:17:54 +05:30
|
|
|
script:
|
2021-06-08 01:23:25 +05:30
|
|
|
- /peach/analyzer-fuzz-api
|
2021-04-29 21:17:54 +05:30
|
|
|
artifacts:
|
|
|
|
when: always
|
|
|
|
paths:
|
2021-06-08 01:23:25 +05:30
|
|
|
- gl-assets
|
|
|
|
- gl-api-fuzzing-report.json
|
|
|
|
- gl-*.log
|
2021-04-29 21:17:54 +05:30
|
|
|
reports:
|
2021-06-08 01:23:25 +05:30
|
|
|
api_fuzzing: gl-api-fuzzing-report.json
|