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
dd6fdbe0
Commit
dd6fdbe0
authored
Mar 17, 2020
by
Tetiana Chupryna
Committed by
Robert Speicher
Mar 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix configuration issue for License Compliance
parent
fb46b18b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
60 additions
and
8 deletions
+60
-8
ee/app/finders/security/license_management_jobs_finder.rb
ee/app/finders/security/license_management_jobs_finder.rb
+1
-1
ee/app/presenters/projects/security/configuration_presenter.rb
...p/presenters/projects/security/configuration_presenter.rb
+27
-2
ee/changelogs/unreleased/209810-license-compliance-configuration.yml
...gs/unreleased/209810-license-compliance-configuration.yml
+5
-0
ee/spec/presenters/projects/security/configuration_presenter_spec.rb
...senters/projects/security/configuration_presenter_spec.rb
+17
-5
spec/factories/ci/builds.rb
spec/factories/ci/builds.rb
+10
-0
No files found.
ee/app/finders/security/license_management_jobs_finder.rb
View file @
dd6fdbe0
...
...
@@ -12,7 +12,7 @@
module
Security
class
LicenseManagementJobsFinder
<
JobsFinder
def
self
.
allowed_job_types
[
:license_management
]
[
:license_management
,
:license_scanning
]
end
end
end
ee/app/presenters/projects/security/configuration_presenter.rb
View file @
dd6fdbe0
...
...
@@ -12,6 +12,7 @@ module Projects
dast:
_
(
'Analyze a review version of your web application.'
),
dependency_scanning:
_
(
'Analyze your dependencies for known vulnerabilities.'
),
license_management:
_
(
'Search your project dependencies for their licenses and apply policies.'
),
license_scanning:
_
(
'Search your project dependencies for their licenses and apply policies.'
),
sast:
_
(
'Analyze your source code for known vulnerabilities.'
)
}.
freeze
...
...
@@ -20,6 +21,7 @@ module Projects
dast:
'user/application_security/dast/index'
,
dependency_scanning:
'user/application_security/dependency_scanning/index'
,
license_management:
'user/application_security/license_compliance/index'
,
license_scanning:
'user/application_security/license_compliance/index'
,
sast:
'user/application_security/sast/index'
}.
freeze
...
...
@@ -27,7 +29,8 @@ module Projects
container_scanning:
_
(
'Container Scanning'
),
dast:
_
(
'Dynamic Application Security Testing (DAST)'
),
dependency_scanning:
_
(
'Dependency Scanning'
),
license_management:
_
(
'License Compliance'
),
license_management:
'License Management'
,
license_scanning:
_
(
'License Compliance'
),
sast:
_
(
'Static Application Security Testing (SAST)'
)
}.
freeze
...
...
@@ -44,7 +47,7 @@ module Projects
private
def
features
scan_types
.
map
do
|
scan_type
|
scan
s
=
scan
_types
.
map
do
|
scan_type
|
if
auto_devops_source?
scan
(
scan_type
,
configured:
true
)
elsif
latest_builds_reports
.
include?
(
scan_type
)
...
...
@@ -53,6 +56,9 @@ module Projects
scan
(
scan_type
,
configured:
false
)
end
end
# TODO: remove this line with #8912
license_compliance_substitute
(
scans
)
end
def
latest_builds_reports
...
...
@@ -84,6 +90,25 @@ module Projects
project_pipeline_path
(
self
,
latest_default_branch_pipeline
)
end
# In this method we define if License Compliance feature is configured
# by looking into `license_scanning` and `license_management` reports
# in 13.0 support for `license_management` report type is scheduled to be dropped.
# With this change we won't need this method anymore.
def
license_compliance_substitute
(
scans
)
license_management
=
scans
.
find
{
|
scan_type
|
scan_type
[
:name
]
==
SCAN_NAMES
[
:license_management
]
}
license_compliance_config
=
license_management
.
fetch
(
:configured
,
false
)
scans
.
delete
(
license_management
)
if
license_compliance_config
scans
.
map
do
|
scan_type
|
scan_type
[
:configured
]
=
true
if
scan_type
[
:name
]
==
_
(
'License Compliance'
)
end
end
scans
end
def
scan
(
type
,
configured:
false
)
{
configured:
configured
,
...
...
ee/changelogs/unreleased/209810-license-compliance-configuration.yml
0 → 100644
View file @
dd6fdbe0
---
title
:
Fix configuration issue for License Compliance
merge_request
:
27016
author
:
type
:
fixed
ee/spec/presenters/projects/security/configuration_presenter_spec.rb
View file @
dd6fdbe0
...
...
@@ -42,7 +42,7 @@ describe Projects::Security::ConfigurationPresenter do
security_scan
(
:sast
,
configured:
true
),
security_scan
(
:container_scanning
,
configured:
true
),
security_scan
(
:dependency_scanning
,
configured:
true
),
security_scan
(
:license_
management
,
configured:
true
)
security_scan
(
:license_
scanning
,
configured:
true
)
)
end
end
...
...
@@ -62,7 +62,7 @@ describe Projects::Security::ConfigurationPresenter do
security_scan
(
:sast
,
configured:
false
),
security_scan
(
:container_scanning
,
configured:
false
),
security_scan
(
:dependency_scanning
,
configured:
false
),
security_scan
(
:license_
management
,
configured:
false
)
security_scan
(
:license_
scanning
,
configured:
false
)
)
end
end
...
...
@@ -88,7 +88,7 @@ describe Projects::Security::ConfigurationPresenter do
security_scan
(
:sast
,
configured:
true
),
security_scan
(
:container_scanning
,
configured:
false
),
security_scan
(
:dependency_scanning
,
configured:
false
),
security_scan
(
:license_
management
,
configured:
false
)
security_scan
(
:license_
scanning
,
configured:
false
)
)
end
...
...
@@ -102,7 +102,7 @@ describe Projects::Security::ConfigurationPresenter do
security_scan
(
:sast
,
configured:
true
),
security_scan
(
:container_scanning
,
configured:
false
),
security_scan
(
:dependency_scanning
,
configured:
false
),
security_scan
(
:license_
management
,
configured:
false
)
security_scan
(
:license_
scanning
,
configured:
false
)
)
end
...
...
@@ -122,7 +122,19 @@ describe Projects::Security::ConfigurationPresenter do
security_scan
(
:sast
,
configured:
true
),
security_scan
(
:container_scanning
,
configured:
false
),
security_scan
(
:dependency_scanning
,
configured:
false
),
security_scan
(
:license_management
,
configured:
false
)
security_scan
(
:license_scanning
,
configured:
false
)
)
end
it
'detect new license compliance job'
do
create
(
:ci_build
,
:license_scanning
,
pipeline:
pipeline
)
expect
(
JSON
.
parse
(
subject
[
:features
])).
to
contain_exactly
(
security_scan
(
:dast
,
configured:
true
),
security_scan
(
:sast
,
configured:
true
),
security_scan
(
:container_scanning
,
configured:
false
),
security_scan
(
:dependency_scanning
,
configured:
false
),
security_scan
(
:license_scanning
,
configured:
true
)
)
end
...
...
spec/factories/ci/builds.rb
View file @
dd6fdbe0
...
...
@@ -355,6 +355,8 @@ FactoryBot.define do
options
{
{}
}
end
# TODO: move Security traits to ee_ci_build
# https://gitlab.com/gitlab-org/gitlab/-/issues/210486
trait
:dast
do
options
do
{
...
...
@@ -395,6 +397,14 @@ FactoryBot.define do
end
end
trait
:license_scanning
do
options
do
{
artifacts:
{
reports:
{
license_management:
'gl-license-scanning-report.json'
}
}
}
end
end
trait
:non_playable
do
status
{
'created'
}
self
.
when
{
'manual'
}
...
...
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