@skyhook-io/radar-app 1.22.1 → 1.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (234) hide show
  1. package/package.json +8 -8
  2. package/src/App.tsx +131 -38
  3. package/src/RadarApp.basename.test.tsx +177 -0
  4. package/src/RadarApp.settings.test.tsx +33 -0
  5. package/src/RadarApp.tsx +5 -0
  6. package/src/api/agentSandbox.ts +259 -0
  7. package/src/api/client.autoPromConnect.test.tsx +43 -0
  8. package/src/api/client.metricsRelayCheck.test.tsx +134 -0
  9. package/src/api/client.ts +128 -25
  10. package/src/api/cloudInstallDiscover.test.tsx +76 -0
  11. package/src/api/diagnose.ts +4 -0
  12. package/src/api/kagent.test.ts +82 -0
  13. package/src/api/kagent.ts +230 -0
  14. package/src/api/prometheusCharts.ts +5 -0
  15. package/src/api/radarFeatures.test.ts +9 -0
  16. package/src/api/radarFeatures.ts +13 -0
  17. package/src/api/substrateWorkspace.test.ts +72 -0
  18. package/src/api/substrateWorkspace.ts +1394 -0
  19. package/src/api/vulnerabilities.ts +207 -9
  20. package/src/api/workloadSource.test.tsx +1172 -0
  21. package/src/api/workloadSource.ts +408 -0
  22. package/src/components/APIUnreachableBanner.test.tsx +19 -0
  23. package/src/components/APIUnreachableBanner.tsx +20 -0
  24. package/src/components/CloudConnectFlow.tsx +46 -7
  25. package/src/components/CloudFunnelButton.test.tsx +193 -7
  26. package/src/components/CloudFunnelButton.tsx +127 -32
  27. package/src/components/ConnectionErrorView.test.tsx +63 -2
  28. package/src/components/ConnectionErrorView.tsx +88 -68
  29. package/src/components/SelfManagedStart.tsx +12 -2
  30. package/src/components/agentsandbox/AgentSandboxKindLists.tsx +41 -0
  31. package/src/components/agentsandbox/AgentSandboxLists.test.tsx +410 -0
  32. package/src/components/agentsandbox/AgentSandboxOverview.test.tsx +333 -0
  33. package/src/components/agentsandbox/AgentSandboxOverview.tsx +555 -0
  34. package/src/components/agentsandbox/AgentSandboxSidebar.test.tsx +97 -0
  35. package/src/components/agentsandbox/AgentSandboxSummary.test.tsx +439 -0
  36. package/src/components/agentsandbox/AgentSandboxSummary.tsx +956 -0
  37. package/src/components/agentsandbox/AgentSandboxTables.tsx +966 -0
  38. package/src/components/agentsandbox/AgentSandboxView.tsx +34 -0
  39. package/src/components/agentsandbox/agentsandbox.fixtures.ts +135 -0
  40. package/src/components/agentsandbox/data.ts +135 -0
  41. package/src/components/agentsandbox/host.test.ts +27 -0
  42. package/src/components/agentsandbox/host.tsx +85 -0
  43. package/src/components/agentsandbox/labels.test.ts +42 -0
  44. package/src/components/agentsandbox/labels.ts +146 -0
  45. package/src/components/agentsandbox/listFilters.ts +85 -0
  46. package/src/components/agentsandbox/lists.ts +52 -0
  47. package/src/components/agentsandbox/routes.ts +23 -0
  48. package/src/components/agentsandbox/shared.tsx +321 -0
  49. package/src/components/agentsandbox/useAgentSandboxSidebarWorkspace.ts +69 -0
  50. package/src/components/agentsandbox/workspace.fixtures.ts +125 -0
  51. package/src/components/agentsandbox/workspace.tsx +258 -0
  52. package/src/components/agentsandbox/workspaceRoute.ts +18 -0
  53. package/src/components/applications/ApplicationsView.openResource.test.tsx +248 -3
  54. package/src/components/applications/ApplicationsView.tsx +156 -3
  55. package/src/components/audit/VulnerabilitiesColumns.test.tsx +487 -0
  56. package/src/components/audit/VulnerabilitiesRisk.test.tsx +318 -0
  57. package/src/components/audit/VulnerabilitiesView.test.tsx +458 -13
  58. package/src/components/audit/VulnerabilitiesView.tsx +639 -199
  59. package/src/components/cloudHints/AgentSetupCloudRow.tsx +28 -0
  60. package/src/components/cloudHints/CloudHintLink.tsx +29 -0
  61. package/src/components/cloudHints/SharedInstallAiLine.tsx +36 -0
  62. package/src/components/cloudHints/cloudHints.test.ts +126 -0
  63. package/src/components/cloudHints/cloudHints.ts +131 -0
  64. package/src/components/cloudHints/cloudHintsGate.test.tsx +70 -0
  65. package/src/components/cloudHints/cloudLinks.test.ts +52 -0
  66. package/src/components/cloudHints/cloudLinks.ts +31 -0
  67. package/src/components/cloudHints/hintStorage.ts +28 -0
  68. package/src/components/cnpg/CNPGView.tsx +4 -7
  69. package/src/components/diagnose/ActivityTurn.tsx +6 -4
  70. package/src/components/diagnose/AgentSetupNotice.tsx +5 -0
  71. package/src/components/diagnose/AssessmentCard.tsx +1 -2
  72. package/src/components/diagnose/ContinueInAgentButton.test.tsx +7 -0
  73. package/src/components/diagnose/DiagnoseContext.tsx +7 -0
  74. package/src/components/diagnose/DiagnoseSurface.escape.test.tsx +215 -0
  75. package/src/components/diagnose/DiagnoseSurface.tsx +57 -1
  76. package/src/components/diagnose/Home.test.tsx +6 -0
  77. package/src/components/diagnose/Home.tsx +10 -3
  78. package/src/components/diagnose/InvestigationEvidencePane.story.test.tsx +1 -1
  79. package/src/components/diagnose/InvestigationEvidencePane.tsx +19 -2
  80. package/src/components/diagnose/InvestigationFindingsFooter.test.tsx +413 -0
  81. package/src/components/diagnose/InvestigationView.tsx +120 -23
  82. package/src/components/diagnose/investigationEvidence/identity.test.ts +1 -1
  83. package/src/components/diagnose/investigationEvidence/projection.test.ts +1 -1
  84. package/src/components/diagnose/investigationState.ts +9 -0
  85. package/src/components/diagnose/parts.test.tsx +11 -3
  86. package/src/components/diagnose/toolCallLabel.ts +3 -0
  87. package/src/components/gitops/RemoteDestinationCloudHint.tsx +6 -14
  88. package/src/components/home/ActivitySummary.tsx +3 -8
  89. package/src/components/home/ClusterHealthCard.tsx +91 -17
  90. package/src/components/home/ClusterHealthCard.utilization.test.tsx +187 -0
  91. package/src/components/home/HomeAgentBlock.tsx +2 -0
  92. package/src/components/home/HomeView.tsx +9 -29
  93. package/src/components/home/MCPSetupDialog.test.tsx +9 -0
  94. package/src/components/home/MCPSetupDialog.tsx +6 -2
  95. package/src/components/home/McpCloudLine.test.tsx +162 -0
  96. package/src/components/home/McpCloudLine.tsx +95 -0
  97. package/src/components/home/ProblemsPanel.investigate.test.tsx +2 -2
  98. package/src/components/home/TopologyPreview.test.tsx +31 -30
  99. package/src/components/home/TopologyPreview.tsx +19 -28
  100. package/src/components/home/mcpToolCatalog.test.ts +10 -0
  101. package/src/components/home/mcpToolCatalog.ts +7 -7
  102. package/src/components/issues/ClusterSchedulingBlockerRow.tsx +35 -0
  103. package/src/components/issues/IssuesPane.render.test.tsx +36 -1
  104. package/src/components/issues/IssuesPane.tsx +181 -23
  105. package/src/components/issues/SinceLastVisitRow.render.test.tsx +302 -0
  106. package/src/components/issues/SinceLastVisitRow.tsx +71 -0
  107. package/src/components/issues/sinceLastVisit.test.ts +266 -0
  108. package/src/components/issues/sinceLastVisit.ts +439 -0
  109. package/src/components/kagent/KagentAgentRenderer.test.ts +32 -0
  110. package/src/components/kagent/KagentAgentRenderer.tsx +87 -0
  111. package/src/components/kagent/KagentAgentSessions.test.tsx +166 -0
  112. package/src/components/kagent/KagentAgentSessions.tsx +124 -0
  113. package/src/components/kagent/KagentDetailPage.tsx +106 -0
  114. package/src/components/kagent/KagentLists.tsx +412 -0
  115. package/src/components/kagent/KagentOverview.tsx +234 -0
  116. package/src/components/kagent/KagentPages.tsx +690 -0
  117. package/src/components/kagent/KagentRuntimeTabs.test.tsx +219 -0
  118. package/src/components/kagent/KagentRuntimeTabs.tsx +283 -0
  119. package/src/components/kagent/KagentSidebar.test.tsx +112 -0
  120. package/src/components/kagent/KagentView.tsx +109 -0
  121. package/src/components/kagent/KagentWorkspace.test.tsx +876 -0
  122. package/src/components/kagent/host.tsx +144 -0
  123. package/src/components/kagent/routes.ts +31 -0
  124. package/src/components/kagent/shared.tsx +336 -0
  125. package/src/components/kagent/useKagentRuntime.test.tsx +77 -0
  126. package/src/components/kagent/useKagentSidebarWorkspace.ts +67 -0
  127. package/src/components/kagent/workspace.fixtures.ts +108 -0
  128. package/src/components/kagent/workspaceRoute.ts +18 -0
  129. package/src/components/resource/MetricsNotConnected.test.tsx +28 -0
  130. package/src/components/resource/MetricsNotConnected.tsx +10 -7
  131. package/src/components/resource/PrometheusCharts.tsx +10 -1
  132. package/src/components/resource/PrometheusChartsGrid.render.test.tsx +9 -0
  133. package/src/components/resource/PrometheusChartsGrid.tsx +3 -3
  134. package/src/components/resource/SubstrateHealthCharts.test.tsx +13 -1
  135. package/src/components/resource/SubstrateHealthCharts.tsx +9 -15
  136. package/src/components/resources/ResourceDetailDrawer.tsx +1 -0
  137. package/src/components/resources/ResourcesView.tsx +2 -6
  138. package/src/components/resources/renderers/JobAdmissionRenderers.tsx +5 -4
  139. package/src/components/resources/renderers/PodRenderer.tsx +8 -2
  140. package/src/components/resources/renderers/RolloutRenderer.tsx +4 -1
  141. package/src/components/resources/renderers/WorkloadRenderer.tsx +4 -1
  142. package/src/components/settings/LocalIntegrationStatus.test.tsx +1 -0
  143. package/src/components/settings/LocalIntegrationStatus.tsx +3 -2
  144. package/src/components/settings/SettingsDialog.tsx +84 -16
  145. package/src/components/settings/SubstrateSettings.lifecycle.test.tsx +210 -0
  146. package/src/components/settings/SubstrateSettings.test.tsx +131 -0
  147. package/src/components/settings/SubstrateSettings.tsx +544 -0
  148. package/src/components/settings/settings-state.test.ts +21 -3
  149. package/src/components/settings/settings-state.ts +13 -3
  150. package/src/components/share/ShareLinkButton.test.tsx +360 -0
  151. package/src/components/share/ShareLinkButton.tsx +391 -0
  152. package/src/components/share/openShareInCloud.test.ts +29 -0
  153. package/src/components/share/openShareInCloud.ts +10 -0
  154. package/src/components/share/shareLink.test.ts +129 -0
  155. package/src/components/share/shareLink.ts +175 -0
  156. package/src/components/substrate/SubstrateActorDrawer.tsx +87 -0
  157. package/src/components/substrate/SubstrateActorOverview.tsx +489 -0
  158. package/src/components/substrate/SubstrateActorPage.tsx +384 -0
  159. package/src/components/substrate/SubstrateActors.test.tsx +1094 -0
  160. package/src/components/substrate/SubstrateActors.tsx +612 -0
  161. package/src/components/substrate/SubstrateAttentionList.tsx +441 -0
  162. package/src/components/substrate/SubstrateConnect.tsx +88 -0
  163. package/src/components/substrate/SubstrateOverview.test.tsx +396 -0
  164. package/src/components/substrate/SubstrateOverview.tsx +575 -0
  165. package/src/components/substrate/SubstratePages.test.tsx +478 -0
  166. package/src/components/substrate/SubstratePool.test.tsx +462 -0
  167. package/src/components/substrate/SubstratePoolPage.tsx +95 -0
  168. package/src/components/substrate/SubstratePoolSummary.tsx +485 -0
  169. package/src/components/substrate/SubstrateSidebar.test.tsx +101 -0
  170. package/src/components/substrate/SubstrateStateBar.tsx +63 -0
  171. package/src/components/substrate/SubstrateTemplates.tsx +376 -0
  172. package/src/components/substrate/SubstrateView.tsx +173 -0
  173. package/src/components/substrate/SubstrateWorkerPodContext.tsx +73 -0
  174. package/src/components/substrate/SubstrateWorkers.tsx +389 -0
  175. package/src/components/substrate/attention.ts +81 -0
  176. package/src/components/substrate/contextPin.tsx +69 -0
  177. package/src/components/substrate/host.tsx +83 -0
  178. package/src/components/substrate/kubectlTarget.test.tsx +77 -0
  179. package/src/components/substrate/readings.test.ts +484 -0
  180. package/src/components/substrate/readings.ts +997 -0
  181. package/src/components/substrate/routes.ts +103 -0
  182. package/src/components/substrate/shared.tsx +426 -0
  183. package/src/components/substrate/substrate.fixtures.ts +325 -0
  184. package/src/components/substrate/useSubstrateSidebarWorkspace.ts +87 -0
  185. package/src/components/substrate/workspaceRoute.ts +23 -0
  186. package/src/components/traffic/TrafficConnectionsTable.test.tsx +9 -0
  187. package/src/components/traffic/TrafficConnectionsTable.tsx +4 -2
  188. package/src/components/traffic/TrafficFilterSidebar.tsx +19 -14
  189. package/src/components/traffic/TrafficFlowList.test.tsx +63 -0
  190. package/src/components/traffic/TrafficFlowList.tsx +9 -5
  191. package/src/components/traffic/TrafficGraph.test.tsx +26 -0
  192. package/src/components/traffic/TrafficGraph.tsx +17 -14
  193. package/src/components/traffic/TrafficGraphTooLarge.tsx +2 -0
  194. package/src/components/traffic/TrafficGraphUnavailable.tsx +3 -1
  195. package/src/components/traffic/TrafficView.tsx +26 -56
  196. package/src/components/traffic/trafficFilters.test.ts +61 -1
  197. package/src/components/traffic/trafficFilters.ts +68 -8
  198. package/src/components/velero/VeleroOverview.tsx +2 -2
  199. package/src/components/velero/VeleroView.tsx +3 -6
  200. package/src/components/vulnerabilities/columns.tsx +132 -0
  201. package/src/components/vulnerabilities/filters.tsx +317 -0
  202. package/src/components/vulnerabilities/owner.test.ts +54 -0
  203. package/src/components/vulnerabilities/owner.tsx +163 -0
  204. package/src/components/vulnerabilities/parts.test.ts +126 -12
  205. package/src/components/vulnerabilities/parts.tsx +612 -52
  206. package/src/components/vulnerabilities/traffic.test.tsx +65 -0
  207. package/src/components/vulnerabilities/traffic.tsx +40 -0
  208. package/src/components/workload/WorkloadView.substrateVersion.test.tsx +88 -0
  209. package/src/components/workload/WorkloadView.tsx +119 -14
  210. package/src/components/workload/WorkloadView.workloadSource.test.tsx +121 -0
  211. package/src/components/workspace/layout.tsx +13 -7
  212. package/src/components/workspace/sidebar.test.ts +48 -0
  213. package/src/components/workspace/sidebar.ts +73 -3
  214. package/src/components/workspace/table.ts +2 -1
  215. package/src/context/ConnectionContext.tsx +24 -5
  216. package/src/context/ConnectionProvider.connectionId.test.tsx +14 -0
  217. package/src/context/ConnectionProvider.handover.test.tsx +94 -0
  218. package/src/context/DiagnoseCustomization.tsx +20 -2
  219. package/src/contexts/RegistryAccessMode.test.tsx +51 -0
  220. package/src/contexts/RegistryAccessMode.tsx +25 -0
  221. package/src/hooks/useEventSource.test.tsx +275 -4
  222. package/src/hooks/useEventSource.ts +278 -51
  223. package/src/index.ts +1 -0
  224. package/src/integrations/resourceHost.ts +12 -6
  225. package/src/integrations/resourceHosts.test.tsx +27 -1
  226. package/src/integrations/resourceHosts.tsx +15 -7
  227. package/src/integrations/sidebarWorkspaces.test.tsx +63 -0
  228. package/src/integrations/sidebarWorkspaces.ts +41 -0
  229. package/src/integrations/workspaceRoute.ts +1 -1
  230. package/src/integrations/workspaceRoutes.ts +7 -1
  231. package/src/integrations/workspaceScreens.tsx +6 -0
  232. package/src/utils/navigation.test.ts +1 -6
  233. package/src/utils/navigation.ts +9 -44
  234. package/src/utils/network-policy-navigation.test.ts +21 -36
