Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
{
"data": {
"imageV2": {
"id": "4c657931-d333-5cb8-8f0d-7e3836525ec7",
"digest": "sha256:abcxyz",
"name": {
"registry": "docker.io",
"remote": "cypress-test/image",
"tag": "v0.0.1",
"__typename": "ImageName"
},
"metadata": {
"v1": {
"layers": [
{
"instruction": "ADD",
"value": "file:abc123 in /",
"__typename": "ImageLayer"
}
],
"__typename": "V1Metadata"
},
"__typename": "ImageMetadata"
},
"__typename": "ImageV2",
"imageVulnerabilityCount": 2,
"imageCVECountBySeverity": {
"unknown": {
"total": 0,
"fixable": 0,
"__typename": "ResourceCountByFixability"
},
"low": {
"total": 0,
"fixable": 0,
"__typename": "ResourceCountByFixability"
},
"moderate": {
"total": 0,
"fixable": 0,
"__typename": "ResourceCountByFixability"
},
"important": {
"total": 2,
"fixable": 2,
"__typename": "ResourceCountByFixability"
},
"critical": {
"total": 0,
"fixable": 0,
"__typename": "ResourceCountByFixability"
},
"__typename": "ResourceCountByCVESeverity"
},
"imageVulnerabilities": [
{
"severity": "IMPORTANT_VULNERABILITY_SEVERITY",
"cve": "MOCK-2023-0464",
"summary": "This is a mocked CVE in a Cypress test",
"cvss": 7.5,
"scoreVersion": "V3",
"nvdCvss": 0,
"nvdScoreVersion": "UNKNOWN_VERSION",
"cveBaseInfo": {
"epss": null
},
"discoveredAtImage": "2024-03-01T17:45:32.757812569Z",
"publishedOn": "2023-03-22T17:15:00Z",
"pendingExceptionCount": 0,
"imageComponents": [
{
"name": "openssl",
"version": "3.0.8-r0",
"location": "",
"source": "OS",
"layerIndex": 0,
"imageVulnerabilities": [
{
"severity": "IMPORTANT_VULNERABILITY_SEVERITY",
"fixedByVersion": "3.0.8-r1",
"pendingExceptionCount": 0,
"__typename": "ImageVulnerability"
}
],
"__typename": "ImageComponent"
}
],
"__typename": "ImageVulnerability"
},
{
"severity": "IMPORTANT_VULNERABILITY_SEVERITY",
"cve": "MOCK-2023-5363",
"summary": "This is a mocked CVE in a Cypress test",
"cvss": 7.5,
"scoreVersion": "V3",
"nvdCvss": 0,
"nvdScoreVersion": "UNKNOWN_VERSION",
"cveBaseInfo": {
"epss": null
},
"discoveredAtImage": "2024-03-01T17:45:32.757812569Z",
"publishedOn": "2023-10-25T18:17:00Z",
"pendingExceptionCount": 0,
"imageComponents": [
{
"name": "openssl",
"version": "3.0.8-r0",
"location": "",
"source": "OS",
"layerIndex": 0,
"imageVulnerabilities": [
{
"severity": "IMPORTANT_VULNERABILITY_SEVERITY",
"fixedByVersion": "3.0.12-r0",
"pendingExceptionCount": 0,
"__typename": "ImageVulnerability"
}
],
"__typename": "ImageComponent"
}
],
"__typename": "ImageVulnerability"
}
]
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { addDays, format } from 'date-fns';
import { getDescriptionListGroup } from '../../../helpers/formHelpers';
import { hasFeatureFlag } from '../../../helpers/features';
import {
getRouteMatcherMapForGraphQL,
interactAndWaitForResponses,
Expand Down Expand Up @@ -257,11 +258,18 @@ export function visitImageSinglePageWithMockedResponses() {
imageDetailsOpname,
cveListOpname,
]);

// When FlattenImageData is enabled, the getCVEsForImage query uses imageV2(...)
// which returns data under the `imageV2` key instead of `image`.
const cveListFixture = hasFeatureFlag('ROX_FLATTEN_IMAGE_DATA')
? 'vulnerabilities/workloadCves/multipleCvesForImageV2.json'
: 'vulnerabilities/workloadCves/multipleCvesForImage.json';

const staticResponseMapForImageCves = {
[imageDetailsOpname]: {
fixture: 'vulnerabilities/workloadCves/imageWithMultipleCves.json',
},
[cveListOpname]: { fixture: 'vulnerabilities/workloadCves/multipleCvesForImage.json' },
[cveListOpname]: { fixture: cveListFixture },
};

visitWorkloadCveOverview();
Expand Down
Loading
Loading