Skip to content

Commit c420aef

Browse files
committed
Scan for secrets during every merge request
Issue: PGO-2490
1 parent ada1db0 commit c420aef

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

.gitlab-ci.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ workflow:
2929
($CI_PIPELINE_SOURCE == "schedule") ||
3030
($CI_PIPELINE_SOURCE == "web")
3131
32+
include:
33+
- component: ${CI_SERVER_FQDN}/containers/gitlab/check-directory-secrets@main
34+
inputs:
35+
job-name: must-not-commit-secrets
36+
job-stage: build
37+
trivy-ignore: .trivyignore.yaml
38+
3239
variables:
3340
# https://docs.gitlab.com/runner/configuration/feature-flags
3441
# Show the duration of individual script items in the job log.
@@ -195,12 +202,12 @@ trivy:
195202
bash 'contrib/install.sh' -b "${HOME}/bin" "${VERSION}"
196203
)
197204
198-
# Generate a report and fail when there are issues that can be fixed.
205+
# Generate a report and fail when there are issues with dependencies.
199206
# Trivy needs a populated Go module cache to detect Go module licenses.
200207
- go mod download
201208
- >-
202209
trivy filesystem . --exit-code 1
203-
--scanners license,secret,vuln
210+
--scanners license,vuln
204211
--ignore-unfixed
205212
--no-progress
206213
--format template

.trivyignore.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Copyright Crunchy Data Solutions, Inc. All rights reserved.
2+
#
3+
# https://trivy.dev/latest/docs/configuration/filtering/#trivyignoreyaml
4+
5+
secrets:
6+
- id: jwt-token
7+
paths:
8+
- internal/testing/token_*
9+
10+
- id: private-key
11+
paths:
12+
- internal/pki/*_test.go

0 commit comments

Comments
 (0)