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
4a6e0a32
Commit
4a6e0a32
authored
Aug 31, 2020
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab master
parents
aed1e1dc
0757395c
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
45 additions
and
4 deletions
+45
-4
app/controllers/admin/runners_controller.rb
app/controllers/admin/runners_controller.rb
+0
-1
app/views/admin/runners/update.js.haml
app/views/admin/runners/update.js.haml
+0
-2
ee/app/services/security/store_report_service.rb
ee/app/services/security/store_report_service.rb
+1
-1
ee/changelogs/unreleased/235164-sidekiq-storesecurityreportsworker-nomethoderror-undefined-meth.yml
...oresecurityreportsworker-nomethoderror-undefined-meth.yml
+5
-0
ee/spec/factories/ci/job_artifacts.rb
ee/spec/factories/ci/job_artifacts.rb
+16
-0
ee/spec/services/security/store_report_service_spec.rb
ee/spec/services/security/store_report_service_spec.rb
+23
-0
No files found.
app/controllers/admin/runners_controller.rb
View file @
4a6e0a32
...
...
@@ -17,7 +17,6 @@ class Admin::RunnersController < Admin::ApplicationController
def
update
if
Ci
::
UpdateRunnerService
.
new
(
@runner
).
update
(
runner_params
)
respond_to
do
|
format
|
format
.
js
format
.
html
{
redirect_to
admin_runner_path
(
@runner
)
}
end
else
...
...
app/views/admin/runners/update.js.haml
deleted
100644 → 0
View file @
aed1e1dc
:plain
$("#runner_
#{
@runner
.
id
}
").replaceWith("
#{
escape_javascript
(
render
(
@runner
))
}
")
ee/app/services/security/store_report_service.rb
View file @
4a6e0a32
...
...
@@ -42,7 +42,7 @@ module Security
end
def
create_vulnerability_finding
(
finding
)
return
if
finding
.
scanner
.
blank?
return
if
finding
.
scanner
.
blank?
||
finding
.
primary_identifier
.
blank?
vulnerability_params
=
finding
.
to_hash
.
except
(
:compare_key
,
:identifiers
,
:location
,
:scanner
)
vulnerability_finding
=
create_or_find_vulnerability_finding
(
finding
,
vulnerability_params
)
...
...
ee/changelogs/unreleased/235164-sidekiq-storesecurityreportsworker-nomethoderror-undefined-meth.yml
0 → 100644
View file @
4a6e0a32
---
title
:
Add identifier check when creating vulnerability findings
merge_request
:
39650
author
:
type
:
fixed
ee/spec/factories/ci/job_artifacts.rb
View file @
4a6e0a32
...
...
@@ -179,6 +179,22 @@ FactoryBot.define do
end
end
trait
:sast_with_missing_identifiers
do
file_type
{
:sast
}
file_format
{
:raw
}
after
(
:build
)
do
|
artifact
,
_
|
file
=
fixture_file_upload
(
Rails
.
root
.
join
(
'ee/spec/fixtures/security_reports/master/gl-sast-report.json'
),
'application/json'
)
data
=
Gitlab
::
Json
.
parse
(
file
.
tempfile
.
read
)[
'vulnerabilities'
].
each
{
|
v
|
v
.
delete
(
'identifiers'
)
}.
to_json
output
=
Tempfile
.
new
(
"gl-sast-missing-identifiers"
)
output
.
write
(
data
)
artifact
.
file
=
fixture_file_upload
(
output
.
path
,
'application/json'
)
output
.
close
output
.
unlink
end
end
trait
:license_management
do
to_create
{
|
instance
|
instance
.
save!
(
validate:
false
)
}
...
...
ee/spec/services/security/store_report_service_spec.rb
View file @
4a6e0a32
...
...
@@ -203,6 +203,29 @@ RSpec.describe Security::StoreReportService, '#execute' do
expect
{
subject
}.
not_to
raise_error
end
end
context
'when the finding does not include a primary identifier'
do
let
(
:bad_project
)
{
bad_artifact
.
project
}
let
(
:bad_pipeline
)
{
bad_artifact
.
job
.
pipeline
}
let!
(
:bad_artifact
)
{
create
(
:ee_ci_job_artifact
,
:sast_with_missing_identifiers
)
}
let
(
:bad_report
)
{
bad_pipeline
.
security_reports
.
get_report
(
report_type
.
to_s
,
bad_artifact
)
}
let
(
:report_type
)
{
:sast
}
before
do
bad_project
.
add_developer
(
user
)
allow
(
bad_pipeline
).
to
receive
(
:user
).
and_return
(
user
)
end
subject
{
described_class
.
new
(
bad_pipeline
,
bad_report
).
execute
}
it
'does not create a new finding'
do
expect
{
subject
}.
not_to
change
{
Vulnerabilities
::
Finding
.
count
}
end
it
'does not raise an error'
do
expect
{
subject
}.
not_to
raise_error
end
end
end
context
'with existing data from same pipeline'
do
...
...
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