Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PrivateStorageio
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tom Prince
PrivateStorageio
Commits
b9bbd7c3
Commit
b9bbd7c3
authored
4 years ago
by
Jean-Paul Calderone
Browse files
Options
Downloads
Patches
Plain Diff
Just cannot use exit_codes, it is too new a feature
parent
06bd50a6
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+5
-13
5 additions, 13 deletions
.gitlab-ci.yml
ci-tools/vulnerability-scan
+5
-4
5 additions, 4 deletions
ci-tools/vulnerability-scan
with
10 additions
and
17 deletions
.gitlab-ci.yml
+
5
−
13
View file @
b9bbd7c3
...
...
@@ -10,19 +10,11 @@ unit-tests:
vulnerability-scan
:
stage
:
"
test"
allow_failure
:
# https://docs.gitlab.com/ee/ci/yaml/README.html#allow_failureexit_codes
exit_codes
:
# Allow *some* exit codes through without treating them as
# pipeline-failing conditions.
# https://github.com/flyingcircusio/vulnix/blob/master/doc/vulnix.1.md
# All found errors are whitelisted
-
1
# Vulnerabilities found, but still, please don't halt the build.
-
2
# It would be nice to target this a bit more specifically. If we upgrade to
# a newer GitLab (13.11?) then we can select exit codes that are allowed.
# For now we're stuck with true/false though.
# https://whetstone.privatestorage.io/help/ci/yaml/README.md#allow_failure
allow_failure
:
true
script
:
-
"
ci-tools/vulnerability-scan
security-report.txt"
artifacts
:
...
...
This diff is collapsed.
Click to expand it.
ci-tools/vulnerability-scan
+
5
−
4
View file @
b9bbd7c3
...
...
@@ -26,14 +26,15 @@ if morph_result=$(morph build morph/grid/testing/grid.nix 2>&1); then
ln -s "$object" scan-target
else
echo "$morph_result"
# Signal to the GitLab CI configuration this is a non-recoverable failure.
# exit status 0-3 reserved for vulnix result.
exit 4
fi
'
# vulnix exits with an error status if there are vulnerabilities. We told
# GitLab to allow this by setting `allow_failure` to true in the GitLab CI
# config.
set
+e
# config. vulnix exit status indicates what vulnix thinks happened. If we
# upgrade to a newer GitLab then we can make GitLab pipeline behavior vary
# based on this.
nix-shell
-p
vulnix
--run
'vulnix ./scan-target/'
|
tee
"
$OUTPUT
"
exit
$?
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment