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
84a557d4
Commit
84a557d4
authored
Nov 02, 2021
by
Saikat Sarkar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add remediation based on cve or id
Changelog: fixed EE: true
parent
143d131c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
ee/lib/ee/gitlab/ci/parsers/security/common.rb
ee/lib/ee/gitlab/ci/parsers/security/common.rb
+3
-1
ee/spec/lib/ee/gitlab/ci/parsers/security/common_spec.rb
ee/spec/lib/ee/gitlab/ci/parsers/security/common_spec.rb
+7
-0
No files found.
ee/lib/ee/gitlab/ci/parsers/security/common.rb
View file @
84a557d4
...
...
@@ -38,7 +38,9 @@ module EE
override
:create_findings
def
create_findings
collate_remediations
.
each
{
|
finding
|
create_finding
(
finding
,
create_remediations
(
report_data
[
'remediations'
]))
}
collate_remediations
.
each
do
|
finding
|
create_finding
(
finding
,
create_remediations
(
finding
[
"remediations"
]))
end
end
end
end
...
...
ee/spec/lib/ee/gitlab/ci/parsers/security/common_spec.rb
View file @
84a557d4
...
...
@@ -88,6 +88,13 @@ RSpec.describe Gitlab::Ci::Parsers::Security::Common do
expect
(
finding
.
remediations
.
first
.
checksum
).
to
eq
(
expected_remediation
.
checksum
)
end
it
'does not assign any remediation to the finding if there exists no related remediation'
do
finding
=
report
.
findings
.
find
{
|
x
|
x
.
compare_key
==
'yarn/yarn.lock:saml2-js:gemnasium:9952e574-7b5b-46fa-a270-aeb694198a98'
}
expect
(
Gitlab
::
Json
.
parse
(
finding
.
raw_metadata
).
dig
(
'remediations'
).
first
).
to
be_nil
expect
(
finding
.
remediations
).
to
match
([])
end
it
'does not find remediation with different id'
do
fix_with_id
=
{
"fixes"
:
[
...
...
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