Skip to content

Update security policies pipeline processor to support secret detection

Sashi Kumar Kumaresan requested to merge sk/334415-add-secret-detection into master

What does this MR do?

Addresses #334415 (closed)

We want Secret Detection scans to be run whenever a project pipeline is run according to the policy mentioned in the security policy project. Secret Detection scans should run in normal mode for pipeline. Normal mode is typically enabled by setting SECRET_DETECTION_HISTORIC_SCAN to false as a CI variable. (See documentation)

How to setup and validate locally (strongly suggested)

Feature documentation: https://docs.gitlab.com/ee/user/application_security/policies/

  1. Clone and create a project from https://gitlab.com/sashi_kumar/security-orchestration-policies
  2. Enable security_orchestration_policies_configuration for the target project for which the scan policies should be enabled for by doing:
Feature.enable(:security_orchestration_policies_configuration, Project.find(<target_project.id>))
  1. Go to Security & Compliance -> Scan Policies for the target project Screenshot_2021-05-26_at_6.41.24_PM
  2. Select Edit policy project and select the policy project (security-orchestration-policies) that was created in step 1 and click save
  3. Create a new pipeline and notice that secret-detection-0 job is included under test stage. Screenshot_2021-08-03_at_11.42.52_AM

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Sashi Kumar Kumaresan

Merge request reports