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
c225cc3e
Commit
c225cc3e
authored
Feb 01, 2022
by
Dominic Bauer
Committed by
Andy Soiron
Feb 01, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Respond with finding UUID when creating Starboard vulnerability
parent
ece5fea4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
2 deletions
+17
-2
doc/development/internal_api/index.md
doc/development/internal_api/index.md
+9
-1
ee/app/models/ee/vulnerability.rb
ee/app/models/ee/vulnerability.rb
+1
-1
ee/lib/ee/api/internal/kubernetes.rb
ee/lib/ee/api/internal/kubernetes.rb
+1
-0
ee/spec/requests/api/internal/kubernetes_spec.rb
ee/spec/requests/api/internal/kubernetes_spec.rb
+6
-0
No files found.
doc/development/internal_api/index.md
View file @
c225cc3e
...
...
@@ -507,7 +507,7 @@ curl --request POST --header "Gitlab-Kas-Api-Request: <JWT token>" \
Called from the GitLab Agent Server (
`kas`
) to create a security vulnerability
from a Starboard vulnerability report. This request is idempotent. Multiple requests with the same data
create a single vulnerability.
create a single vulnerability.
The response contains the UUID of the created vulnerability finding.
| Attribute | Type | Required | Description |
|:----------------|:-------|:---------|:------------|
...
...
@@ -553,6 +553,14 @@ curl --request PUT --header "Gitlab-Kas-Api-Request: <JWT token>" \
}'
```
Example response:
```
json
{
"uuid"
:
"4773b2ee-5ba5-5e9f-b48c-5f7a17f0faac"
}
```
## Subscriptions
The subscriptions endpoint is used by
[
CustomersDot
](
https://gitlab.com/gitlab-org/customers-gitlab-com
)
(
`customers.gitlab.com`
)
...
...
ee/app/models/ee/vulnerability.rb
View file @
c225cc3e
...
...
@@ -127,7 +127,7 @@ module EE
joins
(
:findings
).
merge
(
Vulnerabilities
::
Finding
.
by_location_cluster_agent
(
agent_ids
))
end
delegate
:scanner_name
,
:scanner_external_id
,
:scanner_id
,
:metadata
,
:message
,
:description
,
:details
,
delegate
:scanner_name
,
:scanner_external_id
,
:scanner_id
,
:metadata
,
:message
,
:description
,
:details
,
:uuid
,
to: :finding
,
prefix:
true
,
allow_nil:
true
delegate
:default_branch
,
:name
,
to: :project
,
prefix:
true
,
allow_nil:
true
...
...
ee/lib/ee/api/internal/kubernetes.rb
View file @
c225cc3e
...
...
@@ -120,6 +120,7 @@ module EE
if
result
.
success?
status
result
.
http_status
{
uuid:
result
.
payload
[
:vulnerability
].
finding_uuid
}
else
render_api_error!
(
result
.
message
,
result
.
http_status
)
end
...
...
ee/spec/requests/api/internal/kubernetes_spec.rb
View file @
c225cc3e
...
...
@@ -276,6 +276,12 @@ RSpec.describe API::Internal::Kubernetes do
expect
(
Vulnerability
.
all
.
first
.
finding
.
name
).
to
eq
(
payload
[
:vulnerability
][
:name
])
end
it
"responds with the created vulnerability's UUID"
do
send_request
(
params:
payload
)
expect
(
json_response
).
to
match
(
"uuid"
=>
Vulnerability
.
last
.
finding
.
uuid
)
end
context
'when payload is invalid'
do
let
(
:payload
)
{
{
vulnerability:
'invalid'
}
}
...
...
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