@@ -57,9 +57,79 @@ export interface VulnerabilityExposure {
57
57
  exposedTotal?: number
58
58
  /** None of the row's workloads is known exposed, but some are where Radar couldn't read every route kind. */
59
59
  exposureUnknown?: boolean
60
+ /** The risky Pod settings of the row's workloads, together. Absent from an older Radar. */
61
+ riskFactors?: VulnerabilityRiskFactor[]
60
62
  }
61
63
 
62
- export interface VulnerabilityFinding {
64
+ /**
65
+ * A Pod setting that widens what a compromised container reaches, read from
66
+ * the workload's Pod specs with the Best practices checks' rules.
67
+ * mayRunAsRoot: nothing in the spec rules root out and no UID is set, so the
68
+ * image's USER decides; a workload that runs as root doesn't also carry it.
69
+ */
70
+ export type VulnerabilityRiskFactor = 'privileged' | 'hostAccess' | 'runsAsRoot' | 'mayRunAsRoot' | 'dangerousCapabilities' | 'privilegeEscalation' | 'hostPort'
71
+
72
+ /** A setting behind a risk factor: the Best practices check that flags it, in that check's words. */
73
+ export interface VulnerabilityRiskSetting {
74
+ factor: VulnerabilityRiskFactor
75
+ /** Absent where no check flags the setting (a host port). */
76
+ check?: string
77
+ message: string
78
+ }
79
+
80
+ /** A workload with a risk factor, never a container. */
81
+ export interface RiskyWorkload {
82
+ kind: string
83
+ group: string
84
+ namespace: string
85
+ name: string
86
+ factors: VulnerabilityRiskFactor[]
87
+ settings: VulnerabilityRiskSetting[]
88
+ }
89
+
90
+ /** CISA Known Exploited Vulnerabilities entry. dueDate is the BOD 22-01 federal remediation date. */
91
+ export interface VulnerabilityKEV {
92
+ dateAdded: string
93
+ dueDate: string
94
+ /** "known" when CISA knows of ransomware campaigns using it; "unknown" is CISA's word for not known, not "no". */
95
+ ransomwareUse: 'known' | 'unknown'
96
+ requiredAction?: string
97
+ name?: string
98
+ }
99
+
100
+ /** FIRST EPSS: probability of exploitation in the next 30 days, and its percentile among scored CVEs. */
101
+ export interface VulnerabilityEPSS {
102
+ score: number
103
+ percentile: number
104
+ }
105
+
106
+ /** One feed's copy. Only `ready` lets a missing entry mean "not listed". */
107
+ export interface VulnerabilityFeedStatus {
108
+ state: 'ready' | 'loading' | 'unavailable' | 'disabled'
109
+ origin?: 'public' | 'mirror' | 'file'
110
+ version?: string
111
+ count?: number
112
+ loadedAt?: string
113
+ /** When Radar last tried to load the feed, whether or not that worked. */
114
+ checkedAt?: string
115
+ /** Off because feed downloads are turned off and the feed is a URL; a file would load. */
116
+ downloadsOff?: boolean
117
+ stale?: boolean
118
+ error?: string
119
+ }
120
+
121
+ export interface VulnerabilityIntel {
122
+ kev: VulnerabilityFeedStatus
123
+ epss: VulnerabilityFeedStatus
124
+ }
125
+
126
+ /** Rows carrying KEV and EPSS. Absent entries mean "not listed" only when the feed is ready. */
127
+ export interface VulnerabilityIntelFields {
128
+ kev?: VulnerabilityKEV
129
+ epss?: VulnerabilityEPSS
130
+ }
131
+
132
+ export interface VulnerabilityFinding extends VulnerabilityIntelFields {
63
133
  id: string
64
134
  severity: VulnerabilitySeverity
65
135
  /** The scanner gave no severity; this is the CVSS rating of score. */
@@ -73,6 +143,14 @@ export interface VulnerabilityFinding {
73
143
  packageType?: string
74
144
  title?: string
75
145
  link?: string
146
+ /** The scanner's package URL (purl) for this package version. */
147
+ packageUrl?: string
148
+ }
149
+
150
+ /** The tool that wrote an image's newest report. */
151
+ export interface VulnerabilityScanner {
152
+ name: string
153
+ version?: string
76
154
  }
77
155
 
78
156
  export interface VulnerableImage extends VulnerabilityExposure {
@@ -80,12 +158,17 @@ export interface VulnerableImage extends VulnerabilityExposure {
80
158
  image: string
81
159
  digest?: string
82
160
  os?: string
161
+ /** The scanner reports the OS release as end of life (Trivy's eosl). */
162
+ osEndOfLife?: boolean
163
+ scanner?: VulnerabilityScanner
83
164
  scannedAt: string
84
165
  counts: VulnerabilityCounts
85
166
  fixable: VulnerabilityCounts
86
167
  matching: number
87
168
  /** Past the request's findings budget: counts unknown, not zero. */
88
169
  findingsUnread?: boolean
170
+ /** Distinct CVEs in the image that KEV lists. */
171
+ kevCves?: number
89
172
  workloads: VulnerabilityWorkloadRef[]
90
173
  workloadsTotal: number
91
174
  findings: VulnerabilityFinding[]
@@ -101,7 +184,7 @@ export interface VulnerabilityCVEImage {
101
184
  workloadsTotal: number
102
185
  }
103
186
 
104
- export interface VulnerabilityCVE extends VulnerabilityExposure {
187
+ export interface VulnerabilityCVE extends VulnerabilityExposure, VulnerabilityIntelFields {
105
188
  id: string
106
189
  severity: VulnerabilitySeverity
107
190
  score?: number
@@ -111,6 +194,8 @@ export interface VulnerabilityCVE extends VulnerabilityExposure {
111
194
  fixableImages: number
112
195
  title?: string
113
196
  link?: string
197
+ /** The earliest publication date among its findings; not when it was found here. */
198
+ publishedAt?: string
114
199
  images: number
115
200
  workloads: number
116
201
  affected: VulnerabilityCVEImage[]
@@ -128,6 +213,7 @@ export interface VulnerabilityFix extends VulnerabilityExposure {
128
213
  counts: VulnerabilityCounts
129
214
  cves: string[]
130
215
  cvesTotal: number
216
+ kevCves?: number
131
217
  images: number
132
218
  workloads: number
133
219
  affected: { imageId: string; image: string; installedVersions: string[]; workloads: VulnerabilityWorkloadRef[]; workloadsTotal: number }[]
@@ -151,11 +237,13 @@ export interface VulnerabilityWorkload {
151
237
  name: string
152
238
  counts: VulnerabilityCounts
153
239
  fixable: VulnerabilityCounts
240
+ kevCves?: number
154
241
  containers: VulnerabilityWorkloadContainer[]
155
242
  routes?: VulnerabilityRoute[]
156
243
  routesTotal?: number
157
244
  /** No route seen, but Radar couldn't read every route kind that could reach it. */
158
245
  exposureUnknown?: boolean
246
+ riskFactors?: VulnerabilityRiskFactor[]
159
247
  }
160
248
 
161
249
  export interface VulnerabilitySummary {
@@ -163,14 +251,71 @@ export interface VulnerabilitySummary {
163
251
  imagesClean: number
164
252
  imagesUnscanned: number
165
253
  imagesWithCritical: number
254
+ /** Scanned images whose OS the scanner reports as end of life. Absent from an older Radar, which ignores the eol filter. */
255
+ imagesOsEndOfLife?: number
166
256
  fixableCriticalHighCves: number
167
257
  workloadsWithCriticalOrHigh: number
258
+ /** Distinct CVEs in scope that KEV lists; absent from an older Radar. */
259
+ kevCves?: number
168
260
  workloads: number
169
261
  counts: VulnerabilityCounts
170
262
  newestScan?: string
171
263
  oldestScan?: string
172
264
  }
173
265
 
266
+ /** Where a workload's manager deploys from; credentials removed. path is in that repository. */
267
+ export interface VulnerabilityOwnerSource {
268
+ repo: string
269
+ path?: string
270
+ /** A Helm source's chart in a multi-source Argo CD Application, where the manager names no single chart. */
271
+ chart?: string
272
+ }
273
+
274
+ /**
275
+ * The Helm release, Argo CD Application or Flux Kustomization / HelmRelease
276
+ * that deploys a workload. It names the app and the repository, never the
277
+ * file to change: an image tag can come from CI, an override or a values file.
278
+ */
279
+ export interface VulnerabilityOwnerManager {
280
+ tool: 'helm' | 'argocd' | 'fluxcd'
281
+ kind: string
282
+ group?: string
283
+ namespace: string
284
+ name: string
285
+ /** A Helm release's helm.sh/chart label (a subchart's workload names the subchart), or the chart a Flux or Argo CD source names. */
286
+ chart?: string
287
+ /** Empty for a Helm release, which records none, and where the caller can't read the manager or its source. */
288
+ sources?: VulnerabilityOwnerSource[]
289
+ /** Two or more Argo CD or Flux objects list the workload, or what runs it; this is the one Radar leads with. */
290
+ shared?: boolean
291
+ }
292
+
293
+ /** What Radar knows of who owns a workload. A workload with nothing known is left out of `owners`. */
294
+ export interface VulnerabilityWorkloadOwner {
295
+ kind: string
296
+ group: string
297
+ namespace: string
298
+ name: string
299
+ manager?: VulnerabilityOwnerManager
300
+ /** No manager could be named, but the evidence doesn't say there is none. */
301
+ managerUnknown?: boolean
302
+ /** With managerUnknown: the caller's access stopped the lookup, so "none" was never checked. */
303
+ managerUnchecked?: boolean
304
+ team?: string
305
+ teamFrom?: 'workload' | 'namespace'
306
+ }
307
+
308
+ /**
309
+ * A kind that could name an owner which the caller's access kept Radar from
310
+ * reading in full: an Argo CD or Flux kind, or Namespace for the team label.
311
+ * partial: readable in some namespaces, not every one.
312
+ */
313
+ export interface VulnerabilityOwnerRead {
314
+ kind: string
315
+ group?: string
316
+ partial?: boolean
317
+ }
318
+
174
319
  /** A shared read gap; `kinds` names what wasn't read, absent meaning the reports themselves. */
175
320
  export type VulnerabilityGap = ReadGap
176
321
 
@@ -183,7 +328,7 @@ export interface VulnerabilitiesResponse {
183
328
  workloads?: VulnerabilityWorkload[]
184
329
  fixes?: VulnerabilityFix[]
185
330
  /** Scanned images with no findings, kept out of the rows unless searched for. */
186
- clean?: { id: string; image: string; scannedAt: string; workloads: VulnerabilityWorkloadRef[]; workloadsTotal: number; report: VulnerableImage['report'] }[]
331
+ clean?: { id: string; image: string; osEndOfLife?: boolean; scannedAt: string; workloads: VulnerabilityWorkloadRef[]; workloadsTotal: number; report: VulnerableImage['report'] }[]
187
332
  /** Workloads whose every container is scanned and clean. */
188
333
  cleanWorkloads?: VulnerabilityWorkloadRef[]
189
334
  /** otherBuildScanned: Trivy's report is of another build of this tag, as after the tag moved. */
@@ -197,6 +342,25 @@ export interface VulnerabilitiesResponse {
197
342
  /** Route kinds this cluster serves that Radar doesn't follow (Istio, Traefik IngressRoute, Contour, Knative). */
198
343
  unchecked?: { kind: string; group?: string }[]
199
344
  }
345
+ /**
346
+ * Present when this Radar reads risky Pod settings; absent from an older one.
347
+ * workloads: those the rows name with any factor, with settings only for the
348
+ * serious three and the factors the risk filter selects. counts: workloads
349
+ * in scope with each factor, before the filters.
350
+ */
351
+ podRisk?: {
352
+ workloads?: RiskyWorkload[]
353
+ counts: Record<VulnerabilityRiskFactor, number>
354
+ }
355
+ /** The owners of the workloads the answer names. Present with `ownership` from a Radar that reads owners. */
356
+ owners?: VulnerabilityWorkloadOwner[]
357
+ /**
358
+ * Absent from an older Radar: owners are unknown there. unavailable: why none could be read this time.
359
+ * unchecked: what the caller's access kept Radar from reading; absent from a Radar that doesn't say.
360
+ */
361
+ ownership?: { teamLabel: string; unavailable?: string; unchecked?: VulnerabilityOwnerRead[] }
362
+ /** The exploit-intelligence feeds; absent from a Radar that predates them, where KEV and EPSS are unknown. */
363
+ intel?: VulnerabilityIntel
200
364
  coverage: {
201
365
  complete: boolean
202
366
  gaps: VulnerabilityGap[]
@@ -215,6 +379,12 @@ export interface VulnerabilitiesParams {
215
379
  fixableOnly?: boolean
216
380
  /** Only rows affecting a workload with a route from outside the cluster. */
217
381
  exposed?: boolean
382
+ /** Only images whose OS the scanner reports as end of life. */
383
+ osEndOfLife?: boolean
384
+ /** Only rows affecting a workload with any of these risk factors. */
385
+ risk?: VulnerabilityRiskFactor[]
386
+ /** Only CVEs in CISA's KEV catalog. Send only to a Radar whose answers carry `intel`. */
387
+ kev?: boolean
218
388
  query?: string
219
389
  workload?: { kind: string; group?: string; namespace: string; name: string }
220
390
  }
@@ -385,6 +555,9 @@ export function vulnerabilitiesPath(p: VulnerabilitiesParams): string {
385
555
  if (p.severities && p.severities.length > 0) params.set('severity', p.severities.join(','))
386
556
  if (p.fixableOnly) params.set('fixable', '1')
387
557
  if (p.exposed) params.set('exposed', '1')
558
+ if (p.osEndOfLife) params.set('eol', '1')
559
+ if (p.risk && p.risk.length > 0) params.set('risk', p.risk.join(','))
560
+ if (p.kev) params.set('kev', '1')
388
561
  if (p.query?.trim()) params.set('q', p.query.trim())
389
562
  if (p.workload) {
390
563
  params.set('workloadKind', p.workload.kind)
@@ -421,6 +594,32 @@ export function vulnerabilitiesCSVFilename(view: VulnerabilityExportView, cluste
421
594
 
422
595
  // GET /api/vulnerabilities. Filters run server-side so the summary always
423
596
  // describes the unfiltered scope and every surface (REST, MCP) filters alike.
597
+ /** Looks up a workload's owner; the container, if any, is ignored. */
598
+ export type OwnerLookup = (w: { kind: string; group?: string; namespace: string; name: string }) => VulnerabilityWorkloadOwner | undefined
599
+
600
+ export function ownerLookup(owners: VulnerabilityWorkloadOwner[] | undefined): OwnerLookup {
601
+ const byKey = new Map((owners ?? []).map((o) => [`${o.namespace}/${o.group}/${o.kind}/${o.name}`, o]))
602
+ return (w) => byKey.get(`${w.namespace}/${w.group ?? ''}/${w.kind}/${w.name}`)
603
+ }
604
+
605
+ // Radar reports a feed as loading for at most 30 seconds after it starts
606
+ // asking Radar Cloud, then as ready or unavailable.
607
+ const INTEL_LOADING_RECHECK = 45_000
608
+
609
+ /**
610
+ * How soon a read refreshes. The tab's tables can run to megabytes and scans
611
+ * change hourly, so they refresh every five minutes; Home's totals and one
612
+ * workload's rows are small and stay at a minute. KEV and EPSS never make it
613
+ * poll: a first answer whose feeds are still loading gets one look once
614
+ * Radar has stopped reporting them as loading, then the usual interval.
615
+ */
616
+ export function vulnerabilitiesRefetchInterval(p: Pick<VulnerabilitiesParams, 'view' | 'workload'>, data: VulnerabilitiesResponse | undefined, answers: number): number {
617
+ const normal = p.view === 'summary' || p.workload ? 60_000 : 300_000
618
+ const intel = data?.intel
619
+ const loading = !!intel && (intel.kev.state === 'loading' || intel.epss.state === 'loading')
620
+ return loading && answers <= 1 ? Math.min(normal, INTEL_LOADING_RECHECK) : normal
621
+ }
622
+
424
623
  export function useVulnerabilities(p: VulnerabilitiesParams, enabled = true) {
425
624
  const { guard, gatedKey } = useRadarFeature('vulnerabilities')
426
625
  const path = vulnerabilitiesPath(p)
@@ -433,10 +632,7 @@ export function useVulnerabilities(p: VulnerabilitiesParams, enabled = true) {
433
632
  // loading state rather than an error.
434
633
  retry: (failures, error) => (readSettles(error) ? failures < 8 : shouldRetryRadarQuery(failures, error)),
435
634
  staleTime: 30_000,
436
- // The tab's tables can run to megabytes and scans change hourly, so they
437
- // refresh every five minutes; Home's totals and one workload's rows are
438
- // small and stay at a minute.
439
- refetchInterval: p.view === 'summary' || p.workload ? 60_000 : 300_000,
635
+ refetchInterval: (query) => vulnerabilitiesRefetchInterval(p, query.state.data, query.state.dataUpdateCount),
440
636
  refetchIntervalInBackground: false,
441
637
  // Keep showing the last answer, dimmed, while the tab's filters or view
442
638
  // change (the summary is the same in every view; a caller shows rows
@@ -446,10 +642,12 @@ export function useVulnerabilities(p: VulnerabilitiesParams, enabled = true) {
446
642
  })
447
643
  }
448
644
 
449
- // Whether a failed read settles by itself: Radar still loading the kind, or
450
- // its connection just changed. A 503 naming something to fix doesn't.
645
+ // Whether a failed read settles by itself: Radar still loading the kind or
646
+ // Radar Cloud's KEV catalog, or its connection just changed. A 503 naming
647
+ // something to fix doesn't.
451
648
  export function readSettles(error: unknown): boolean {
452
649
  if (!(error instanceof ApiError)) return false
453
650
  const code = error.data?.error_code
651
+ if (error.status === 503 && code === 'kev_loading') return true
454
652
  return error.status === 409 || (error.status === 503 && (code === undefined || readActionFor(code) === 'retry'))
455
653
  }