@@ -518,11 +523,11 @@ increases as the numbers go up. To use a configuration file, add it to your repo
### Overrides
API Fuzzing provides a method to add or override headers and cookies for all outbound HTTP requests
made. You can use this to inject semantic version headers, authentication, and so on. The
API Fuzzing provides a method to add or override headers and cookies for all outbound HTTP requests.
You can use this to inject semantic version headers, authentication, and so on. The
[authentication section](#authentication) includes examples of using overrides for that purpose.
Overrides uses a JSON document to define the headers and cookies:
Overrides use a JSON document to define the headers and cookies:
```json
{
...
...
@@ -537,7 +542,7 @@ Overrides uses a JSON document to define the headers and cookies:
}
```
Example usage for setting a single header:
Example of setting a single header:
```json
{
...
...
@@ -547,7 +552,7 @@ Example usage for setting a single header:
}
```
Example usage for setting both a header and cookie:
Example of setting both a header and cookie:
```json
{
...
...
@@ -565,9 +570,10 @@ to generate the JSON document. The command can run at intervals to support value
#### Using a file
To provide the overrides JSON as a file, the `FUZZAPI_OVERRIDES_FILE` environment variable is set. The path is relative to the job current working directory.
To provide the override JSON as a file, set the `FUZZAPI_OVERRIDES_FILE` environment variable to the
file. The file path is relative to the job's current working directory.
Example `.gitlab-ci.yml`:
Here's an example `.gitlab-ci.yml`:
```yaml
include:
...
...
@@ -582,10 +588,10 @@ variables:
#### Using an environment variable
To provide the overrides JSON as an environment variable, use the `FUZZAPI_OVERRIDES_ENV` variable.
This allows you to place the JSON as CI/CD variables that can be masked and protected.
To provide the override JSON as an environment variable, set the `FUZZAPI_OVERRIDES_ENV` variable to
the JSON. You can also place the JSON as CI/CD variables that can be masked and protected.
In this example `.gitlab-ci.yml`, the JSON is provided directly:
In this example `.gitlab-ci.yml`, the `FUZZAPI_OVERRIDES_ENV` variable is set directly to the JSON:
```yaml
include:
...
...
@@ -599,7 +605,7 @@ variables:
```
In this example `.gitlab-ci.yml`, the CI/CD variable `SECRET_OVERRIDES` provides the JSON. This is a
[group or instancelevel environment variable defined in the UI](../../../ci/variables/README.md#instance-level-cicd-variables):
[group or instance-level environment variable defined in the UI](../../../ci/variables/README.md#instance-level-cicd-variables):
```yaml
include:
...
...
@@ -615,29 +621,9 @@ variables:
#### Using a command
If the value must be generated or regenerated on expiration, you can provide a program or script for
the API fuzzer to execute on a specified interval. The provided script runs in an Alpine Linux
container that has Python 3 and Bash installed. If the Python script requires additional packages,
it must detect this and install the packages at runtime. The script creates the overrides JSON file
as defined above.
You must provide three variables, each set for correct operation:
-`FUZZAPI_OVERRIDES_FILE`: File generated by the provided command.
-`FUZZAPI_OVERRIDES_CMD`: Command to generate JSON file.
-`FUZZAPI_OVERRIDES_INTERVAL`: Interval in seconds to run command.