1--- 2stage: Secure 3group: Dynamic Analysis 4info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments 5type: reference, howto 6--- 7 8# DAST API **(ULTIMATE)** 9 10You can add dynamic application security testing of web APIs to your [GitLab CI/CD](../../../ci/index.md) pipelines. 11This helps you discover bugs and potential security issues that other QA processes may miss. 12 13We recommend that you use DAST API testing in addition to [GitLab Secure](../index.md)'s 14other security scanners and your own test processes. If you're using [GitLab CI/CD](../../../ci/index.md), 15you can run DAST API tests as part your CI/CD workflow. 16 17## Requirements 18 19- One of the following web API types: 20 - REST API 21 - SOAP 22 - GraphQL 23 - Form bodies, JSON, or XML 24- One of the following assets to provide APIs to test: 25 - OpenAPI v2 or v3 API definition 26 - Postman Collection v2.0 or v2.1 27 - HTTP Archive (HAR) of API requests to test 28 29## When DAST API scans run 30 31When using the `DAST-API.gitlab-ci.yml` template, the defined jobs use the `dast` stage by default. To enable your `.gitlab-ci.yml` file must include the `dast` stage in your `stages` definition. To ensure DAST API scans the latest code, your CI pipeline should deploy changes to a test environment in a stage before the `dast` stage: 32 33```yaml 34stages: 35 - build 36 - test 37 - deploy 38 - dast 39``` 40 41Note that if your pipeline is configured to deploy to the same web server on each run, running a 42pipeline while another is still running could cause a race condition in which one pipeline 43overwrites the code from another. The API to scan should be excluded from changes for the duration 44of a DAST API scan. The only changes to the API should be from the DAST API scanner. Be aware that 45any changes made to the API (for example, by users, scheduled tasks, database changes, code 46changes, other pipelines, or other scanners) during a scan could cause inaccurate results. 47 48## Enable DAST API scanning 49 50There are three ways to perform scans. See the configuration section for the one you wish to use: 51 52- [OpenAPI v2 or v3 specification](#openapi-specification) 53- [HTTP Archive (HAR)](#http-archive-har) 54- [Postman Collection v2.0 or v2.1](#postman-collection) 55 56Examples of various configurations can be found here: 57 58- [Example OpenAPI v2 specification project](https://gitlab.com/gitlab-org/security-products/demos/api-dast/openapi-example) 59- [Example HTTP Archive (HAR) project](https://gitlab.com/gitlab-org/security-products/demos/api-dast/har-example) 60- [Example Postman Collection project](https://gitlab.com/gitlab-org/security-products/demos/api-dast/postman-example) 61- [Example GraphQL project](https://gitlab.com/gitlab-org/security-products/demos/api-dast/graphql-example) 62- [Example SOAP project](https://gitlab.com/gitlab-org/security-products/demos/api-dast/soap-example) 63 64WARNING: 65GitLab 14.0 will require that you place DAST API configuration files (for example, 66`gitlab-dast-api-config.yml`) in your repository's `.gitlab` directory instead of your 67repository's root. You can continue using your existing configuration files as they are, but 68starting in GitLab 14.0, GitLab will not check your repository's root for configuration files. 69 70### OpenAPI Specification 71 72> Support for OpenAPI Specification using YAML format was 73> [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/330583) in GitLab 14.0. 74 75The [OpenAPI Specification](https://www.openapis.org/) (formerly the Swagger Specification) is an API description format for REST APIs. 76This section shows you how to configure API fuzzing using an OpenAPI Specification to provide information about the target API to test. 77OpenAPI Specifications are provided as a file system resource or URL. Both JSON and YAML OpenAPI formats are supported. 78 79DAST API uses an OpenAPI document to generate the request body. When a request body is required, 80the body generation is limited to these body types: 81 82- `application/x-www-form-urlencoded` 83- `multipart/form-data` 84- `application/json` 85 86Follow these steps to configure DAST API in GitLab with an OpenAPI specification: 87 881. To use DAST API, you must [include](../../../ci/yaml/index.md#includetemplate) 89 the [`DAST-API.gitlab-ci.yml` template](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Security/DAST-API.gitlab-ci.yml) 90 that's provided as part of your GitLab installation. Add the following to your 91 `.gitlab-ci.yml` file: 92 93 ```yaml 94 stages: 95 - dast 96 97 include: 98 - template: DAST-API.gitlab-ci.yml 99 ``` 100 1011. The [configuration file](#configuration-files) has several testing profiles defined with different checks enabled. We recommend that you start with the `Quick` profile. 102 Testing with this profile completes faster, allowing for easier configuration validation. 103 104 Provide the profile by adding the `DAST_API_PROFILE` CI/CD variable to your `.gitlab-ci.yml` file, 105 substituting `Quick` for the profile you choose: 106 107 ```yaml 108 stages: 109 - dast 110 111 include: 112 - template: DAST-API.gitlab-ci.yml 113 114 variables: 115 DAST_API_PROFILE: Quick 116 ``` 117 1181. Provide the location of the OpenAPI specification. You can provide the specification as a file 119 or URL. Specify the location by adding the `DAST_API_OPENAPI` variable: 120 121 ```yaml 122 stages: 123 - dast 124 125 include: 126 - template: DAST-API.gitlab-ci.yml 127 128 variables: 129 DAST_API_PROFILE: Quick 130 DAST_API_OPENAPI: test-api-specification.json 131 ``` 132 1331. The target API instance's base URL is also required. Provide it by using the `DAST_API_TARGET_URL` 134 variable or an `environment_url.txt` file. 135 136 Adding the URL in an `environment_url.txt` file at your project's root is great for testing in 137 dynamic environments. To run DAST API against an app dynamically created during a GitLab CI/CD 138 pipeline, have the app persist its URL in an `environment_url.txt` file. DAST API 139 automatically parses that file to find its scan target. You can see an 140 [example of this in our Auto DevOps CI YAML](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml). 141 142 Here's an example of using `DAST_API_TARGET_URL`: 143 144 ```yaml 145 stages: 146 - dast 147 148 include: 149 - template: DAST-API.gitlab-ci.yml 150 151 variables: 152 DAST_API_PROFILE: Quick 153 DAST_API_OPENAPI: test-api-specification.json 154 DAST_API_TARGET_URL: http://test-deployment/ 155 ``` 156 157This is a minimal configuration for DAST API. From here you can: 158 159- [Run your first scan](#running-your-first-scan). 160- [Add authentication](#authentication). 161- Learn how to [handle false positives](#handling-false-positives). 162 163WARNING: 164**NEVER** run DAST API testing against a production server. Not only can it perform *any* function that the API can, it may also trigger bugs in the API. This includes actions like modifying and deleting data. Only run DAST API scanning against a test server. 165 166### HTTP Archive (HAR) 167 168The [HTTP Archive format (HAR)](http://www.softwareishard.com/blog/har-12-spec/) 169is an archive file format for logging HTTP transactions. When used with the GitLab DAST API scanner, HAR must contain records of calling the web API to test. The DAST API scanner extracts all the requests and 170uses them to perform testing. 171 172You can use various tools to generate HAR files: 173 174- [Insomnia Core](https://insomnia.rest/): API client 175- [Chrome](https://www.google.com/chrome/): Browser 176- [Firefox](https://www.mozilla.org/en-US/firefox/): Browser 177- [Fiddler](https://www.telerik.com/fiddler): Web debugging proxy 178- [GitLab HAR Recorder](https://gitlab.com/gitlab-org/security-products/har-recorder): Command line 179 180WARNING: 181HAR files may contain sensitive information such as authentication tokens, API keys, and session 182cookies. We recommend that you review the HAR file contents before adding them to a repository. 183 184Follow these steps to configure DAST API to use a HAR file that provides information about the 185target API to test: 186 1871. To use DAST API, you must [include](../../../ci/yaml/index.md#includetemplate) 188 the [`DAST-API.gitlab-ci.yml` template](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Security/DAST-API.gitlab-ci.yml) 189 that's provided as part of your GitLab installation. To do so, add the following to your 190 `.gitlab-ci.yml` file: 191 192 ```yaml 193 stages: 194 - dast 195 196 include: 197 - template: DAST-API.gitlab-ci.yml 198 ``` 199 2001. The [configuration file](#configuration-files) has several testing profiles defined with different checks enabled. We recommend that you start with the `Quick` profile. 201 Testing with this profile completes faster, allowing for easier configuration validation. 202 203 Provide the profile by adding the `DAST_API_PROFILE` CI/CD variable to your `.gitlab-ci.yml` file, 204 substituting `Quick` for the profile you choose: 205 206 ```yaml 207 stages: 208 - dast 209 210 include: 211 - template: DAST-API.gitlab-ci.yml 212 213 variables: 214 DAST_API_PROFILE: Quick 215 ``` 216 2171. Provide the location of the HAR specification. You can provide the specification as a file 218 or URL. [URL support was introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/285020) in GitLab 13.10 and later. Specify the location by adding the `DAST_API_HAR` variable: 219 220 ```yaml 221 stages: 222 - dast 223 224 include: 225 - template: DAST-API.gitlab-ci.yml 226 227 variables: 228 DAST_API_PROFILE: Quick 229 DAST_API_HAR: test-api-recording.har 230 ``` 231 2321. The target API instance's base URL is also required. Provide it by using the `DAST_API_TARGET_URL` 233 variable or an `environment_url.txt` file. 234 235 Adding the URL in an `environment_url.txt` file at your project's root is great for testing in 236 dynamic environments. To run DAST API against an app dynamically created during a GitLab CI/CD 237 pipeline, have the app persist its URL in an `environment_url.txt` file. DAST API 238 automatically parses that file to find its scan target. You can see an 239 [example of this in our Auto DevOps CI YAML](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml). 240 241 Here's an example of using `DAST_API_TARGET_URL`: 242 243 ```yaml 244 stages: 245 - dast 246 247 include: 248 - template: DAST-API.gitlab-ci.yml 249 250 variables: 251 DAST_API_PROFILE: Quick 252 DAST_API_HAR: test-api-recording.har 253 DAST_API_TARGET_URL: http://test-deployment/ 254 ``` 255 256This is a minimal configuration for DAST API. From here you can: 257 258- [Run your first scan](#running-your-first-scan). 259- [Add authentication](#authentication). 260- Learn how to [handle false positives](#handling-false-positives). 261 262WARNING: 263**NEVER** run DAST API testing against a production server. Not only can it perform *any* function that 264the API can, it may also trigger bugs in the API. This includes actions like modifying and deleting 265data. Only run DAST API against a test server. 266 267### Postman Collection 268 269The [Postman API Client](https://www.postman.com/product/api-client/) is a popular tool that 270developers and testers use to call various types of APIs. The API definitions 271[can be exported as a Postman Collection file](https://learning.postman.com/docs/getting-started/importing-and-exporting-data/#exporting-postman-data) 272for use with DAST API. When exporting, make sure to select a supported version of Postman 273Collection: v2.0 or v2.1. 274 275When used with the GitLab DAST API scanner, Postman Collections must contain definitions of the web API to 276test with valid data. The DAST API scanner extracts all the API definitions and uses them to perform 277testing. 278 279WARNING: 280Postman Collection files may contain sensitive information such as authentication tokens, API keys, 281and session cookies. We recommend that you review the Postman Collection file contents before adding 282them to a repository. 283 284Follow these steps to configure DAST API to use a Postman Collection file that provides 285information about the target API to test: 286 2871. To use DAST API, you must [include](../../../ci/yaml/index.md#includetemplate) 288 the [`DAST-API.gitlab-ci.yml` template](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Security/DAST-API.gitlab-ci.yml) 289 that's provided as part of your GitLab installation. To do so, add the following to your 290 `.gitlab-ci.yml` file: 291 292 ```yaml 293 stages: 294 - dast 295 296 include: 297 - template: DAST-API.gitlab-ci.yml 298 ``` 299 3001. The [configuration file](#configuration-files) has several testing profiles defined with different checks enabled. We recommend that you start with the `Quick` profile. 301 Testing with this profile completes faster, allowing for easier configuration validation. 302 303 Provide the profile by adding the `DAST_API_PROFILE` CI/CD variable to your `.gitlab-ci.yml` file, 304 substituting `Quick` for the profile you choose: 305 306 ```yaml 307 stages: 308 - dast 309 310 include: 311 - template: DAST-API.gitlab-ci.yml 312 313 variables: 314 DAST_API_PROFILE: Quick 315 ``` 316 3171. Provide the location of the Postman Collection specification. You can provide the specification as a file or URL. Specify the location by adding the `DAST_API_POSTMAN_COLLECTION` variable: 318 319 ```yaml 320 stages: 321 - dast 322 323 include: 324 - template: DAST-API.gitlab-ci.yml 325 326 variables: 327 DAST_API_PROFILE: Quick 328 DAST_API_POSTMAN_COLLECTION: postman-collection_serviceA.json 329 ``` 330 3311. The target API instance's base URL is also required. Provide it by using the `DAST_API_TARGET_URL` 332 variable or an `environment_url.txt` file. 333 334 Adding the URL in an `environment_url.txt` file at your project's root is great for testing in 335 dynamic environments. To run DAST API against an app dynamically created during a GitLab CI/CD 336 pipeline, have the app persist its URL in an `environment_url.txt` file. DAST API 337 automatically parses that file to find its scan target. You can see an 338 [example of this in our Auto DevOps CI YAML](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml). 339 340 Here's an example of using `DAST_API_TARGET_URL`: 341 342 ```yaml 343 stages: 344 - dast 345 346 include: 347 - template: DAST-API.gitlab-ci.yml 348 349 variables: 350 DAST_API_PROFILE: Quick 351 DAST_API_POSTMAN_COLLECTION: postman-collection_serviceA.json 352 DAST_API_TARGET_URL: http://test-deployment/ 353 ``` 354 355This is a minimal configuration for DAST API. From here you can: 356 357- [Run your first scan](#running-your-first-scan). 358- [Add authentication](#authentication). 359- Learn how to [handle false positives](#handling-false-positives). 360 361WARNING: 362**NEVER** run DAST API testing against a production server. Not only can it perform *any* function that 363the API can, it may also trigger bugs in the API. This includes actions like modifying and deleting 364data. Only run DAST API against a test server. 365 366#### Postman variables 367 368Postman allows the developer to define placeholders that can be used in different parts of the 369requests. These placeholders are called variables, as explained in [Using variables](https://learning.postman.com/docs/sending-requests/variables/). 370You can use variables to store and reuse values in your requests and scripts. For example, you can 371edit the collection to add variables to the document: 372 373![Edit collection variable tab View](img/dast_api_postman_collection_edit_variable.png) 374 375You can then use the variables in sections such as URL, headers, and others: 376 377![Edit request using variables View](img/dast_api_postman_request_edit.png) 378 379Variables can be defined at different [scopes](https://learning.postman.com/docs/sending-requests/variables/#variable-scopes) 380(for example, Global, Collection, Environment, Local, and Data). In this example, they're defined at 381the Environment scope: 382 383![Edit environment variables View](img/dast_api_postman_environment_edit_variable.png) 384 385When you export a Postman collection, only Postman collection variables are exported into the 386Postman file. For example, Postman does not export environment-scoped variables into the Postman 387file. 388 389By default, the DAST API scanner uses the Postman file to resolve Postman variable values. If a JSON file 390is set in a GitLab CI environment variable `DAST_API_POSTMAN_COLLECTION_VARIABLES`, then the JSON 391file takes precedence to get Postman variable values. 392 393Although Postman can export environment variables into a JSON file, the format is not compatible 394with the JSON expected by `DAST_API_POSTMAN_COLLECTION_VARIABLES`. 395 396Here is an example of using `DAST_API_POSTMAN_COLLECTION_VARIABLES`: 397 398```yaml 399stages: 400 - dast 401 402include: 403 - template: DAST-API.gitlab-ci.yml 404 405variables: 406 DAST_API_PROFILE: Quick 407 DAST_API_POSTMAN_COLLECTION: postman-collection_serviceA.json 408 DAST_API_POSTMAN_COLLECTION_VARIABLES: variable-collection-dictionary.json 409 DAST_API_TARGET_URL: http://test-deployment/ 410``` 411 412The file `variable-collection-dictionary.json` is a JSON document. This JSON is an object with 413key-value pairs for properties. The keys are the variables' names, and the values are the variables' 414values. For example: 415 416 ```json 417 { 418 "base_url": "http://127.0.0.1/", 419 "token": "Token 84816165151" 420 } 421 ``` 422 423### Authentication 424 425Authentication is handled by providing the authentication token as a header or cookie. You can 426provide a script that performs an authentication flow or calculates the token. 427 428#### HTTP Basic Authentication 429 430[HTTP basic authentication](https://en.wikipedia.org/wiki/Basic_access_authentication) 431is an authentication method built in to the HTTP protocol and used in conjunction with 432[transport layer security (TLS)](https://en.wikipedia.org/wiki/Transport_Layer_Security). 433To use HTTP basic authentication, two CI/CD variables are added to your `.gitlab-ci.yml` file: 434 435- `DAST_API_HTTP_USERNAME`: The username for authentication. 436- `DAST_API_HTTP_PASSWORD`: The password for authentication. 437 438For the password, we recommended that you [create a CI/CD variable](../../../ci/variables/index.md#custom-cicd-variables) 439(for example, `TEST_API_PASSWORD`) set to the password. You can create CI/CD variables from the 440GitLab projects page at **Settings > CI/CD**, in the **Variables** section. Use that variable 441as the value for `DAST_API_HTTP_PASSWORD`: 442 443```yaml 444stages: 445 - dast 446 447include: 448 - template: DAST-API.gitlab-ci.yml 449 450variables: 451 DAST_API_PROFILE: Quick 452 DAST_API_HAR: test-api-recording.har 453 DAST_API_TARGET_URL: http://test-deployment/ 454 DAST_API_HTTP_USERNAME: testuser 455 DAST_API_HTTP_PASSWORD: $TEST_API_PASSWORD 456``` 457 458#### Bearer Tokens 459 460Bearer tokens are used by several different authentication mechanisms, including OAuth2 and JSON Web 461Tokens (JWT). Bearer tokens are transmitted using the `Authorization` HTTP header. To use bearer 462tokens with DAST API, you need one of the following: 463 464- A token that doesn't expire 465- A way to generate a token that lasts the length of testing 466- A Python script that DAST API can call to generate the token 467 468##### Token doesn't expire 469 470If the bearer token doesn't expire, use the `DAST_API_OVERRIDES_ENV` variable to provide it. This 471variable's content is a JSON snippet that provides headers and cookies to add to DAST API's 472outgoing HTTP requests. 473 474Follow these steps to provide the bearer token with `DAST_API_OVERRIDES_ENV`: 475 4761. [Create a CI/CD variable](../../../ci/variables/index.md#custom-cicd-variables), 477 for example `TEST_API_BEARERAUTH`, with the value 478 `{"headers":{"Authorization":"Bearer dXNlcm5hbWU6cGFzc3dvcmQ="}}` (substitute your token). You 479 can create CI/CD variables from the GitLab projects page at **Settings > CI/CD**, in the 480 **Variables** section. 481 4821. In your `.gitlab-ci.yml` file, set `DAST_API_OVERRIDES_ENV` to the variable you just created: 483 484 ```yaml 485 stages: 486 - dast 487 488 include: 489 - template: DAST-API.gitlab-ci.yml 490 491 variables: 492 DAST_API_PROFILE: Quick 493 DAST_API_OPENAPI: test-api-specification.json 494 DAST_API_TARGET_URL: http://test-deployment/ 495 DAST_API_OVERRIDES_ENV: $TEST_API_BEARERAUTH 496 ``` 497 4981. To validate that authentication is working, run an DAST API test and review the job logs 499 and the test API's application logs. 500 501##### Token generated at test runtime 502 503If the bearer token must be generated and doesn't expire during testing, you can provide to DAST API a file containing the token. A prior stage and job, or part of the DAST API job, can 504generate this file. 505 506DAST API expects to receive a JSON file with the following structure: 507 508```json 509{ 510 "headers" : { 511 "Authorization" : "Bearer dXNlcm5hbWU6cGFzc3dvcmQ=" 512 } 513} 514``` 515 516This file can be generated by a prior stage and provided to DAST API through the 517`DAST_API_OVERRIDES_FILE` CI/CD variable. 518 519Set `DAST_API_OVERRIDES_FILE` in your `.gitlab-ci.yml` file: 520 521```yaml 522stages: 523 - dast 524 525include: 526 - template: DAST-API.gitlab-ci.yml 527 528variables: 529 DAST_API_PROFILE: Quick 530 DAST_API_OPENAPI: test-api-specification.json 531 DAST_API_TARGET_URL: http://test-deployment/ 532 DAST_API_OVERRIDES_FILE: output/dast-api-overrides.json 533``` 534 535To validate that authentication is working, run an DAST API test and review the job logs and 536the test API's application logs. 537 538##### Token has short expiration 539 540If the bearer token must be generated and expires prior to the scan's completion, you can provide a 541program or script for the DAST API scanner to execute on a provided interval. The provided script runs in 542an Alpine Linux container that has Python 3 and Bash installed. If the Python script requires 543additional packages, it must detect this and install the packages at runtime. 544 545The script must create a JSON file containing the bearer token in a specific format: 546 547```json 548{ 549 "headers" : { 550 "Authorization" : "Bearer dXNlcm5hbWU6cGFzc3dvcmQ=" 551 } 552} 553``` 554 555You must provide three CI/CD variables, each set for correct operation: 556 557- `DAST_API_OVERRIDES_FILE`: JSON file the provided command generates. 558- `DAST_API_OVERRIDES_CMD`: Command that generates the JSON file. 559- `DAST_API_OVERRIDES_INTERVAL`: Interval (in seconds) to run command. 560 561For example: 562 563```yaml 564stages: 565 - dast 566 567include: 568 - template: DAST-API.gitlab-ci.yml 569 570variables: 571 DAST_API_PROFILE: Quick 572 DAST_API_OPENAPI: test-api-specification.json 573 DAST_API_TARGET_URL: http://test-deployment/ 574 DAST_API_OVERRIDES_FILE: output/dast-api-overrides.json 575 DAST_API_OVERRIDES_CMD: renew_token.py 576 DAST_API_OVERRIDES_INTERVAL: 300 577``` 578 579To validate that authentication is working, run an DAST API test and review the job logs and 580the test API's application logs. 581 582### Configuration files 583 584To get you started quickly, GitLab provides the configuration file 585[`gitlab-dast-api-config.yml`](https://gitlab.com/gitlab-org/security-products/analyzers/dast/-/blob/master/config/gitlab-dast-api-config.yml). 586This file has several testing profiles that perform various numbers of tests. The run time of each 587profile increases as the test numbers go up. To use a configuration file, add it to your 588repository's root as `.gitlab/gitlab-dast-api-config.yml`. 589 590#### Profiles 591 592The following profiles are pre-defined in the default configuration file. Profiles 593can be added, removed, and modified by creating a custom configuration. 594 595##### Quick 596 597- Application Information Check 598- Cleartext Authentication Check 599- FrameworkDebugModeCheck 600- HTML Injection Check 601- Insecure Http Methods Check 602- JSON Hijacking Check 603- JSON Injection Check 604- Sensitive Information Check 605- Session Cookie Check 606- SQL Injection Check 607- Token Check 608- XML Injection Check 609 610##### Full 611 612- Application Information Check 613- Cleartext AuthenticationCheck 614- CORS Check 615- DNS Rebinding Check 616- Framework Debug Mode Check 617- HTML Injection Check 618- Insecure Http Methods Check 619- JSON Hijacking Check 620- JSON Injection Check 621- Open Redirect Check 622- Sensitive File Check 623- Sensitive Information Check 624- Session Cookie Check 625- SQL Injection Check 626- TLS Configuration Check 627- Token Check 628- XML Injection Check 629 630### Available CI/CD variables 631 632| CI/CD variable | Description | 633|------------------------------------------------------|--------------------| 634| `DAST_API_VERSION` | Specify DAST API container version. Defaults to `latest`. | 635| `DAST_API_TARGET_URL` | Base URL of API testing target. | 636|[`DAST_API_CONFIG`](#configuration-files) | DAST API configuration file. Defaults to `.gitlab-dast-api.yml`. | 637|[`DAST_API_PROFILE`](#configuration-files) | Configuration profile to use during testing. Defaults to `Quick`. | 638|[`DAST_API_EXCLUDE_PATHS`](#exclude-paths) | Exclude API URL paths from testing. | 639|[`DAST_API_OPENAPI`](#openapi-specification) | OpenAPI specification file or URL. | 640|[`DAST_API_HAR`](#http-archive-har) | HTTP Archive (HAR) file. | 641|[`DAST_API_POSTMAN_COLLECTION`](#postman-collection) | Postman Collection file. | 642|[`DAST_API_POSTMAN_COLLECTION_VARIABLES`](#postman-variables) | Path to a JSON file to extract postman variable values. | 643|[`DAST_API_OVERRIDES_FILE`](#overrides) | Path to a JSON file containing overrides. | 644|[`DAST_API_OVERRIDES_ENV`](#overrides) | JSON string containing headers to override. | 645|[`DAST_API_OVERRIDES_CMD`](#overrides) | Overrides command. | 646|[`DAST_API_OVERRIDES_INTERVAL`](#overrides) | How often to run overrides command in seconds. Defaults to `0` (once). | 647|[`DAST_API_HTTP_USERNAME`](#http-basic-authentication) | Username for HTTP authentication. | 648|[`DAST_API_HTTP_PASSWORD`](#http-basic-authentication) | Password for HTTP authentication. | 649|`DAST_API_SERVICE_START_TIMEOUT` | How long to wait for target API to become available in seconds. Default is 300 seconds. | 650|`DAST_API_TIMEOUT` | How long to wait for API responses in seconds. Default is 30 seconds. | 651 652### Overrides 653 654DAST API provides a method to add or override specific items in your request, for example: 655 656- Headers 657- Cookies 658- Query string 659- Form data 660- JSON nodes 661- XML nodes 662 663You can use this to inject semantic version headers, authentication, and so on. The 664[authentication section](#authentication) includes examples of using overrides for that purpose. 665 666Overrides use a JSON document, where each type of override is represented by a JSON object: 667 668```json 669{ 670 "headers": { 671 "header1": "value", 672 "header2": "value" 673 }, 674 "cookies": { 675 "cookie1": "value", 676 "cookie2": "value" 677 }, 678 "query": { 679 "query-string1": "value", 680 "query-string2": "value" 681 }, 682 "body-form": { 683 "form-param1": "value", 684 "form-param2": "value" 685 }, 686 "body-json": { 687 "json-path1": "value", 688 "json-path2": "value" 689 }, 690 "body-xml" : { 691 "xpath1": "value", 692 "xpath2": "value" 693 } 694} 695``` 696 697Example of setting a single header: 698 699```json 700{ 701 "headers": { 702 "Authorization": "Bearer dXNlcm5hbWU6cGFzc3dvcmQ=" 703 } 704} 705``` 706 707Example of setting both a header and cookie: 708 709```json 710{ 711 "headers": { 712 "Authorization": "Bearer dXNlcm5hbWU6cGFzc3dvcmQ=" 713 }, 714 "cookies": { 715 "flags": "677" 716 } 717} 718``` 719 720Example usage for setting a `body-form` override: 721 722```json 723{ 724 "body-form": { 725 "username": "john.doe" 726 } 727} 728``` 729 730The override engine uses `body-form` when the request body has only form-data content. 731 732Example usage for setting a `body-json` override: 733 734```json 735{ 736 "body-json": { 737 "$.credentials.access-token": "iddqd!42.$" 738 } 739} 740``` 741 742Note that each JSON property name in the object `body-json` is set to a [JSON Path](https://goessner.net/articles/JsonPath/) 743expression. The JSON Path expression `$.credentials.access-token` identifies the node to be 744overridden with the value `iddqd!42.$`. The override engine uses `body-json` when the request body 745has only [JSON](https://www.json.org/json-en.html) content. 746 747For example, if the body is set to the following JSON: 748 749```json 750{ 751 "credentials" : { 752 "username" :"john.doe", 753 "access-token" : "non-valid-password" 754 } 755} 756``` 757 758It is changed to: 759 760```json 761{ 762 "credentials" : { 763 "username" :"john.doe", 764 "access-token" : "iddqd!42.$" 765 } 766} 767``` 768 769Here's an example for setting a `body-xml` override. The first entry overrides an XML attribute and 770the second entry overrides an XML element: 771 772```json 773{ 774 "body-xml" : { 775 "/credentials/@isEnabled": "true", 776 "/credentials/access-token/text()" : "iddqd!42.$" 777 } 778} 779``` 780 781Note that each JSON property name in the object `body-xml` is set to an 782[XPath v2](https://www.w3.org/TR/xpath20/) 783expression. The XPath expression `/credentials/@isEnabled` identifies the attribute node to override 784with the value `true`. The XPath expression `/credentials/access-token/text()` identifies the 785element node to override with the value `iddqd!42.$`. The override engine uses `body-xml` when the 786request body has only [XML](https://www.w3.org/XML/) 787content. 788 789For example, if the body is set to the following XML: 790 791```xml 792<credentials isEnabled="false"> 793 <username>john.doe</username> 794 <access-token>non-valid-password</access-token> 795</credentials> 796``` 797 798It is changed to: 799 800```xml 801<credentials isEnabled="true"> 802 <username>john.doe</username> 803 <access-token>iddqd!42.$</access-token> 804</credentials> 805``` 806 807You can provide this JSON document as a file or environment variable. You may also provide a command 808to generate the JSON document. The command can run at intervals to support values that expire. 809 810#### Using a file 811 812To provide the overrides JSON as a file, the `DAST_API_OVERRIDES_FILE` CI/CD variable is set. The path is relative to the job current working directory. 813 814Here's an example `.gitlab-ci.yml`: 815 816```yaml 817stages: 818 - dast 819 820include: 821 - template: DAST-API.gitlab-ci.yml 822 823variables: 824 DAST_API_PROFILE: Quick 825 DAST_API_OPENAPI: test-api-specification.json 826 DAST_API_TARGET_URL: http://test-deployment/ 827 DAST_API_OVERRIDES_FILE: output/dast-api-overrides.json 828``` 829 830#### Using a CI/CD variable 831 832To provide the overrides JSON as a CI/CD variable, use the `DAST_API_OVERRIDES_ENV` variable. 833This allows you to place the JSON as variables that can be masked and protected. 834 835In this example `.gitlab-ci.yml`, the `DAST_API_OVERRIDES_ENV` variable is set directly to the JSON: 836 837```yaml 838stages: 839 - dast 840 841include: 842 - template: DAST-API.gitlab-ci.yml 843 844variables: 845 DAST_API_PROFILE: Quick 846 DAST_API_OPENAPI: test-api-specification.json 847 DAST_API_TARGET_URL: http://test-deployment/ 848 DAST_API_OVERRIDES_ENV: '{"headers":{"X-API-Version":"2"}}' 849``` 850 851In this example `.gitlab-ci.yml`, the `SECRET_OVERRIDES` variable provides the JSON. This is a 852[group or instance level CI/CD variable defined in the UI](../../../ci/variables/index.md#add-a-cicd-variable-to-an-instance): 853 854```yaml 855stages: 856 - dast 857 858include: 859 - template: DAST-API.gitlab-ci.yml 860 861variables: 862 DAST_API_PROFILE: Quick 863 DAST_API_OPENAPI: test-api-specification.json 864 DAST_API_TARGET_URL: http://test-deployment/ 865 DAST_API_OVERRIDES_ENV: $SECRET_OVERRIDES 866``` 867 868#### Using a command 869 870If the value must be generated or regenerated on expiration, you can provide a program or script for 871the DAST API scanner to execute on a specified interval. The provided script runs in an Alpine Linux 872container that has Python 3 and Bash installed. If the Python script requires additional packages, 873it must detect this and install the packages at runtime. The script creates the overrides JSON file 874as defined above. 875 876You must provide three CI/CD variables, each set for correct operation: 877 878- `DAST_API_OVERRIDES_FILE`: File generated by the provided command. 879- `DAST_API_OVERRIDES_CMD`: Command to generate JSON file. 880- `DAST_API_OVERRIDES_INTERVAL`: Interval in seconds to run command. 881 882```yaml 883stages: 884 - dast 885 886include: 887 - template: DAST-API.gitlab-ci.yml 888 889variables: 890 DAST_API_PROFILE: Quick 891 DAST_API_OPENAPI: test-api-specification.json 892 DAST_API_TARGET_URL: http://test-deployment/ 893 DAST_API_OVERRIDES_FILE: output/dast-api-overrides.json 894 DAST_API_OVERRIDES_CMD: renew_token.py 895 DAST_API_OVERRIDES_INTERVAL: 300 896``` 897 898### Exclude Paths 899 900> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/211892) in GitLab 14.0. 901 902When testing an API it can be useful to exclude certain paths. For example, you might exclude testing of an authentication service or an older version of the API. To exclude paths, use the `DAST_API_EXCLUDE_PATHS` CI/CD variable . This variable is specified in your `.gitlab-ci.yml` file. To exclude multiple paths, separate entries using the `;` character. In the provided paths you can use a single character wildcard `?` and `*` for a multiple character wildcard. 903 904To verify the paths are excluded, review the `Tested Operations` and `Excluded Operations` portion of the job output. You should not see any excluded paths listed under `Tested Operations`. 905 906```plaintext 9072021-05-27 21:51:08 [INF] API Security: --[ Tested Operations ]------------------------- 9082021-05-27 21:51:08 [INF] API Security: 201 POST http://target:7777/api/users CREATED 9092021-05-27 21:51:08 [INF] API Security: ------------------------------------------------ 9102021-05-27 21:51:08 [INF] API Security: --[ Excluded Operations ]----------------------- 9112021-05-27 21:51:08 [INF] API Security: GET http://target:7777/api/messages 9122021-05-27 21:51:08 [INF] API Security: POST http://target:7777/api/messages 9132021-05-27 21:51:08 [INF] API Security: ------------------------------------------------ 914``` 915 916#### Examples 917 918This example excludes the `/auth` resource. This does not exclude child resources (`/auth/child`). 919 920```yaml 921variables: 922 DAST_API_EXCLUDE_PATHS=/auth 923``` 924 925To exclude `/auth`, and child resources (`/auth/child`), we use a wildcard. 926 927```yaml 928variables: 929 DAST_API_EXCLUDE_PATHS=/auth* 930``` 931 932To exclude multiple paths we use the `;` character. In this example we exclude `/auth*` and `/v1/*`. 933 934```yaml 935variables: 936 DAST_API_EXCLUDE_PATHS=/auth*;/v1/* 937``` 938 939## Running your first scan 940 941When configured correctly, a CI/CD pipeline contains a `dast` stage and an `dast_api` job. The job only fails when an invalid configuration is provided. During normal operation, the job always succeeds even if vulnerabilities are identified during testing. 942 943Vulnerabilities are displayed on the **Security** pipeline tab with the suite name. When testing against the repositories default branch, the DAST API vulnerabilities are also shown on the Security & Compliance's Vulnerability Report page. 944 945To prevent an excessive number of reported vulnerabilities, the DAST API scanner limits the number of vulnerabilities it reports per operation. 946 947## Viewing DAST API vulnerabilities 948 949The DAST API analyzer produces a JSON report that is collected and used 950[to populate the vulnerabilities into GitLab vulnerability screens](#view-details-of-a-dast-api-vulnerability). 951 952See [handling false positives](#handling-false-positives) for information about configuration changes you can make to limit the number of false positives reported. 953 954### View details of a DAST API vulnerability 955 956Follow these steps to view details of a vulnerability: 957 9581. You can view vulnerabilities in a project, or a merge request: 959 960 - In a project, go to the project's **{shield}** **Security & Compliance > Vulnerability Report** 961 page. This page shows all vulnerabilities from the default branch only. 962 - In a merge request, go the merge request's **Security** section and click the **Expand** 963 button. DAST API vulnerabilities are available in a section labeled 964 **DAST detected N potential vulnerabilities**. Click the title to display the vulnerability 965 details. 966 9671. Click the vulnerabilities title to display the details. The table below describes these details. 968 969 | Field | Description | 970 |:--------------------|:----------------------------------------------------------------------------------------| 971 | Description | Description of the vulnerability including what was modified. | 972 | Project | Namespace and project in which the vulnerability was detected. | 973 | Method | HTTP method used to detect the vulnerability. | 974 | URL | URL at which the vulnerability was detected. | 975 | Request | The HTTP request that caused the vulnerability. | 976 | Unmodified Response | Response from an unmodified request. This is what a normal working response looks like. | 977 | Actual Response | Response received from test request. | 978 | Evidence | How we determined a vulnerability occurred. | 979 | Identifiers | The DAST API check used to find this vulnerability. | 980 | Severity | Severity of the vulnerability. | 981 | Scanner Type | Scanner used to perform testing. | 982 983### Security Dashboard 984 985The Security Dashboard is a good place to get an overview of all the security vulnerabilities in your groups, projects and 986pipelines. For more information, see the [Security Dashboard documentation](../security_dashboard/index.md). 987 988### Interacting with the vulnerabilities 989 990Once a vulnerability is found, you can interact with it. Read more on how to 991[address the vulnerabilities](../vulnerabilities/index.md). 992 993## Handling False Positives 994 995False positives can be handled in several ways: 996 997- Dismiss the vulnerability. 998- Some checks have several methods of detecting when a vulnerability is identified, called _Assertions_. 999 Assertions can also be turned off and configured. For example, the DAST API scanner by default uses HTTP 1000 status codes to help identify when something is a real issue. If an API returns a 500 error during 1001 testing, this creates a vulnerability. This isn't always desired, as some frameworks return 500 errors often. 1002- Turn off the Check producing the false positive. This prevents the check from generating any 1003 vulnerabilities. Example checks are the SQL Injection Check, and JSON Hijacking Check. 1004 1005### Turn off a Check 1006 1007Checks perform testing of a specific type and can be turned on and off for specific configuration 1008profiles. The provided [configuration files](#configuration-files) define several profiles that you 1009can use. The profile definition in the configuration file lists all the checks that are active 1010during a scan. To turn off a specific check, remove it from the profile definition in the 1011configuration file. The profiles are defined in the `Profiles` section of the configuration file. 1012 1013Example profile definition: 1014 1015```yaml 1016Profiles: 1017 - Name: Quick 1018 DefaultProfile: Empty 1019 Routes: 1020 - Route: *Route0 1021 Checks: 1022 - Name: ApplicationInformationCheck 1023 - Name: CleartextAuthenticationCheck 1024 - Name: FrameworkDebugModeCheck 1025 - Name: HtmlInjectionCheck 1026 - Name: InsecureHttpMethodsCheck 1027 - Name: JsonHijackingCheck 1028 - Name: JsonInjectionCheck 1029 - Name: SensitiveInformationCheck 1030 - Name: SessionCookieCheck 1031 - Name: SqlInjectionCheck 1032 - Name: TokenCheck 1033 - Name: XmlInjectionCheck 1034``` 1035 1036To turn off the JSON Hijacking Check you can remove these lines: 1037 1038```yaml 1039 - Name: JsonHijackingCheck 1040``` 1041 1042This results in the following YAML: 1043 1044```yaml 1045- Name: Quick 1046 DefaultProfile: Empty 1047 Routes: 1048 - Route: *Route0 1049 Checks: 1050 - Name: ApplicationInformationCheck 1051 - Name: CleartextAuthenticationCheck 1052 - Name: FrameworkDebugModeCheck 1053 - Name: HtmlInjectionCheck 1054 - Name: InsecureHttpMethodsCheck 1055 - Name: JsonInjectionCheck 1056 - Name: SensitiveInformationCheck 1057 - Name: SessionCookieCheck 1058 - Name: SqlInjectionCheck 1059 - Name: TokenCheck 1060 - Name: XmlInjectionCheck 1061``` 1062 1063### Turn off an Assertion for a Check 1064 1065Assertions detect vulnerabilities in tests produced by checks. Many checks support multiple Assertions such as Log Analysis, Response Analysis, and Status Code. When a vulnerability is found, the Assertion used is provided. To identify which Assertions are on by default, see the Checks default configuration in the configuration file. The section is called `Checks`. 1066 1067This example shows the SQL Injection Check: 1068 1069```yaml 1070- Name: SqlInjectionCheck 1071 Configuration: 1072 UserInjections: [] 1073 Assertions: 1074 - Name: LogAnalysisAssertion 1075 - Name: ResponseAnalysisAssertion 1076 - Name: StatusCodeAssertion 1077``` 1078 1079Here you can see three Assertions are on by default. A common source of false positives is 1080`StatusCodeAssertion`. To turn it off, modify its configuration in the `Profiles` section. This 1081example provides only the other two Assertions (`LogAnalysisAssertion`, 1082`ResponseAnalysisAssertion`). This prevents `SqlInjectionCheck` from using `StatusCodeAssertion`: 1083 1084```yaml 1085Profiles: 1086 - Name: Quick 1087 DefaultProfile: Empty 1088 Routes: 1089 - Route: *Route0 1090 Checks: 1091 - Name: ApplicationInformationCheck 1092 - Name: CleartextAuthenticationCheck 1093 - Name: FrameworkDebugModeCheck 1094 - Name: HtmlInjectionCheck 1095 - Name: InsecureHttpMethodsCheck 1096 - Name: JsonHijackingCheck 1097 - Name: JsonInjectionCheck 1098 - Name: SensitiveInformationCheck 1099 - Name: SessionCookieCheck 1100 - Name: SqlInjectionCheck 1101 Assertions: 1102 - Name: LogAnalysisAssertion 1103 - Name: ResponseAnalysisAssertion 1104 - Name: TokenCheck 1105 - Name: XmlInjectionCheck 1106``` 1107 1108## Running DAST API in an offline environment 1109 1110For self-managed GitLab instances in an environment with limited, restricted, or intermittent access to external resources through the internet, some adjustments are required for the DAST API testing job to successfully run. 1111 1112Steps: 1113 11141. Host the Docker image in a local container registry. 11151. Set the `SECURE_ANALYZERS_PREFIX` to the local container registry. 1116 1117The Docker image for DAST API must be pulled (downloaded) from the public registry and then pushed (imported) into a local registry. The GitLab container registry can be used to locally host the Docker image. This process can be performed using a special template. See [loading Docker images onto your offline host](../offline_deployments/index.md#loading-docker-images-onto-your-offline-host) for instructions. 1118 1119Once the Docker image is hosted locally, the `SECURE_ANALYZERS_PREFIX` variable is set with the location of the local registry. The variable must be set such that concatenating `/api-fuzzing:1` results in a valid image location. 1120 1121NOTE: 1122DAST API and API Fuzzing both use the same underlying Docker image `api-fuzzing:1`. 1123 1124For example, the below line sets a registry for the image `registry.gitlab.com/gitlab-org/security-products/analyzers/api-fuzzing:1`: 1125 1126`SECURE_ANALYZERS_PREFIX: "registry.gitlab.com/gitlab-org/security-products/analyzers"` 1127 1128NOTE: 1129Setting `SECURE_ANALYZERS_PREFIX` changes the Docker image registry location for all GitLab Secure templates. 1130 1131For more information, see [Offline environments](../offline_deployments/index.md). 1132 1133## Troubleshooting 1134 1135### Error waiting for API Security 'http://127.0.0.1:5000' to become available 1136 1137A bug exists in versions of the DAST API analyzer prior to v1.6.196 that can cause a background process to fail under certain conditions. The solution is to update to a newer version of the DAST API analyzer. 1138 1139The version information can be found in the job details for the `dast_api` job. 1140 1141If the issue is occurring with versions v1.6.196 or greater, please contact Support and provide the following information: 1142 11431. Reference this troubleshooting section and ask for the issue to be escalated to the Dynamic Analysis Team. 11441. The full console output of the job. 11451. The `gl-api-security-scanner.log` file available as a job artifact. In the right-hand panel of the job details page, select the **Browse** button. 11461. The `dast_api` job definition from your `.gitlab-ci.yml` file. 1147 1148### Failed to start scanner session (version header not found) 1149 1150The DAST API engine outputs an error message when it cannot establish a connection with the scanner application component. The error message is shown in the job output window of the `dast_api` job. A common cause of this issue is changing the `DAST_API_API` variable from its default. 1151 1152**Error message** 1153 1154- In [GitLab 13.11 and later](https://gitlab.com/gitlab-org/gitlab/-/issues/323939), `Failed to start scanner session (version header not found).` 1155- In GitLab 13.10 and earlier, `API Security version header not found. Are you sure that you are connecting to the API Security server?`. 1156 1157**Solution** 1158 1159- Remove the `DAST_API_API` variable from the `.gitlab-ci.yml` file. The value will be inherited from the DAST API CI/CD template. We recommend this method instead of manually setting a value. 1160- If removing the variable is not possible, check to see if this value has changed in the latest version of the [DAST API CI/CD template](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Security/DAST-API.gitlab-ci.yml). If so, update the value in the `.gitlab-ci.yml` file. 1161 1162### Application cannot determine the base URL for the target API 1163 1164The DAST API engine outputs an error message when it cannot determine the target API after inspecting the OpenAPI document. This error message is shown when the target API has not been set in the `.gitlab-ci.yml` file, it is not available in the `environment_url.txt` file, and it could not be computed using the OpenAPI document. 1165 1166There is a order of precedence in which the DAST API engine tries to get the target API when checking the different sources. First, it will try to use the `DAST_API_TARGET_URL`. If the environment variable has not been set, then the DAST API engine will attempt to use the `environment_url.txt` file. If there is no file `environment_url.txt`, then the DAST API engine will use the OpenAPI document contents and the URL provided in `DAST_API_OPENAPI` (if a URL is provided) to try to compute the target API. 1167 1168The best-suited solution will depend on whether or not your target API changes for each deployment. In static environments, the target API is the same for each deployment, in this case please refer to the [static environment solution](#static-environment-solution). If the target API changes for each deployment a [dynamic environment solution](#dynamic-environment-solutions) should be applied. 1169 1170#### Static environment solution 1171 1172This solution is for pipelines in which the target API URL doesn't change (is static). 1173 1174**Add environmental variable** 1175 1176For environments where the target API remains the same, we recommend you specify the target URL by using the `DAST_API_TARGET_URL` environment variable. In your `.gitlab-ci.yml`, add a variable `DAST_API_TARGET_URL`. The variable must be set to the base URL of API testing target. For example: 1177 1178```yaml 1179include: 1180 - template: DAST-API.gitlab-ci.yml 1181 1182 variables: 1183 DAST_API_TARGET_URL: http://test-deployment/ 1184 DAST_API_OPENAPI: test-api-specification.json 1185``` 1186 1187#### Dynamic environment solutions 1188 1189In a dynamic environment your target API changes for each different deployment. In this case, there is more than one possible solution, we recommend you use the `environment_url.txt` file when dealing with dynamic environments. 1190 1191**Use environment_url.txt** 1192 1193To support dynamic environments in which the target API URL changes during each pipeline, DAST API engine supports the use of an `environment_url.txt` file that contains the URL to use. This file is not checked into the repository, instead it's created during the pipeline by the job that deploys the test target and collected as an artifact that can be used by later jobs in the pipeline. The job that creates the `environment_url.txt` file must run before the DAST API engine job. 1194 11951. Modify the test target deployment job adding the base URL in an `environment_url.txt` file at the root of your project. 11961. Modify the test target deployment job collecting the `environment_url.txt` as an artifact. 1197 1198Example: 1199 1200```yaml 1201deploy-test-target: 1202 script: 1203 # Perform deployment steps 1204 # Create environment_url.txt (example) 1205 - echo http://${CI_PROJECT_ID}-${CI_ENVIRONMENT_SLUG}.example.org > environment_url.txt 1206 1207 artifacts: 1208 paths: 1209 - environment_url.txt 1210``` 1211 1212## Get support or request an improvement 1213 1214To get support for your particular problem please use the [getting help channels](https://about.gitlab.com/get-help/). 1215 1216The [GitLab issue tracker on GitLab.com](https://gitlab.com/gitlab-org/gitlab/-/issues) is the right place for bugs and feature proposals about API Security and DAST API. 1217Please use `~"Category:API Security"` [label](../../../development/contributing/issue_workflow.md#labels) when opening a new issue regarding DAST API to ensure it is quickly reviewed by the right people. Please refer to our [review response SLO](../../../development/code_review.md#review-response-slo) to understand when you should receive a response. 1218 1219[Search the issue tracker](https://gitlab.com/gitlab-org/gitlab/-/issues) for similar entries before submitting your own, there's a good chance somebody else had the same issue or feature proposal. Show your support with an award emoji and or join the discussion. 1220 1221When experiencing a behavior not working as expected, consider providing contextual information: 1222 1223- GitLab version if using a self-managed instance. 1224- `.gitlab-ci.yml` job definition. 1225- Full job console output. 1226- Scanner log file available as a job artifact named `gl-api-security-scanner.log`. 1227 1228WARNING: 1229**Sanitize data attached to a support issue**. Please remove sensitive information, including: credentials, passwords, tokens, keys, and secrets. 1230 1231## Glossary 1232 1233- Assert: Assertions are detection modules used by checks to trigger a vulnerability. Many assertions have 1234 configurations. A check can use multiple Assertions. For example, Log Analysis, Response Analysis, 1235 and Status Code are common Assertions used together by checks. Checks with multiple Assertions 1236 allow them to be turned on and off. 1237- Check: Performs a specific type of test, or performed a check for a type of vulnerability. For 1238 example, the SQL Injection Check performs DAST testing for SQL Injection vulnerabilities. The DAST API scanner is comprised of several checks. Checks can be turned on and off in a profile. 1239- Profile: A configuration file has one or more testing profiles, or sub-configurations. You may 1240 have a profile for feature branches and another with extra testing for a main branch. 1241