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
a7d6e53c
Commit
a7d6e53c
authored
Mar 02, 2021
by
Thiago Figueiró
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove `scanner` parameter from vulnerability_findings REST endpoint
parent
7f422613
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
14 deletions
+5
-14
doc/api/vulnerability_findings.md
doc/api/vulnerability_findings.md
+0
-2
ee/changelogs/unreleased/322803-vulnerability_findings-api-does-not-correctly-filter-on-scanner-pa.yml
..._findings-api-does-not-correctly-filter-on-scanner-pa.yml
+5
-0
ee/lib/api/vulnerability_findings.rb
ee/lib/api/vulnerability_findings.rb
+0
-4
ee/spec/requests/api/vulnerability_findings_spec.rb
ee/spec/requests/api/vulnerability_findings_spec.rb
+0
-8
No files found.
doc/api/vulnerability_findings.md
View file @
a7d6e53c
...
...
@@ -49,7 +49,6 @@ GET /projects/:id/vulnerability_findings?scope=all
GET /projects/:id/vulnerability_findings?scope=dismissed
GET /projects/:id/vulnerability_findings?severity=high
GET /projects/:id/vulnerability_findings?confidence=unknown,experimental
GET /projects/:id/vulnerability_findings?scanner=bandit,find_sec_bugs
GET /projects/:id/vulnerability_findings?pipeline_id=42
```
...
...
@@ -63,7 +62,6 @@ Beginning with GitLab 12.9, the `undefined` severity and confidence level is no
|
`scope`
| string | no | Returns vulnerability findings for the given scope:
`all`
or
`dismissed`
. Defaults to
`dismissed`
. |
|
`severity`
| string array | no | Returns vulnerability findings belonging to specified severity level:
`info`
,
`unknown`
,
`low`
,
`medium`
,
`high`
, or
`critical`
. Defaults to all. |
|
`confidence`
| string array | no | Returns vulnerability findings belonging to specified confidence level:
`ignore`
,
`unknown`
,
`experimental`
,
`low`
,
`medium`
,
`high`
, or
`confirmed`
. Defaults to all. |
|
`scanner`
| string array | no | Returns vulnerability findings detected by specified scanner.
|
`pipeline_id`
| integer/string | no | Returns vulnerability findings belonging to specified pipeline. |
```
shell
...
...
ee/changelogs/unreleased/322803-vulnerability_findings-api-does-not-correctly-filter-on-scanner-pa.yml
0 → 100644
View file @
a7d6e53c
---
title
:
Remove scanner parameter from vulnerability_findings REST endpoint
merge_request
:
55453
author
:
Thiago Figueiro @thiagocsf
type
:
changed
ee/lib/api/vulnerability_findings.rb
View file @
a7d6e53c
...
...
@@ -76,10 +76,6 @@ module API
'Defaults to all'
,
values:
::
Vulnerabilities
::
Finding
.
confidences
.
keys
,
default:
::
Vulnerabilities
::
Finding
.
confidences
.
keys
optional
:scanner
,
type:
Array
[
String
],
coerce_with:
::
API
::
Validations
::
Types
::
CommaSeparatedToArray
.
coerce
,
desc:
'Returns vulnerabilities detected by specified scanners'
optional
:pipeline_id
,
type:
String
,
desc:
'The ID of the pipeline'
use
:pagination
...
...
ee/spec/requests/api/vulnerability_findings_spec.rb
View file @
a7d6e53c
...
...
@@ -179,14 +179,6 @@ RSpec.describe API::VulnerabilityFindings do
expect
(
response
).
to
have_gitlab_http_status
(
:bad_request
)
end
it
'returns vulnerabilities detected by bandit and find_sec_bugs scanners'
do
get
api
(
project_vulnerability_findings_path
,
user
),
params:
{
scanner:
'bandit,find_sec_bugs'
}.
merge
(
pagination
)
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
json_response
.
map
{
|
v
|
v
.
dig
(
'scanner'
,
'external_id'
)
}.
uniq
).
to
match_array
%w[bandit find_sec_bugs]
end
context
'when pipeline_id is supplied'
do
it
'returns vulnerabilities from supplied pipeline'
do
finding_count
=
(
sast_report
.
findings
.
count
+
ds_report
.
findings
.
count
-
1
).
to_s
...
...
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