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
ae8c9189
Commit
ae8c9189
authored
May 28, 2021
by
Mehmet Emin INAC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address the MR feedback
parent
d6e09929
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
ee/spec/finders/security/findings_finder_spec.rb
ee/spec/finders/security/findings_finder_spec.rb
+10
-10
No files found.
ee/spec/finders/security/findings_finder_spec.rb
View file @
ae8c9189
...
...
@@ -4,10 +4,10 @@ require 'spec_helper'
RSpec
.
describe
Security
::
FindingsFinder
do
let_it_be
(
:pipeline
)
{
create
(
:ci_pipeline
)
}
let_it_be
(
:build_
ds
)
{
create
(
:ci_build
,
:success
,
name:
'dependency_scanning'
,
pipeline:
pipeline
)
}
let_it_be
(
:build_
sast
)
{
create
(
:ci_build
,
:success
,
name:
'sast'
,
pipeline:
pipeline
)
}
let_it_be
(
:artifact_ds
)
{
create
(
:ee_ci_job_artifact
,
:dependency_scanning
,
job:
build_
ds
)
}
let_it_be
(
:artifact_sast
)
{
create
(
:ee_ci_job_artifact
,
:sast
,
job:
build_
sast
)
}
let_it_be
(
:build_
1
)
{
create
(
:ci_build
,
:success
,
name:
'dependency_scanning'
,
pipeline:
pipeline
)
}
let_it_be
(
:build_
2
)
{
create
(
:ci_build
,
:success
,
name:
'sast'
,
pipeline:
pipeline
)
}
let_it_be
(
:artifact_ds
)
{
create
(
:ee_ci_job_artifact
,
:dependency_scanning
,
job:
build_
1
)
}
let_it_be
(
:artifact_sast
)
{
create
(
:ee_ci_job_artifact
,
:sast
,
job:
build_
2
)
}
let_it_be
(
:report_ds
)
{
create
(
:ci_reports_security_report
,
pipeline:
pipeline
,
type: :dependency_scanning
)
}
let_it_be
(
:report_sast
)
{
create
(
:ci_reports_security_report
,
pipeline:
pipeline
,
type: :sast
)
}
...
...
@@ -273,17 +273,17 @@ RSpec.describe Security::FindingsFinder do
context
'when a build has more than one security report artifacts'
do
let
(
:report_types
)
{
:secret_detection
}
let
(
:expected_fingerprints
)
{
%w[0cac4e1f5f407998454dd6af2052d548bad058f5]
}
let
(
:secret_detection_report
)
{
create
(
:ci_reports_security_report
,
pipeline:
pipeline
,
type: :secret_detection
)
}
let
(
:expected_fingerprints
)
{
secret_detection_report
.
findings
.
map
(
&
:project_fingerprint
)
}
before
do
scan
=
create
(
:security_scan
,
scan_type: :secret_detection
,
build:
build_sast
)
report
=
create
(
:ci_reports_security_report
,
pipeline:
pipeline
,
type: :secret_detection
)
artifact
=
create
(
:ee_ci_job_artifact
,
:secret_detection
,
job:
build_sast
)
scan
=
create
(
:security_scan
,
scan_type: :secret_detection
,
build:
build_2
)
artifact
=
create
(
:ee_ci_job_artifact
,
:secret_detection
,
job:
build_2
)
report_content
=
File
.
read
(
artifact
.
file
.
path
)
Gitlab
::
Ci
::
Parsers
::
Security
::
SecretDetection
.
parse!
(
report_content
,
report
)
Gitlab
::
Ci
::
Parsers
::
Security
::
SecretDetection
.
parse!
(
report_content
,
secret_detection_
report
)
report
.
findings
.
each_with_index
do
|
finding
,
index
|
secret_detection_
report
.
findings
.
each_with_index
do
|
finding
,
index
|
create
(
:security_finding
,
severity:
finding
.
severity
,
confidence:
finding
.
confidence
,
...
...
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