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
bc090b98
Commit
bc090b98
authored
Feb 15, 2022
by
Michał Zając
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add deprecated versions and cover api_fuzzing
parent
c5b67bc4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
8 deletions
+23
-8
lib/gitlab/ci/parsers/security/validators/schema_validator.rb
...gitlab/ci/parsers/security/validators/schema_validator.rb
+20
-7
spec/lib/gitlab/ci/parsers/security/validators/schema_validator_spec.rb
...b/ci/parsers/security/validators/schema_validator_spec.rb
+3
-1
No files found.
lib/gitlab/ci/parsers/security/validators/schema_validator.rb
View file @
bc090b98
...
...
@@ -6,24 +6,37 @@ module Gitlab
module
Security
module
Validators
class
SchemaValidator
# https://docs.gitlab.com/ee/update/deprecations.html#147
SUPPORTED_VERSIONS
=
{
cluster_image_scanning:
%w[14.0.4 14.0.5 14.0.6 14.1.0]
,
container_scanning:
%w[14.0.0 14.0.1 14.0.2 14.0.3 14.0.4 14.0.5 14.0.6 14.1.0]
,
coverage_fuzzing:
%w[14.0.0 14.0.1 14.0.2 14.0.3 14.0.4 14.0.5 14.0.6 14.1.0]
,
dast:
%w[14.0.0 14.0.1 14.0.2 14.0.3 14.0.4 14.0.5 14.0.6 14.1.0]
,
api_fuzzing:
%w[14.0.0 14.0.1 14.0.2 14.0.3 14.0.4 14.0.5 14.0.6 14.1.0]
,
dependency_scanning:
%w[14.0.0 14.0.1 14.0.2 14.0.3 14.0.4 14.0.5 14.0.6 14.1.0]
,
sast:
%w[14.0.0 14.0.1 14.0.2 14.0.3 14.0.4 14.0.5 14.0.6 14.1.0]
,
secret_detection:
%w[14.0.0 14.0.1 14.0.2 14.0.3 14.0.4 14.0.5 14.0.6 14.1.0]
}.
freeze
# https://gitlab.com/gitlab-org/security-products/security-report-schemas/-/tags
PREVIOUS_RELEASES
=
%w[10.0.0 12.0.0 12.1.0 13.0.0
13.1.0 2.3.0-rc1 2.3.0-rc1 2.3.1-rc1 2.3.2-rc1 2.3.3-rc1
2.4.0-rc1 3.0.0 3.0.0-rc1 3.1.0-rc1 4.0.0-rc1 5.0.0-rc1
5.0.1-rc1 6.0.0-rc1 6.0.1-rc1 6.1.0-rc1 7.0.0-rc1 7.0.1-rc1
8.0.0-rc1 8.0.1-rc1 8.1.0-rc1 9.0.0-rc1]
.
freeze
# These come from https://app.periscopedata.com/app/gitlab/895813/Secure-Scan-metrics?widget=12248944&udv=1385516
KNOWN_VERSIONS_TO_DEPRECATE
=
%w[0.1 1.0 1.0.0 1.2 1.3 10.0.0 12.1.0 13.1.0 2.0 2.1 2.1.0 2.3 2.3.0 2.4 3.0 3.0.0 3.0.6 3.13.2 V2.7.0]
.
freeze
DEPRECATED_VERSIONS
=
{
cluster_image_scanning:
%w[]
,
container_scanning:
%w[]
,
coverage_fuzzing:
%w[]
,
dast:
%w[]
,
dependency_scanning:
%w[]
,
sast:
%w[]
,
secret_detection:
%w[]
cluster_image_scanning:
PREVIOUS_RELEASES
+
KNOWN_VERSIONS_TO_DEPRECATE
+
%w[]
,
container_scanning:
PREVIOUS_RELEASES
+
KNOWN_VERSIONS_TO_DEPRECATE
+
%w[]
,
coverage_fuzzing:
PREVIOUS_RELEASES
+
KNOWN_VERSIONS_TO_DEPRECATE
+
%w[]
,
dast:
PREVIOUS_RELEASES
+
KNOWN_VERSIONS_TO_DEPRECATE
+
%w[]
,
api_fuzzing:
PREVIOUS_RELEASES
+
KNOWN_VERSIONS_TO_DEPRECATE
+
%w[]
,
dependency_scanning:
PREVIOUS_RELEASES
+
KNOWN_VERSIONS_TO_DEPRECATE
+
%w[]
,
sast:
PREVIOUS_RELEASES
+
KNOWN_VERSIONS_TO_DEPRECATE
+
%w[]
,
secret_detection:
PREVIOUS_RELEASES
+
KNOWN_VERSIONS_TO_DEPRECATE
+
%w[]
}.
freeze
class
Schema
...
...
spec/lib/gitlab/ci/parsers/security/validators/schema_validator_spec.rb
View file @
bc090b98
...
...
@@ -36,10 +36,12 @@ RSpec.describe Gitlab::Ci::Parsers::Security::Validators::SchemaValidator do
context
'every SUPPORTED_VERSION has a corresponding JSON file'
do
described_class
::
SUPPORTED_VERSIONS
.
each_key
do
|
report_type
|
let
(
:filename
)
{
"
#{
report_type
.
to_s
.
tr
(
"_"
,
"-"
)
}
-report-format.json"
}
# api_fuzzing is covered by DAST schema
next
if
report_type
==
:api_fuzzing
described_class
::
SUPPORTED_VERSIONS
[
report_type
].
each
do
|
version
|
it
"
#{
report_type
}
#{
version
}
schema file is present"
do
filename
=
"
#{
report_type
.
to_s
.
tr
(
"_"
,
"-"
)
}
-report-format.json"
full_path
=
SCHEMA_PATH
.
join
(
version
,
filename
)
expect
(
File
.
file?
(
full_path
)).
to
be
true
end
...
...
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