Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
39e45014
Commit
39e45014
authored
Jul 14, 2020
by
Zach Rice
Committed by
Ash McKenzie
Jul 14, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Split secret detection into default and non-default branches jobs
parent
9c3cb4d3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
6 deletions
+27
-6
changelogs/unreleased/36860-secret-detection-branch-job.yml
changelogs/unreleased/36860-secret-detection-branch-job.yml
+5
-0
lib/gitlab/ci/templates/Security/Secret-Detection.gitlab-ci.yml
...tlab/ci/templates/Security/Secret-Detection.gitlab-ci.yml
+22
-6
No files found.
changelogs/unreleased/36860-secret-detection-branch-job.yml
0 → 100644
View file @
39e45014
---
title
:
Add default and non-default branch jobs for secret detection
merge_request
:
36570
author
:
type
:
added
lib/gitlab/ci/templates/Security/Secret-Detection.gitlab-ci.yml
View file @
39e45014
...
@@ -8,17 +8,33 @@ variables:
...
@@ -8,17 +8,33 @@ variables:
SECURE_ANALYZERS_PREFIX
:
"
registry.gitlab.com/gitlab-org/security-products/analyzers"
SECURE_ANALYZERS_PREFIX
:
"
registry.gitlab.com/gitlab-org/security-products/analyzers"
SECRETS_ANALYZER_VERSION
:
"
3"
SECRETS_ANALYZER_VERSION
:
"
3"
secret_detection
:
.secret-analyzer
:
stage
:
test
stage
:
test
image
:
"
$SECURE_ANALYZERS_PREFIX/secrets:$SECRETS_ANALYZER_VERSION"
image
:
"
$SECURE_ANALYZERS_PREFIX/secrets:$SECRETS_ANALYZER_VERSION"
services
:
[]
services
:
[]
rules
:
-
if
:
$SECRET_DETECTION_DISABLED
when
:
never
-
if
:
$CI_COMMIT_BRANCH && $GITLAB_FEATURES =~ /\bsecret_detection\b/
when
:
on_success
artifacts
:
artifacts
:
reports
:
reports
:
secret_detection
:
gl-secret-detection-report.json
secret_detection
:
gl-secret-detection-report.json
secret_detection_default_branch
:
extends
:
.secret-analyzer
rules
:
-
if
:
$SECRET_DETECTION_DISABLED
when
:
never
-
if
:
$CI_DEFAULT_BRANCH == $CI_COMMIT_BRANCH &&
$GITLAB_FEATURES =~ /\bsecret_detection\b/
script
:
-
/analyzer run
secret_detection
:
extends
:
.secret-analyzer
rules
:
-
if
:
$SECRET_DETECTION_DISABLED
when
:
never
-
if
:
$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH &&
$GITLAB_FEATURES =~ /\bsecret_detection\b/
script
:
script
:
-
git fetch origin $CI_DEFAULT_BRANCH $CI_BUILD_REF_NAME
-
export SECRET_DETECTION_COMMIT_TO=$(git log --left-right --cherry-pick --pretty=format:"%H" refs/remotes/origin/$CI_DEFAULT_BRANCH...refs/remotes/origin/$CI_BUILD_REF_NAME | tail -n 1)
-
export SECRET_DETECTION_COMMIT_FROM=$CI_COMMIT_SHA
-
/analyzer run
-
/analyzer run
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment