From 343b0c4fa21b8a011a52df5422056e23afc8d8ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roger=20Bj=C3=B8rnstad?= Date: Tue, 1 Dec 2026 15:05:27 +0100 Subject: [PATCH] chore(graphql): deprecate legacy v13s entry points Document v0s migration paths while preserving legacy queries, writes and historical activity logs. Mark shared legacy filtering and ordering choices deprecated without changing their behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- docs/v0s_console_migration.md | 37 +++++ internal/graph/gengql/root_.generated.go | 136 ++++++++++++++++++- internal/graph/schema/v0s.graphqls | 4 +- internal/graph/schema/vulnerability.graphqls | 129 +++++++++++++++++- internal/graph/schema/workloads.graphqls | 3 + internal/graph/vulnerability_filter_test.go | 101 ++++++++++++++ 6 files changed, 398 insertions(+), 12 deletions(-) diff --git a/docs/v0s_console_migration.md b/docs/v0s_console_migration.md index 29a7d5846..8cd4a1cae 100644 --- a/docs/v0s_console_migration.md +++ b/docs/v0s_console_migration.md @@ -13,6 +13,43 @@ assessment mutations, ordering and pagination retain their v13s behavior. Console must use one coherent vulnerability read/write flow, not combine v0s findings with v13s summaries or assessments. v0s reads never fall back to v13s. +### Legacy GraphQL deprecation + +The v13s entry points are deprecated, not removed or redirected. Existing +queries, mutations, node IDs, filters, ordering and pagination keep their +behavior during migration, including TPT's `image.vulnerabilities` reads. +There is no removal date yet. Deploy and verify consumer migrations before +removing the legacy integration. + +| Deprecated surface | Migration | +| --------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | +| `cve` / `cves` | `vulnerability(identifier:)` for advisory details; `vulnerabilityFindings.vulnerabilities` for filtered groups | +| Tenant/team `vulnerabilitySummary` | The corresponding `vulnerabilityFindings.summary` | +| Tenant `vulnerabilitySummaries` | `vulnerabilityFindings.affectedWorkloads` with `vulnerabilityOverview` for affected workloads; `Team.workloads` for complete inventory | +| Team `vulnerabilitySummaries` | `Team.workloads` with each workload's `vulnerabilityOverview` | +| `ContainerImage.vulnerabilities` / `vulnerabilitySummary` | `Workload.vulnerabilityFindings` / `vulnerabilityOverview` | +| `CVE.workloads` | Filter `vulnerabilityFindings` by `vulnerabilityIdentifiers`; select `affectedWorkloads` for distinct workloads or `nodes` for package findings | +| Image `sbom` / `hasSBOM`, legacy workload SBOM filter | `Workload.vulnerabilityCoverage` and `TeamWorkloadsFilter.vulnerabilityCoverageStatuses` | +| `ContainerImage.workloadReferences` | Current inventory through `Team.workloads` and workload image references | +| `updateImageVulnerability` | `setVulnerabilitySuppressions` / `deleteVulnerabilitySuppressions`, only after assessment migration and tenant write activation | +| Legacy workload severity ordering | The corresponding `VULNERABILITY_UNIQUE_*` ordering on `Team.workloads`; counts are not equivalent | + +Summary and ordering replacements are not drop-in equivalents: v0s distinguishes +findings, unique vulnerabilities and workloads, and its scan coverage is not the +legacy SBOM pipeline status. Review the counting and coverage semantics below. +History, mean-time-to-fix, risk scores, operational-priority filtering and +risk/priority ordering are being retired without replacement. Legacy team +ordering, workload SBOM ordering, scan-time ordering and processing-start +timestamps also have no replacement ordering or timestamp where stated in the +schema. + +Only legacy entry points and the filter/order choices on shared surfaces are +deprecated as a group; historical activity-log fields remain available. +Legacy Node types are documented as such, but generic `node` lookup remains +available for both old and new IDs. Do not mix v0s reads with legacy assessment +writes. Deprecation does not enable writes or import v13s assessments, and direct +v0s writes do not replicate back to v13s for rollback. + Of the vulnerability-derived Issues, only `MISSING_SBOM` remains produced. `VULNERABLE_IMAGE` and `EXTERNAL_INGRESS_URGENT_VULNERABILITY` are retired; Issue connections, facets and workload severity scores exclude these rows diff --git a/internal/graph/gengql/root_.generated.go b/internal/graph/gengql/root_.generated.go index 93f15de9d..7aab78725 100644 --- a/internal/graph/gengql/root_.generated.go +++ b/internal/graph/gengql/root_.generated.go @@ -38413,12 +38413,12 @@ type DeleteVulnerabilitySuppressionsPayload { } extend type Mutation { - "Set workload assessments atomically. Until assessment writes are enabled, use updateImageVulnerability." + "Set workload assessments atomically. Requires assessment migration and enabled v0s writes for the tenant. Do not combine v0s reads with legacy assessment writes." setVulnerabilitySuppressions( "The team and assessments to update." input: SetVulnerabilitySuppressionsInput! ): SetVulnerabilitySuppressionsPayload! - "Delete workload assessments atomically. Until assessment writes are enabled, use updateImageVulnerability." + "Delete workload assessments atomically. Requires assessment migration and enabled v0s writes for the tenant. Do not combine v0s reads with legacy assessment writes." deleteVulnerabilitySuppressions( "The team and assessments to delete." input: DeleteVulnerabilitySuppressionsInput! @@ -39078,6 +39078,9 @@ extend enum ActivityLogActivityType { This mutation is currently unstable and may change in the future. """ updateImageVulnerability(input: UpdateImageVulnerabilityInput!): UpdateImageVulnerabilityPayload! + @deprecated( + reason: "Uses legacy v13s assessments. Use setVulnerabilitySuppressions and deleteVulnerabilitySuppressions only after assessments are migrated and v0s writes are enabled for the tenant." + ) } extend type Query { @@ -39086,12 +39089,16 @@ extend type Query { "Get vulnerability summary from given date until today." from: Date! ): ImageVulnerabilityHistory! + @deprecated(reason: "Legacy v13s vulnerability history is being retired without replacement.") "Get the vulnerability summary for the tenant." vulnerabilitySummary( "Filter the aggregate." filter: TenantVulnerabilitySummaryFilter ): TenantVulnerabilitySummary! + @deprecated( + reason: "Uses legacy v13s data. Use Query.vulnerabilityFindings.summary for v0s counts and coverage; counting semantics differ." + ) "List per-workload vulnerability summaries across all teams." vulnerabilitySummaries( @@ -39113,12 +39120,21 @@ extend type Query { "Order workload vulnerability summaries across all teams." orderBy: VulnerabilitySummaryOrder ): WorkloadVulnerabilitySummaryConnection! + @deprecated( + reason: "Uses legacy v13s data. Use Query.vulnerabilityFindings.affectedWorkloads with Workload.vulnerabilityOverview for affected workloads, or Team.workloads for the complete inventory." + ) "Get the mean time to fix history for all teams." vulnerabilityFixHistory(from: Date!): VulnerabilityFixHistory! + @deprecated( + reason: "Legacy v13s mean-time-to-fix history is being retired without replacement." + ) "Get a specific CVE by its identifier." cve(identifier: String!): CVE! + @deprecated( + reason: "Uses legacy v13s data. Use Query.vulnerability(identifier:) for v0s advisory details." + ) "List active CVEs for workloads in all environments." cves( @@ -39140,6 +39156,9 @@ extend type Query { "Filter CVEs before pagination. Totals cover the entire filtered selection." filter: CVEFilter ): CVEConnection! + @deprecated( + reason: "Uses legacy v13s data. Use Query.vulnerabilityFindings.vulnerabilities for v0s vulnerability groups and counts." + ) } "Filter active CVEs." @@ -39179,28 +39198,54 @@ extend interface Workload { "Get vulnerability summary from given date until today." from: Date! ): ImageVulnerabilityHistory! + @deprecated(reason: "Legacy v13s vulnerability history is being retired without replacement.") "Get the mean time to fix history for a workload." vulnerabilityFixHistory(from: Date!): VulnerabilityFixHistory! + @deprecated( + reason: "Legacy v13s mean-time-to-fix history is being retired without replacement." + ) } extend enum TeamOrderField { "The accumulated risk score of the teams workloads." RISK_SCORE + @deprecated(reason: "Legacy v13s risk-score ordering is being retired without replacement.") "The accumulated number of critical vulnerabilities of the teams workloads." CRITICAL_VULNERABILITIES + @deprecated( + reason: "Legacy v13s team ordering is being retired. Read Team.vulnerabilityFindings.summary for v0s counts; no replacement team ordering is provided." + ) "The accumulated number of high vulnerabilities of the teams workloads." HIGH_VULNERABILITIES + @deprecated( + reason: "Legacy v13s team ordering is being retired. Read Team.vulnerabilityFindings.summary for v0s counts; no replacement team ordering is provided." + ) "The accumulated number of medium vulnerabilities of the teams workloads." MEDIUM_VULNERABILITIES + @deprecated( + reason: "Legacy v13s team ordering is being retired. Read Team.vulnerabilityFindings.summary for v0s counts; no replacement team ordering is provided." + ) "The accumulated number of low vulnerabilities of the teams workloads." LOW_VULNERABILITIES + @deprecated( + reason: "Legacy v13s team ordering is being retired. Read Team.vulnerabilityFindings.summary for v0s counts; no replacement team ordering is provided." + ) "The accumulated number of unassigned vulnerabilities of the teams workloads." UNASSIGNED_VULNERABILITIES + @deprecated( + reason: "Legacy v13s team ordering is being retired. Read Team.vulnerabilityFindings.summary for v0s counts; no replacement team ordering is provided." + ) "The team's software bill of materials (SBOM) coverage." SBOM_COVERAGE + @deprecated( + reason: "Legacy v13s team ordering is being retired. Read Team.vulnerabilityFindings.summary.coverage for v0s coverage; no replacement team ordering is provided." + ) "The accumulated number of known exploited vulnerabilities (KEV) of the teams workloads." KNOWN_EXPLOITED_VULNERABILITIES + @deprecated( + reason: "Legacy v13s team ordering is being retired. Read Team.vulnerabilityFindings.summary for v0s KEV counts; no replacement team ordering is provided." + ) } extend type Application { @@ -39209,9 +39254,13 @@ extend type Application { "Get vulnerability summary from given date until today." from: Date! ): ImageVulnerabilityHistory! + @deprecated(reason: "Legacy v13s vulnerability history is being retired without replacement.") "Get the mean time to fix history for an application." vulnerabilityFixHistory(from: Date!): VulnerabilityFixHistory! + @deprecated( + reason: "Legacy v13s mean-time-to-fix history is being retired without replacement." + ) } extend type Job { @@ -39220,9 +39269,13 @@ extend type Job { "Get vulnerability summary from given date until today." from: Date! ): ImageVulnerabilityHistory! + @deprecated(reason: "Legacy v13s vulnerability history is being retired without replacement.") "Get the mean time to fix history for a job." vulnerabilityFixHistory(from: Date!): VulnerabilityFixHistory! + @deprecated( + reason: "Legacy v13s mean-time-to-fix history is being retired without replacement." + ) } extend type Team { @@ -39231,9 +39284,13 @@ extend type Team { "Get vulnerability summary from given date until today." from: Date! ): ImageVulnerabilityHistory! + @deprecated(reason: "Legacy v13s vulnerability history is being retired without replacement.") "Get the mean time to fix history for a team." vulnerabilityFixHistory(from: Date!): VulnerabilityFixHistory! + @deprecated( + reason: "Legacy v13s mean-time-to-fix history is being retired without replacement." + ) } type ImageVulnerabilityHistory { @@ -39242,8 +39299,8 @@ type ImageVulnerabilityHistory { } """ -SBOM metadata for a container image, including pipeline status and processing -information. This type is accessed through ContainerImage.sbom. +Legacy v13s SBOM metadata for a container image. Use Workload.vulnerabilityCoverage +for v0s scan coverage; processing-start timestamps have no replacement. """ type ContainerImageSBOM implements Node { "The globally unique ID of the container image SBOM node." @@ -39251,23 +39308,34 @@ type ContainerImageSBOM implements Node { "The SBOM pipeline status." status: SBOMStatus! + @deprecated( + reason: "Uses legacy v13s pipeline status. Use Workload.vulnerabilityCoverage.status for v0s scan coverage; statuses are not equivalent." + ) """ The timestamp when SBOM processing started for this image. Useful as a progress indicator when status is PROCESSING. """ processingStartedAt: Time + @deprecated( + reason: "Legacy v13s processing-start timestamps are being retired without replacement." + ) } extend type ContainerImage { "SBOM pipeline status and processing information for this image." sbom: ContainerImageSBOM! + @deprecated( + reason: "Uses legacy v13s pipeline metadata. Use Workload.vulnerabilityCoverage for v0s scan coverage; statuses are not equivalent." + ) """ Whether the image has a software bill of materials (SBOM) attached to it. """ hasSBOM: Boolean! - @deprecated(reason: "Use sbom { status } == READY to check if an SBOM is attached.") + @deprecated( + reason: "Uses legacy v13s SBOM status. Use Workload.vulnerabilityCoverage for v0s scan coverage; missing scan data does not mean a clean image." + ) "Get the vulnerabilities of the image." vulnerabilities( @@ -39289,9 +39357,15 @@ extend type ContainerImage { "Ordering options for items returned from the connection." orderBy: ImageVulnerabilityOrder ): ImageVulnerabilityConnection! + @deprecated( + reason: "Uses legacy v13s image findings. Use Workload.vulnerabilityFindings for v0s findings and workload-specific assessments." + ) "Get the summary of the vulnerabilities of the image." vulnerabilitySummary: ImageVulnerabilitySummary + @deprecated( + reason: "Uses legacy v13s image counts. Use Workload.vulnerabilityOverview for v0s counts and coverage; counting semantics differ." + ) "Workloads using this container image." workloadReferences( @@ -39307,13 +39381,20 @@ extend type ContainerImage { "Get items before this cursor." before: Cursor ): ContainerImageWorkloadReferenceConnection! + @deprecated( + reason: "Uses legacy v13s image inventory. Use Team.workloads and inspect each workload's image for current image references." + ) } extend type Team { + "Get the legacy vulnerability summary for the team." vulnerabilitySummary( "Filter the aggregate by environment, priority, KEV or user labels." filter: TeamVulnerabilitySummaryFilter ): TeamVulnerabilitySummary! + @deprecated( + reason: "Uses legacy v13s data. Use Team.vulnerabilityFindings.summary for v0s counts and coverage; counting semantics differ." + ) "Fetch vulnerability summaries for workloads in the team." vulnerabilitySummaries( @@ -39335,6 +39416,9 @@ extend type Team { "Ordering options for items returned from the connection." orderBy: VulnerabilitySummaryOrder ): WorkloadVulnerabilitySummaryConnection! + @deprecated( + reason: "Uses legacy v13s data. Use Team.workloads with Workload.vulnerabilityOverview for v0s counts and coverage." + ) } type WorkloadVulnerabilitySummaryConnection { @@ -39456,6 +39540,7 @@ type ImageVulnerabilitySummary { "Risk score of the image." riskScore: Int! + @deprecated(reason: "Legacy v13s risk scores are being retired without replacement.") "Vulnerability counts grouped by severity." countsBySeverity: ImageVulnerabilitySummaryCountsBySeverity! @@ -39626,6 +39711,7 @@ type ContainerImageWorkloadReference { workload: Workload! } +"A legacy v13s image finding. Use VulnerabilityFinding for workload-specific v0s findings." type ImageVulnerability implements Node { "The globally unique ID of the image vulnerability node." id: ID! @@ -39693,6 +39779,7 @@ enum CVEPriority { MONITOR } +"Legacy v13s advisory data. Use Vulnerability and VulnerabilityOverview for v0s data." type CVE implements Node { "The globally unique ID of the CVE." id: ID! @@ -39753,6 +39840,9 @@ type CVE implements Node { "Order all matching findings before pagination. Defaults to team ascending." orderBy: CVEWorkloadOrder ): WorkloadWithVulnerabilityConnection! + @deprecated( + reason: "Uses legacy v13s findings. Use vulnerabilityFindings filtered by vulnerabilityIdentifiers, with affectedWorkloads for distinct workloads or nodes for package findings." + ) } "Ordering options for workloads affected by a CVE." @@ -39899,6 +39989,7 @@ enum ImageVulnerabilityOrderField { PRIORITY } +"A legacy v13s workload summary. Use Workload.vulnerabilityOverview for v0s data." type WorkloadVulnerabilitySummary implements Node { "The globally unique ID of the workload vulnerability summary node." id: ID! @@ -39908,7 +39999,9 @@ type WorkloadVulnerabilitySummary implements Node { "True if the workload has a software bill of materials (SBOM) attached." hasSBOM: Boolean! - @deprecated(reason: "Use workload { image { sbom { status } } } to check SBOM status.") + @deprecated( + reason: "Uses legacy v13s SBOM status. Use Workload.vulnerabilityCoverage for v0s scan coverage; statuses are not equivalent." + ) "The vulnerability summary for the workload." summary: ImageVulnerabilitySummary! @@ -39997,6 +40090,9 @@ extend input TeamFilter { finding count descending, then slug ascending. Missing summaries produce an error. """ vulnerabilityPriorityGroup: TeamVulnerabilityPriorityGroup + @deprecated( + reason: "Legacy v13s operational-priority filtering is being retired without replacement." + ) } "Mutually exclusive groups based on the highest operational vulnerability priority." @@ -40014,6 +40110,7 @@ enum TeamVulnerabilityPriorityGroup { type TenantVulnerabilitySummary { "Risk score of the tenant." riskScore: Int! + @deprecated(reason: "Legacy v13s risk scores are being retired without replacement.") "Vulnerability counts grouped by severity." countsBySeverity: ImageVulnerabilitySummaryCountsBySeverity! @@ -40049,6 +40146,7 @@ type TenantVulnerabilitySummary { type TeamVulnerabilitySummary { "Risk score of the team." riskScore: Int! + @deprecated(reason: "Legacy v13s risk scores are being retired without replacement.") "Vulnerability counts grouped by severity." countsBySeverity: ImageVulnerabilitySummaryCountsBySeverity! @@ -40112,6 +40210,7 @@ type TeamVulnerabilitySummary { "Trend of vulnerability status for the whole team. Not affected by the vulnerabilitySummary filter." riskScoreTrend: TeamVulnerabilityRiskScoreTrend! + @deprecated(reason: "Legacy v13s risk-score trends are being retired without replacement.") } enum TeamVulnerabilityRiskScoreTrend { @@ -40126,20 +40225,42 @@ enum TeamVulnerabilityRiskScoreTrend { extend enum WorkloadOrderField { "Order by risk score" VULNERABILITY_RISK_SCORE + @deprecated(reason: "Legacy v13s risk-score ordering is being retired without replacement.") "Order apps by vulnerability severity critical" VULNERABILITY_SEVERITY_CRITICAL + @deprecated( + reason: "Legacy v13s finding-count ordering. Use VULNERABILITY_UNIQUE_CRITICAL for v0s unique-vulnerability ordering; counting semantics differ." + ) "Order apps by vulnerability severity high" VULNERABILITY_SEVERITY_HIGH + @deprecated( + reason: "Legacy v13s finding-count ordering. Use VULNERABILITY_UNIQUE_HIGH for v0s unique-vulnerability ordering; counting semantics differ." + ) "Order apps by vulnerability severity medium" VULNERABILITY_SEVERITY_MEDIUM + @deprecated( + reason: "Legacy v13s finding-count ordering. Use VULNERABILITY_UNIQUE_MEDIUM for v0s unique-vulnerability ordering; counting semantics differ." + ) "Order apps by vulnerability severity low" VULNERABILITY_SEVERITY_LOW + @deprecated( + reason: "Legacy v13s finding-count ordering. Use VULNERABILITY_UNIQUE_LOW for v0s unique-vulnerability ordering; counting semantics differ." + ) "Order apps by vulnerability severity unassigned" VULNERABILITY_SEVERITY_UNASSIGNED + @deprecated( + reason: "Legacy v13s finding-count ordering. Use VULNERABILITY_UNIQUE_UNKNOWN for v0s unique-vulnerability ordering; counting semantics differ." + ) "Order by whether the workload has a software bill of materials (SBOM)" HAS_SBOM + @deprecated( + reason: "Legacy v13s SBOM ordering is being retired without replacement. Read Workload.vulnerabilityCoverage or filter with TeamWorkloadsFilter.vulnerabilityCoverageStatuses." + ) "Order by the last time the vulnerabilities were scanned." VULNERABILITY_LAST_SCANNED + @deprecated( + reason: "Legacy v13s scan-time ordering is being retired without replacement. Read Workload.vulnerabilityCoverage.scannedAt for the v0s scan time." + ) } type ImageVulnerabilitySuppression { @@ -41443,6 +41564,9 @@ input TeamWorkloadsFilter { Only return workloads with the given SBOM pipeline status. """ sbomStatus: SBOMStatus + @deprecated( + reason: "Uses legacy v13s pipeline status. Use vulnerabilityCoverageStatuses for v0s scan coverage; statuses are not equivalent." + ) "Only return workloads with one of these vulnerability scan statuses." vulnerabilityCoverageStatuses: [VulnerabilityCoverageStatus!] diff --git a/internal/graph/schema/v0s.graphqls b/internal/graph/schema/v0s.graphqls index 4accae3e6..60123c4ac 100644 --- a/internal/graph/schema/v0s.graphqls +++ b/internal/graph/schema/v0s.graphqls @@ -724,12 +724,12 @@ type DeleteVulnerabilitySuppressionsPayload { } extend type Mutation { - "Set workload assessments atomically. Until assessment writes are enabled, use updateImageVulnerability." + "Set workload assessments atomically. Requires assessment migration and enabled v0s writes for the tenant. Do not combine v0s reads with legacy assessment writes." setVulnerabilitySuppressions( "The team and assessments to update." input: SetVulnerabilitySuppressionsInput! ): SetVulnerabilitySuppressionsPayload! - "Delete workload assessments atomically. Until assessment writes are enabled, use updateImageVulnerability." + "Delete workload assessments atomically. Requires assessment migration and enabled v0s writes for the tenant. Do not combine v0s reads with legacy assessment writes." deleteVulnerabilitySuppressions( "The team and assessments to delete." input: DeleteVulnerabilitySuppressionsInput! diff --git a/internal/graph/schema/vulnerability.graphqls b/internal/graph/schema/vulnerability.graphqls index b1fa8960a..ed7858eab 100644 --- a/internal/graph/schema/vulnerability.graphqls +++ b/internal/graph/schema/vulnerability.graphqls @@ -4,6 +4,9 @@ extend type Mutation { This mutation is currently unstable and may change in the future. """ updateImageVulnerability(input: UpdateImageVulnerabilityInput!): UpdateImageVulnerabilityPayload! + @deprecated( + reason: "Uses legacy v13s assessments. Use setVulnerabilitySuppressions and deleteVulnerabilitySuppressions only after assessments are migrated and v0s writes are enabled for the tenant." + ) } extend type Query { @@ -12,12 +15,16 @@ extend type Query { "Get vulnerability summary from given date until today." from: Date! ): ImageVulnerabilityHistory! + @deprecated(reason: "Legacy v13s vulnerability history is being retired without replacement.") "Get the vulnerability summary for the tenant." vulnerabilitySummary( "Filter the aggregate." filter: TenantVulnerabilitySummaryFilter ): TenantVulnerabilitySummary! + @deprecated( + reason: "Uses legacy v13s data. Use Query.vulnerabilityFindings.summary for v0s counts and coverage; counting semantics differ." + ) "List per-workload vulnerability summaries across all teams." vulnerabilitySummaries( @@ -39,12 +46,21 @@ extend type Query { "Order workload vulnerability summaries across all teams." orderBy: VulnerabilitySummaryOrder ): WorkloadVulnerabilitySummaryConnection! + @deprecated( + reason: "Uses legacy v13s data. Use Query.vulnerabilityFindings.affectedWorkloads with Workload.vulnerabilityOverview for affected workloads, or Team.workloads for the complete inventory." + ) "Get the mean time to fix history for all teams." vulnerabilityFixHistory(from: Date!): VulnerabilityFixHistory! + @deprecated( + reason: "Legacy v13s mean-time-to-fix history is being retired without replacement." + ) "Get a specific CVE by its identifier." cve(identifier: String!): CVE! + @deprecated( + reason: "Uses legacy v13s data. Use Query.vulnerability(identifier:) for v0s advisory details." + ) "List active CVEs for workloads in all environments." cves( @@ -66,6 +82,9 @@ extend type Query { "Filter CVEs before pagination. Totals cover the entire filtered selection." filter: CVEFilter ): CVEConnection! + @deprecated( + reason: "Uses legacy v13s data. Use Query.vulnerabilityFindings.vulnerabilities for v0s vulnerability groups and counts." + ) } "Filter active CVEs." @@ -105,28 +124,54 @@ extend interface Workload { "Get vulnerability summary from given date until today." from: Date! ): ImageVulnerabilityHistory! + @deprecated(reason: "Legacy v13s vulnerability history is being retired without replacement.") "Get the mean time to fix history for a workload." vulnerabilityFixHistory(from: Date!): VulnerabilityFixHistory! + @deprecated( + reason: "Legacy v13s mean-time-to-fix history is being retired without replacement." + ) } extend enum TeamOrderField { "The accumulated risk score of the teams workloads." RISK_SCORE + @deprecated(reason: "Legacy v13s risk-score ordering is being retired without replacement.") "The accumulated number of critical vulnerabilities of the teams workloads." CRITICAL_VULNERABILITIES + @deprecated( + reason: "Legacy v13s team ordering is being retired. Read Team.vulnerabilityFindings.summary for v0s counts; no replacement team ordering is provided." + ) "The accumulated number of high vulnerabilities of the teams workloads." HIGH_VULNERABILITIES + @deprecated( + reason: "Legacy v13s team ordering is being retired. Read Team.vulnerabilityFindings.summary for v0s counts; no replacement team ordering is provided." + ) "The accumulated number of medium vulnerabilities of the teams workloads." MEDIUM_VULNERABILITIES + @deprecated( + reason: "Legacy v13s team ordering is being retired. Read Team.vulnerabilityFindings.summary for v0s counts; no replacement team ordering is provided." + ) "The accumulated number of low vulnerabilities of the teams workloads." LOW_VULNERABILITIES + @deprecated( + reason: "Legacy v13s team ordering is being retired. Read Team.vulnerabilityFindings.summary for v0s counts; no replacement team ordering is provided." + ) "The accumulated number of unassigned vulnerabilities of the teams workloads." UNASSIGNED_VULNERABILITIES + @deprecated( + reason: "Legacy v13s team ordering is being retired. Read Team.vulnerabilityFindings.summary for v0s counts; no replacement team ordering is provided." + ) "The team's software bill of materials (SBOM) coverage." SBOM_COVERAGE + @deprecated( + reason: "Legacy v13s team ordering is being retired. Read Team.vulnerabilityFindings.summary.coverage for v0s coverage; no replacement team ordering is provided." + ) "The accumulated number of known exploited vulnerabilities (KEV) of the teams workloads." KNOWN_EXPLOITED_VULNERABILITIES + @deprecated( + reason: "Legacy v13s team ordering is being retired. Read Team.vulnerabilityFindings.summary for v0s KEV counts; no replacement team ordering is provided." + ) } extend type Application { @@ -135,9 +180,13 @@ extend type Application { "Get vulnerability summary from given date until today." from: Date! ): ImageVulnerabilityHistory! + @deprecated(reason: "Legacy v13s vulnerability history is being retired without replacement.") "Get the mean time to fix history for an application." vulnerabilityFixHistory(from: Date!): VulnerabilityFixHistory! + @deprecated( + reason: "Legacy v13s mean-time-to-fix history is being retired without replacement." + ) } extend type Job { @@ -146,9 +195,13 @@ extend type Job { "Get vulnerability summary from given date until today." from: Date! ): ImageVulnerabilityHistory! + @deprecated(reason: "Legacy v13s vulnerability history is being retired without replacement.") "Get the mean time to fix history for a job." vulnerabilityFixHistory(from: Date!): VulnerabilityFixHistory! + @deprecated( + reason: "Legacy v13s mean-time-to-fix history is being retired without replacement." + ) } extend type Team { @@ -157,9 +210,13 @@ extend type Team { "Get vulnerability summary from given date until today." from: Date! ): ImageVulnerabilityHistory! + @deprecated(reason: "Legacy v13s vulnerability history is being retired without replacement.") "Get the mean time to fix history for a team." vulnerabilityFixHistory(from: Date!): VulnerabilityFixHistory! + @deprecated( + reason: "Legacy v13s mean-time-to-fix history is being retired without replacement." + ) } type ImageVulnerabilityHistory { @@ -168,8 +225,8 @@ type ImageVulnerabilityHistory { } """ -SBOM metadata for a container image, including pipeline status and processing -information. This type is accessed through ContainerImage.sbom. +Legacy v13s SBOM metadata for a container image. Use Workload.vulnerabilityCoverage +for v0s scan coverage; processing-start timestamps have no replacement. """ type ContainerImageSBOM implements Node { "The globally unique ID of the container image SBOM node." @@ -177,23 +234,34 @@ type ContainerImageSBOM implements Node { "The SBOM pipeline status." status: SBOMStatus! + @deprecated( + reason: "Uses legacy v13s pipeline status. Use Workload.vulnerabilityCoverage.status for v0s scan coverage; statuses are not equivalent." + ) """ The timestamp when SBOM processing started for this image. Useful as a progress indicator when status is PROCESSING. """ processingStartedAt: Time + @deprecated( + reason: "Legacy v13s processing-start timestamps are being retired without replacement." + ) } extend type ContainerImage { "SBOM pipeline status and processing information for this image." sbom: ContainerImageSBOM! + @deprecated( + reason: "Uses legacy v13s pipeline metadata. Use Workload.vulnerabilityCoverage for v0s scan coverage; statuses are not equivalent." + ) """ Whether the image has a software bill of materials (SBOM) attached to it. """ hasSBOM: Boolean! - @deprecated(reason: "Use sbom { status } == READY to check if an SBOM is attached.") + @deprecated( + reason: "Uses legacy v13s SBOM status. Use Workload.vulnerabilityCoverage for v0s scan coverage; missing scan data does not mean a clean image." + ) "Get the vulnerabilities of the image." vulnerabilities( @@ -215,9 +283,15 @@ extend type ContainerImage { "Ordering options for items returned from the connection." orderBy: ImageVulnerabilityOrder ): ImageVulnerabilityConnection! + @deprecated( + reason: "Uses legacy v13s image findings. Use Workload.vulnerabilityFindings for v0s findings and workload-specific assessments." + ) "Get the summary of the vulnerabilities of the image." vulnerabilitySummary: ImageVulnerabilitySummary + @deprecated( + reason: "Uses legacy v13s image counts. Use Workload.vulnerabilityOverview for v0s counts and coverage; counting semantics differ." + ) "Workloads using this container image." workloadReferences( @@ -233,13 +307,20 @@ extend type ContainerImage { "Get items before this cursor." before: Cursor ): ContainerImageWorkloadReferenceConnection! + @deprecated( + reason: "Uses legacy v13s image inventory. Use Team.workloads and inspect each workload's image for current image references." + ) } extend type Team { + "Get the legacy vulnerability summary for the team." vulnerabilitySummary( "Filter the aggregate by environment, priority, KEV or user labels." filter: TeamVulnerabilitySummaryFilter ): TeamVulnerabilitySummary! + @deprecated( + reason: "Uses legacy v13s data. Use Team.vulnerabilityFindings.summary for v0s counts and coverage; counting semantics differ." + ) "Fetch vulnerability summaries for workloads in the team." vulnerabilitySummaries( @@ -261,6 +342,9 @@ extend type Team { "Ordering options for items returned from the connection." orderBy: VulnerabilitySummaryOrder ): WorkloadVulnerabilitySummaryConnection! + @deprecated( + reason: "Uses legacy v13s data. Use Team.workloads with Workload.vulnerabilityOverview for v0s counts and coverage." + ) } type WorkloadVulnerabilitySummaryConnection { @@ -382,6 +466,7 @@ type ImageVulnerabilitySummary { "Risk score of the image." riskScore: Int! + @deprecated(reason: "Legacy v13s risk scores are being retired without replacement.") "Vulnerability counts grouped by severity." countsBySeverity: ImageVulnerabilitySummaryCountsBySeverity! @@ -552,6 +637,7 @@ type ContainerImageWorkloadReference { workload: Workload! } +"A legacy v13s image finding. Use VulnerabilityFinding for workload-specific v0s findings." type ImageVulnerability implements Node { "The globally unique ID of the image vulnerability node." id: ID! @@ -619,6 +705,7 @@ enum CVEPriority { MONITOR } +"Legacy v13s advisory data. Use Vulnerability and VulnerabilityOverview for v0s data." type CVE implements Node { "The globally unique ID of the CVE." id: ID! @@ -679,6 +766,9 @@ type CVE implements Node { "Order all matching findings before pagination. Defaults to team ascending." orderBy: CVEWorkloadOrder ): WorkloadWithVulnerabilityConnection! + @deprecated( + reason: "Uses legacy v13s findings. Use vulnerabilityFindings filtered by vulnerabilityIdentifiers, with affectedWorkloads for distinct workloads or nodes for package findings." + ) } "Ordering options for workloads affected by a CVE." @@ -825,6 +915,7 @@ enum ImageVulnerabilityOrderField { PRIORITY } +"A legacy v13s workload summary. Use Workload.vulnerabilityOverview for v0s data." type WorkloadVulnerabilitySummary implements Node { "The globally unique ID of the workload vulnerability summary node." id: ID! @@ -834,7 +925,9 @@ type WorkloadVulnerabilitySummary implements Node { "True if the workload has a software bill of materials (SBOM) attached." hasSBOM: Boolean! - @deprecated(reason: "Use workload { image { sbom { status } } } to check SBOM status.") + @deprecated( + reason: "Uses legacy v13s SBOM status. Use Workload.vulnerabilityCoverage for v0s scan coverage; statuses are not equivalent." + ) "The vulnerability summary for the workload." summary: ImageVulnerabilitySummary! @@ -923,6 +1016,9 @@ extend input TeamFilter { finding count descending, then slug ascending. Missing summaries produce an error. """ vulnerabilityPriorityGroup: TeamVulnerabilityPriorityGroup + @deprecated( + reason: "Legacy v13s operational-priority filtering is being retired without replacement." + ) } "Mutually exclusive groups based on the highest operational vulnerability priority." @@ -940,6 +1036,7 @@ enum TeamVulnerabilityPriorityGroup { type TenantVulnerabilitySummary { "Risk score of the tenant." riskScore: Int! + @deprecated(reason: "Legacy v13s risk scores are being retired without replacement.") "Vulnerability counts grouped by severity." countsBySeverity: ImageVulnerabilitySummaryCountsBySeverity! @@ -975,6 +1072,7 @@ type TenantVulnerabilitySummary { type TeamVulnerabilitySummary { "Risk score of the team." riskScore: Int! + @deprecated(reason: "Legacy v13s risk scores are being retired without replacement.") "Vulnerability counts grouped by severity." countsBySeverity: ImageVulnerabilitySummaryCountsBySeverity! @@ -1038,6 +1136,7 @@ type TeamVulnerabilitySummary { "Trend of vulnerability status for the whole team. Not affected by the vulnerabilitySummary filter." riskScoreTrend: TeamVulnerabilityRiskScoreTrend! + @deprecated(reason: "Legacy v13s risk-score trends are being retired without replacement.") } enum TeamVulnerabilityRiskScoreTrend { @@ -1052,20 +1151,42 @@ enum TeamVulnerabilityRiskScoreTrend { extend enum WorkloadOrderField { "Order by risk score" VULNERABILITY_RISK_SCORE + @deprecated(reason: "Legacy v13s risk-score ordering is being retired without replacement.") "Order apps by vulnerability severity critical" VULNERABILITY_SEVERITY_CRITICAL + @deprecated( + reason: "Legacy v13s finding-count ordering. Use VULNERABILITY_UNIQUE_CRITICAL for v0s unique-vulnerability ordering; counting semantics differ." + ) "Order apps by vulnerability severity high" VULNERABILITY_SEVERITY_HIGH + @deprecated( + reason: "Legacy v13s finding-count ordering. Use VULNERABILITY_UNIQUE_HIGH for v0s unique-vulnerability ordering; counting semantics differ." + ) "Order apps by vulnerability severity medium" VULNERABILITY_SEVERITY_MEDIUM + @deprecated( + reason: "Legacy v13s finding-count ordering. Use VULNERABILITY_UNIQUE_MEDIUM for v0s unique-vulnerability ordering; counting semantics differ." + ) "Order apps by vulnerability severity low" VULNERABILITY_SEVERITY_LOW + @deprecated( + reason: "Legacy v13s finding-count ordering. Use VULNERABILITY_UNIQUE_LOW for v0s unique-vulnerability ordering; counting semantics differ." + ) "Order apps by vulnerability severity unassigned" VULNERABILITY_SEVERITY_UNASSIGNED + @deprecated( + reason: "Legacy v13s finding-count ordering. Use VULNERABILITY_UNIQUE_UNKNOWN for v0s unique-vulnerability ordering; counting semantics differ." + ) "Order by whether the workload has a software bill of materials (SBOM)" HAS_SBOM + @deprecated( + reason: "Legacy v13s SBOM ordering is being retired without replacement. Read Workload.vulnerabilityCoverage or filter with TeamWorkloadsFilter.vulnerabilityCoverageStatuses." + ) "Order by the last time the vulnerabilities were scanned." VULNERABILITY_LAST_SCANNED + @deprecated( + reason: "Legacy v13s scan-time ordering is being retired without replacement. Read Workload.vulnerabilityCoverage.scannedAt for the v0s scan time." + ) } type ImageVulnerabilitySuppression { diff --git a/internal/graph/schema/workloads.graphqls b/internal/graph/schema/workloads.graphqls index c99ee6ed6..7ef5111b1 100644 --- a/internal/graph/schema/workloads.graphqls +++ b/internal/graph/schema/workloads.graphqls @@ -502,6 +502,9 @@ input TeamWorkloadsFilter { Only return workloads with the given SBOM pipeline status. """ sbomStatus: SBOMStatus + @deprecated( + reason: "Uses legacy v13s pipeline status. Use vulnerabilityCoverageStatuses for v0s scan coverage; statuses are not equivalent." + ) "Only return workloads with one of these vulnerability scan statuses." vulnerabilityCoverageStatuses: [VulnerabilityCoverageStatus!] diff --git a/internal/graph/vulnerability_filter_test.go b/internal/graph/vulnerability_filter_test.go index 15b19a4df..2bb3e6108 100644 --- a/internal/graph/vulnerability_filter_test.go +++ b/internal/graph/vulnerability_filter_test.go @@ -26,6 +26,107 @@ type labelFilterScopeCase struct { wantError bool } +func TestLegacyVulnerabilityDeprecations(t *testing.T) { + schema := gengql.NewExecutableSchema(gengql.Config{}).Schema() + for typeName, fields := range map[string][]string{ + "Query": {"cve", "cves", "vulnerabilitySummary", "vulnerabilitySummaries", "imageVulnerabilityHistory", "vulnerabilityFixHistory"}, + "Mutation": {"updateImageVulnerability"}, + "Team": {"vulnerabilitySummary", "vulnerabilitySummaries", "imageVulnerabilityHistory", "vulnerabilityFixHistory"}, + "Workload": {"imageVulnerabilityHistory", "vulnerabilityFixHistory"}, + "Application": {"imageVulnerabilityHistory", "vulnerabilityFixHistory"}, + "Job": {"imageVulnerabilityHistory", "vulnerabilityFixHistory"}, + "ContainerImage": {"vulnerabilities", "vulnerabilitySummary", "sbom", "hasSBOM", "workloadReferences"}, + "ContainerImageSBOM": {"status", "processingStartedAt"}, + "CVE": {"workloads"}, + "ImageVulnerabilitySummary": {"riskScore"}, + "TenantVulnerabilitySummary": {"riskScore"}, + "TeamVulnerabilitySummary": {"riskScore", "riskScoreTrend"}, + "TeamFilter": {"vulnerabilityPriorityGroup"}, + "TeamWorkloadsFilter": {"sbomStatus"}, + "WorkloadVulnerabilitySummary": {"hasSBOM"}, + } { + for _, name := range fields { + t.Run(typeName+"."+name, func(t *testing.T) { + field := schema.Types[typeName].Fields.ForName(name) + if field == nil { + t.Fatal("legacy field was removed instead of deprecated") + } + directive := field.Directives.ForName("deprecated") + if directive == nil { + t.Fatal("legacy field is not deprecated") + } + reason := directive.Arguments.ForName("reason") + if reason == nil || reason.Value.Raw == "" { + t.Fatal("deprecation has no migration reason") + } + }) + } + } + for typeName, values := range map[string][]string{ + "TeamOrderField": { + "RISK_SCORE", "CRITICAL_VULNERABILITIES", "HIGH_VULNERABILITIES", "MEDIUM_VULNERABILITIES", + "LOW_VULNERABILITIES", "UNASSIGNED_VULNERABILITIES", "SBOM_COVERAGE", "KNOWN_EXPLOITED_VULNERABILITIES", + }, + "WorkloadOrderField": { + "VULNERABILITY_RISK_SCORE", "VULNERABILITY_SEVERITY_CRITICAL", "VULNERABILITY_SEVERITY_HIGH", + "VULNERABILITY_SEVERITY_MEDIUM", "VULNERABILITY_SEVERITY_LOW", "VULNERABILITY_SEVERITY_UNASSIGNED", + "HAS_SBOM", "VULNERABILITY_LAST_SCANNED", + }, + } { + for _, name := range values { + t.Run(typeName+"."+name, func(t *testing.T) { + value := schema.Types[typeName].EnumValues.ForName(name) + if value == nil { + t.Fatal("legacy ordering was removed instead of deprecated") + } + directive := value.Directives.ForName("deprecated") + if directive == nil { + t.Fatal("legacy ordering is not deprecated") + } + reason := directive.Arguments.ForName("reason") + if reason == nil || reason.Value.Raw == "" { + t.Fatal("deprecation has no migration reason") + } + }) + } + } +} + +func TestV0sAndHistoricalActivityFieldsRemainCurrent(t *testing.T) { + schema := gengql.NewExecutableSchema(gengql.Config{}).Schema() + for typeName, fields := range map[string][]string{ + "Query": {"node", "vulnerability", "vulnerabilityFindings", "vulnerabilitySuppressions"}, + "Mutation": {"setVulnerabilitySuppressions", "deleteVulnerabilitySuppressions"}, + "Team": {"vulnerabilityFindings", "vulnerabilitySuppressions", "workloads"}, + "TeamEnvironment": {"vulnerabilityFindings", "vulnerabilitySuppressions"}, + "Workload": {"vulnerabilityFindings", "vulnerabilityCoverage", "vulnerabilityOverview"}, + "Application": {"vulnerabilityFindings", "vulnerabilityCoverage", "vulnerabilityOverview"}, + "Job": {"vulnerabilityFindings", "vulnerabilityCoverage", "vulnerabilityOverview"}, + "TeamWorkloadsFilter": {"vulnerabilityFilter", "vulnerabilityCoverageStatuses"}, + "VulnerabilityFindingConnection": {"summary", "vulnerabilities", "affectedWorkloads"}, + "VulnerabilityUpdatedActivityLogEntry": {"data"}, + "VulnerabilityActivityLogEntryData": {"identifier", "severity", "package", "previousSuppression", "newSuppression"}, + } { + for _, name := range fields { + t.Run(typeName+"."+name, func(t *testing.T) { + field := schema.Types[typeName].Fields.ForName(name) + if field == nil || field.Directives.ForName("deprecated") != nil { + t.Fatal("current or historical activity field was removed or deprecated") + } + }) + } + } + for _, name := range []string{ + "VULNERABILITY_UNIQUE_CRITICAL", "VULNERABILITY_UNIQUE_HIGH", "VULNERABILITY_UNIQUE_MEDIUM", + "VULNERABILITY_UNIQUE_LOW", "VULNERABILITY_UNIQUE_UNKNOWN", "NAME", + } { + value := schema.Types["WorkloadOrderField"].EnumValues.ForName(name) + if value == nil || value.Directives.ForName("deprecated") != nil { + t.Errorf("current workload ordering %s was removed or deprecated", name) + } + } +} + func TestVulnerabilitySummaryLabelFilterScope(t *testing.T) { schema := gengql.NewExecutableSchema(gengql.Config{}).Schema() for _, test := range []labelFilterScopeCase{