doc/user/application_security/detect/_index.md
Detect vulnerabilities in your project's repository and application's behavior throughout the software development lifecycle.
To help you manage the risk of vulnerabilities during development:
To help manage vulnerabilities outside development:
To get the most from security scanning, it's important to understand:
Security scanning in a CI/CD pipeline is triggered by default when changes are pushed to a project's repository.
You can also run security scanning by:
Scan your project's repository and test your application's behavior for vulnerabilities:
Your project's repository may contain source code, dependency declarations, and infrastructure definitions. Repository scanning can detect vulnerabilities in each of these.
Repository scanning tools include:
Behavioral testing requires a deployable application to test for known vulnerabilities and unexpected behavior.
Behavioral testing tools include:
Security scanners are enabled for a project by either:
.gitlab-ci.yml file, either directly or by using
AutoDevOps.For more details, see Security configuration.
The security scanning process is:
According to the CI/CD job criteria, those scanners that are enabled and intended to run in a pipeline run as separate jobs.
Each successful job outputs one or more security reports as job artifacts. These reports contain details of all vulnerabilities detected in the branch, regardless of whether they were previously found, dismissed, or new.
Each security report is processed, including validation and deduplication.
When all jobs finish, including manual jobs, you can download or view the results.
For more details on the output of security scanning, see Security scanning results.
Security scanning jobs in a CI/CD pipeline are determined by the following criteria:
Inclusion of security scanning templates
The selection of security scanning jobs is first determined by which templates are included or enforced by a policy or compliance framework.
Security scanning runs by default in branch pipelines. To run security scanning in merge request pipelines you must specifically enable it.
Evaluation of rules
Each template has defined rules which determine if the analyzer is run.
For example, some analyzers run only if files of a specific type are detected in the repository.
Analyzer logic
If the template's rules dictate that the job is to be run, a job is created in the pipeline stage specified in the template. However, each analyzer has its own logic which determines if the analyzer itself is to be run.
For example, if dependency scanning doesn't detect supported files at the default depth, the analyzer is not run and no artifacts are output.
Jobs pass if they complete a scan, even if they don't find vulnerabilities. The only exception is
coverage fuzzing, which fails if it identifies findings. All jobs are permitted to fail so that
they don't fail the entire pipeline. Don't change the job
allow_failure setting because that fails the entire
pipeline.
GitLab processes the source code and performs analysis locally on the GitLab Runner. No data is transmitted outside GitLab infrastructure (server and runners).
Security analyzers access the internet only to download the latest sets of signatures, rules, and patches. If you prefer the scanners do not access the internet, consider using an offline environment.