Use Project Environments as DAST Site Targets
Proposal
DAST should be able to use an Environment as a target for a scan.
Environments describe where code is deployed. A deployment location of a site, as a target, is one of the inputs of a DAST Scan.
- Static Environments: DAST Site Profiles should be able to use the URL from an existing Environment
- Dynamic Environments: Typically used in the context of a "Review App", a temporary deployment to test the code for a given branch. In this case, a new DAST template can be provided to run a quicker passive scan on the new Environment.
Advantages
- Support for dynamic environments can help DAST become more shift-left, offering quicker vanilla scans earlier in the pipeline without much configuration.
- Environments already act as a source of truth for where code has been deployed, DAST should be able to use that existing configuration for better integration within GitLab.
Challenges
- Authentication credentials, if needed, would still need to be provided manually.
Proposed Changes
- DAST Site Profiles UI should support selecting the URL of an existing environment.
- DAST's CI configuration should accept an environment ID instead of a target URL.
- Offer a passive scan DAST template that runs against temporary deployed dynamic environments/review apps.