The Security Policies feature is a repository to store policies. All security policies are stored in
The Security Policies feature is a repository to store policies. All security policies are stored as
the `.gitlab/security-policies` directory as a YAML file with this format:
the `.gitlab/security-policies/policy.yml` YAML file with this format:
```yaml
```yaml
---
---
type: scan_execution_policy
scan_execution_policy:
name: Enforce DAST in every pipeline
-name: Enforce DAST in every pipeline
description: This policy enforces pipeline configuration to have a job with DAST scan
description: This policy enforces pipeline configuration to have a job with DAST scan
enabled: true
enabled: true
rules:
rules:
- type: pipeline
- type: pipeline
branch: master
branch: master
actions:
actions:
- scan: dast
- scan: dast
scanner_profile: Scanner Profile A
scanner_profile: Scanner Profile A
site_profile: Site Profile B
site_profile: Site Profile B
- name: Enforce DAST in every pipeline in main branch
description: This policy enforces pipeline configuration to have a job with DAST scan for main branch
enabled: true
rules:
- type: pipeline
branch: main
actions:
- scan: dast
scanner_profile: Scanner Profile C
site_profile: Site Profile D
```
```
### Scan Execution Policies Schema
The YAML file with Scan Execution Policies consists of an array of objects matching Scan Execution Policy Schema nested under the `scan_execution_policy` key. You can configure a maximum of 5 policies under the `scan_execution_policy` key.
| Field | Type | Possible values | Description |
|-------|------|-----------------|-------------|
| `scan_execution_policy` | `array` of Scan Execution Policy | | List of scan execution policies (maximum 5) |