Commit 79e60c25 authored by Mark Chao's avatar Mark Chao

Merge branch 'sk/337926-add-location-cluster-id' into 'master'

Get cluster_id from kubernetes_resource for CIS

See merge request gitlab-org/gitlab!74300
parents fa77fab4 2bcd9737
......@@ -10,7 +10,7 @@ module Gitlab
def create_location(location_data)
::Gitlab::Ci::Reports::Security::Locations::ClusterImageScanning.new(
image: location_data['image'],
cluster_id: location_data['cluster_id'],
cluster_id: location_data.dig('kubernetes_resource', 'cluster_id'),
operating_system: location_data['operating_system'],
package_name: location_data.dig('dependency', 'package', 'name'),
package_version: location_data.dig('dependency', 'version'))
......
......@@ -22,7 +22,13 @@
},
"operating_system": "debian:9",
"image": "registry.gitlab.com/gitlab-org/security-products/dast/webgoat-8.0@sha256:bc09fe2e0721dfaeee79364115aeedf2174cce0947b9ae5fe7c33312ee019a4e",
"cluster_id": "1"
"kubernetes_resource": {
"namespace":"default",
"name":"sample-app",
"kind":"ReplicaSet",
"container_name":"webgoat",
"cluster_id":"1"
}
},
"identifiers": [
{
......@@ -59,7 +65,13 @@
},
"operating_system": "debian:9",
"image": "registry.gitlab.com/gitlab-org/security-products/dast/webgoat-8.0@sha256:bc09fe2e0721dfaeee79364115aeedf2174cce0947b9ae5fe7c33312ee019a4e",
"cluster_id": "1"
"kubernetes_resource": {
"namespace":"default",
"name":"sample-app",
"kind":"ReplicaSet",
"container_name":"webgoat",
"cluster_id":"1"
}
},
"identifiers": [
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment