@oneuptime/common 12.0.25 → 12.0.27

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 (856) hide show
  1. package/Models/AnalyticsModels/Index.ts +2 -0
  2. package/Models/AnalyticsModels/ThreatIntelIndicator.ts +413 -0
  3. package/Models/DatabaseModels/AlertSeverity.ts +4 -1
  4. package/Models/DatabaseModels/CephClusterFeed.ts +625 -0
  5. package/Models/DatabaseModels/CloudResourceFeed.ts +625 -0
  6. package/Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel.ts +13 -0
  7. package/Models/DatabaseModels/DetectionRule.ts +9 -3
  8. package/Models/DatabaseModels/DockerHostFeed.ts +625 -0
  9. package/Models/DatabaseModels/DockerSwarmClusterFeed.ts +628 -0
  10. package/Models/DatabaseModels/GoogleSecOpsConnection.ts +9 -3
  11. package/Models/DatabaseModels/HostFeed.ts +625 -0
  12. package/Models/DatabaseModels/IncidentSeverity.ts +4 -1
  13. package/Models/DatabaseModels/Index.ts +22 -0
  14. package/Models/DatabaseModels/KubernetesClusterFeed.ts +628 -0
  15. package/Models/DatabaseModels/Monitor.ts +87 -0
  16. package/Models/DatabaseModels/NetworkDevice.ts +96 -5
  17. package/Models/DatabaseModels/NetworkDeviceAutoImportRule.ts +92 -6
  18. package/Models/DatabaseModels/NetworkDeviceDiscoveryScan.ts +301 -31
  19. package/Models/DatabaseModels/NetworkSite.ts +120 -0
  20. package/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.ts +1 -0
  21. package/Models/DatabaseModels/PodmanHostFeed.ts +625 -0
  22. package/Models/DatabaseModels/ProxmoxClusterFeed.ts +626 -0
  23. package/Models/DatabaseModels/ScheduledMaintenance.ts +67 -0
  24. package/Models/DatabaseModels/ServiceFeed.ts +625 -0
  25. package/Models/DatabaseModels/TelemetrySourceMap.ts +474 -0
  26. package/Models/DatabaseModels/ThreatIntelFeed.ts +758 -0
  27. package/Models/DatabaseModels/UserOnCallLog.ts +1 -0
  28. package/Models/DatabaseModels/UserTotpAuth.ts +1 -0
  29. package/Models/DatabaseModels/UserWebAuthn.ts +1 -0
  30. package/Server/API/AlertAPI.ts +23 -1
  31. package/Server/API/BaseAPI.ts +14 -3
  32. package/Server/API/IncidentAPI.ts +41 -1
  33. package/Server/API/IncidentEpisodeAPI.ts +23 -1
  34. package/Server/API/MicrosoftTeamsAPI.ts +31 -2
  35. package/Server/API/ScheduledMaintenanceAPI.ts +23 -1
  36. package/Server/API/SlackAPI.ts +48 -0
  37. package/Server/API/TelemetryAPI.ts +167 -42
  38. package/Server/API/UserOnCallLogTimelineAPI.ts +75 -61
  39. package/Server/API/UserTotpAuthAPI.ts +67 -1
  40. package/Server/API/UserWebAuthnAPI.ts +44 -1
  41. package/Server/Infrastructure/Postgres/SchemaMigrations/1787923136162-MigrationName.ts +57 -0
  42. package/Server/Infrastructure/Postgres/SchemaMigrations/1789600000000-AddAutoProvisionedNetworkDeviceMonitors.ts +49 -0
  43. package/Server/Infrastructure/Postgres/SchemaMigrations/1789700000000-AddNetworkScaleIndexes.ts +129 -0
  44. package/Server/Infrastructure/Postgres/SchemaMigrations/1789800000000-WidenSecurityEventLastErrorColumns.ts +54 -0
  45. package/Server/Infrastructure/Postgres/SchemaMigrations/1789900000000-AddNetworkSiteRollupPolicyAndMaintenance.ts +64 -0
  46. package/Server/Infrastructure/Postgres/SchemaMigrations/1790000000000-AddTelemetrySourceMap.ts +64 -0
  47. package/Server/Infrastructure/Postgres/SchemaMigrations/1790000000001-AddSnmpConfigsToNetworkDeviceDiscoveryScan.ts +72 -0
  48. package/Server/Infrastructure/Postgres/SchemaMigrations/1790003445000-AddSnmpEnabledToNetworkDeviceDiscoveryScan.ts +31 -0
  49. package/Server/Infrastructure/Postgres/SchemaMigrations/1790100000000-AddResourceActivityFeeds.ts +489 -0
  50. package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +18 -0
  51. package/Server/Middleware/IdentityRateLimit.ts +53 -3
  52. package/Server/Services/AIService.ts +181 -41
  53. package/Server/Services/CephClusterFeedService.ts +99 -0
  54. package/Server/Services/CephClusterLabelRuleEngineService.ts +29 -0
  55. package/Server/Services/CephClusterOwnerRuleEngineService.ts +23 -0
  56. package/Server/Services/CephClusterOwnerTeamService.ts +129 -0
  57. package/Server/Services/CephClusterOwnerUserService.ts +123 -0
  58. package/Server/Services/CephClusterService.ts +223 -2
  59. package/Server/Services/CloudResourceFeedService.ts +99 -0
  60. package/Server/Services/CloudResourceLabelRuleEngineService.ts +30 -0
  61. package/Server/Services/CloudResourceOwnerRuleEngineService.ts +33 -0
  62. package/Server/Services/CloudResourceOwnerTeamService.ts +129 -0
  63. package/Server/Services/CloudResourceOwnerUserService.ts +123 -0
  64. package/Server/Services/CloudResourceService.ts +227 -2
  65. package/Server/Services/DatabaseService.ts +265 -0
  66. package/Server/Services/DockerHostFeedService.ts +99 -0
  67. package/Server/Services/DockerHostLabelRuleEngineService.ts +29 -0
  68. package/Server/Services/DockerHostOwnerRuleEngineService.ts +23 -0
  69. package/Server/Services/DockerHostOwnerTeamService.ts +129 -0
  70. package/Server/Services/DockerHostOwnerUserService.ts +123 -0
  71. package/Server/Services/DockerHostService.ts +227 -2
  72. package/Server/Services/DockerSwarmClusterFeedService.ts +102 -0
  73. package/Server/Services/DockerSwarmClusterLabelRuleEngineService.ts +30 -0
  74. package/Server/Services/DockerSwarmClusterOwnerRuleEngineService.ts +24 -0
  75. package/Server/Services/DockerSwarmClusterOwnerTeamService.ts +133 -0
  76. package/Server/Services/DockerSwarmClusterOwnerUserService.ts +127 -0
  77. package/Server/Services/DockerSwarmClusterService.ts +229 -2
  78. package/Server/Services/EnterpriseLicenseService.ts +15 -7
  79. package/Server/Services/ExceptionAggregationService.ts +12 -2
  80. package/Server/Services/HostFeedService.ts +99 -0
  81. package/Server/Services/HostLabelRuleEngineService.ts +29 -0
  82. package/Server/Services/HostOwnerRuleEngineService.ts +23 -0
  83. package/Server/Services/HostOwnerTeamService.ts +129 -0
  84. package/Server/Services/HostOwnerUserService.ts +123 -0
  85. package/Server/Services/HostService.ts +215 -2
  86. package/Server/Services/IncidentService.ts +11 -0
  87. package/Server/Services/Index.ts +24 -0
  88. package/Server/Services/KubernetesClusterFeedService.ts +99 -0
  89. package/Server/Services/KubernetesClusterLabelRuleEngineService.ts +30 -0
  90. package/Server/Services/KubernetesClusterOwnerRuleEngineService.ts +24 -0
  91. package/Server/Services/KubernetesClusterOwnerTeamService.ts +133 -0
  92. package/Server/Services/KubernetesClusterOwnerUserService.ts +127 -0
  93. package/Server/Services/KubernetesClusterService.ts +231 -2
  94. package/Server/Services/LogAggregationService.ts +23 -280
  95. package/Server/Services/MetricAggregationService.ts +98 -1
  96. package/Server/Services/MonitorService.ts +177 -13
  97. package/Server/Services/MonitorTemplateService.ts +111 -0
  98. package/Server/Services/NetworkDeviceAutoImportRuleEngineService.ts +777 -86
  99. package/Server/Services/NetworkDeviceAutoImportRuleService.ts +199 -16
  100. package/Server/Services/NetworkDeviceDiscoveryScanService.ts +1055 -14
  101. package/Server/Services/NetworkDeviceService.ts +750 -4
  102. package/Server/Services/NetworkInterfaceService.ts +415 -0
  103. package/Server/Services/NetworkSiteService.ts +485 -52
  104. package/Server/Services/PodmanHostFeedService.ts +99 -0
  105. package/Server/Services/PodmanHostLabelRuleEngineService.ts +29 -0
  106. package/Server/Services/PodmanHostOwnerRuleEngineService.ts +23 -0
  107. package/Server/Services/PodmanHostOwnerTeamService.ts +129 -0
  108. package/Server/Services/PodmanHostOwnerUserService.ts +123 -0
  109. package/Server/Services/PodmanHostService.ts +227 -2
  110. package/Server/Services/ProjectService.ts +16 -10
  111. package/Server/Services/ProxmoxClusterFeedService.ts +99 -0
  112. package/Server/Services/ProxmoxClusterLabelRuleEngineService.ts +30 -0
  113. package/Server/Services/ProxmoxClusterOwnerRuleEngineService.ts +24 -0
  114. package/Server/Services/ProxmoxClusterOwnerTeamService.ts +131 -0
  115. package/Server/Services/ProxmoxClusterOwnerUserService.ts +124 -0
  116. package/Server/Services/ProxmoxClusterService.ts +225 -2
  117. package/Server/Services/ScheduledMaintenanceStateTimelineService.ts +61 -0
  118. package/Server/Services/ServiceFeedService.ts +99 -0
  119. package/Server/Services/ServiceLabelRuleEngineService.ts +29 -0
  120. package/Server/Services/ServiceOwnerRuleEngineService.ts +26 -0
  121. package/Server/Services/ServiceOwnerTeamService.ts +129 -0
  122. package/Server/Services/ServiceOwnerUserService.ts +123 -0
  123. package/Server/Services/ServiceService.ts +227 -3
  124. package/Server/Services/StatusPageSubscriberService.ts +7 -0
  125. package/Server/Services/TelemetryAttributeService.ts +13 -3
  126. package/Server/Services/TelemetrySourceMapService.ts +307 -0
  127. package/Server/Services/ThreatIntelFeedService.ts +222 -0
  128. package/Server/Services/ThreatIntelIndicatorService.ts +428 -0
  129. package/Server/Services/TraceAggregationService.ts +101 -11
  130. package/Server/Services/UserService.ts +13 -6
  131. package/Server/Services/UserTwoFactorBackupCodeService.ts +127 -0
  132. package/Server/Services/UserWebhookService.ts +11 -2
  133. package/Server/Static/Brand/README.md +38 -0
  134. package/Server/Static/Brand/favicons/apple-touch-icon.png +0 -0
  135. package/Server/Static/Brand/favicons/favicon-16x16.png +0 -0
  136. package/Server/Static/Brand/favicons/favicon-32x32.png +0 -0
  137. package/Server/Static/Brand/favicons/favicon.ico +0 -0
  138. package/Server/Static/Brand/favicons/safari-pinned-tab.svg +31 -0
  139. package/Server/Static/Brand/hou-wb.svg +1 -0
  140. package/Server/Static/Brand/oneuptime-logo.svg +1 -0
  141. package/Server/Static/Brand/ou-wb.svg +1 -0
  142. package/Server/Static/Vendor/README.md +4 -0
  143. package/Server/Types/AnalyticsDatabase/ModelPermission.ts +13 -3
  144. package/Server/Types/Database/AggregateBy.ts +83 -0
  145. package/Server/Types/Database/AggregateResultUtil.ts +126 -0
  146. package/Server/Types/Database/JSONColumnQuery.ts +18 -0
  147. package/Server/Types/Database/QueryHelper.ts +40 -0
  148. package/Server/Types/Database/QueryUtil.ts +26 -0
  149. package/Server/Types/Workflow/Components/API/Utils.ts +10 -1
  150. package/Server/Types/Workflow/Components/JavaScript.ts +8 -0
  151. package/Server/Utils/AI/CodeFix/CodeFixAgentCompletion.ts +9 -0
  152. package/Server/Utils/AI/SRE/InvestigationGrader.ts +18 -0
  153. package/Server/Utils/AnalyticsDatabase/AttributeFilterStatement.ts +422 -0
  154. package/Server/Utils/AnalyticsDatabase/StatementGenerator.ts +176 -0
  155. package/Server/Utils/DataSource/HttpFetch.ts +18 -0
  156. package/Server/Utils/Database/RelationIdUtil.ts +42 -0
  157. package/Server/Utils/Marketing/MarketingEventUtil.ts +38 -9
  158. package/Server/Utils/Monitor/Criteria/ServerMonitorCriteria.ts +34 -3
  159. package/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.ts +9 -1
  160. package/Server/Utils/Monitor/Criteria/SyntheticMonitor.ts +28 -10
  161. package/Server/Utils/Monitor/MonitorAlert.ts +541 -332
  162. package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +330 -64
  163. package/Server/Utils/Monitor/MonitorIncident.ts +640 -434
  164. package/Server/Utils/Monitor/MonitorResource.ts +226 -49
  165. package/Server/Utils/Monitor/NetworkDeviceWalkUtil.ts +46 -3
  166. package/Server/Utils/Monitor/NetworkInventoryUtil.ts +23 -102
  167. package/Server/Utils/Monitor/PerEntityCriteriaFanOut.ts +329 -0
  168. package/Server/Utils/NetworkDevice/DeviceHealthAggregation.ts +427 -0
  169. package/Server/Utils/NetworkSite/NetworkSiteMaintenanceSuppression.ts +310 -0
  170. package/Server/Utils/OnCallNotificationContext.ts +686 -0
  171. package/Server/Utils/PrivateNetworkWebhookConfig.ts +549 -0
  172. package/Server/Utils/ResourceFeed/ResourceFeedUtil.ts +139 -0
  173. package/Server/Utils/Response.ts +11 -1
  174. package/Server/Utils/SSRFProtection.ts +230 -60
  175. package/Server/Utils/SecurityEvent/ConnectorErrorMessage.ts +106 -0
  176. package/Server/Utils/SecurityEvent/DetectionRuleEvaluator.ts +84 -284
  177. package/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsPoller.ts +47 -20
  178. package/Server/Utils/SecurityEvent/SecurityEventAlerting.ts +318 -0
  179. package/Server/Utils/SecurityEvent/ThreatIntel/TaxiiClient.ts +199 -0
  180. package/Server/Utils/SecurityEvent/ThreatIntel/ThreatIntelEnricher.ts +252 -0
  181. package/Server/Utils/SecurityEvent/ThreatIntel/ThreatIntelFeedPoller.ts +739 -0
  182. package/Server/Utils/SecurityEvent/ThreatIntel/ThreatIntelMatcher.ts +533 -0
  183. package/Server/Utils/StartServer.ts +83 -56
  184. package/Server/Utils/StatusPageSubscriberWebhook.ts +3 -0
  185. package/Server/Utils/Telemetry/SourceMapResolver.ts +480 -0
  186. package/Server/Utils/TwoFactorBackupCodeNotification.ts +106 -0
  187. package/Server/Utils/VM/VMAPI.ts +3 -0
  188. package/Server/Utils/VM/VMRunner.ts +27 -1
  189. package/Server/Utils/VendorAssets.ts +42 -0
  190. package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.ts +136 -6
  191. package/Server/Views/AcknowledgeUserOnCallNotification.ejs +11 -9
  192. package/Server/Views/Partials/Head.ejs +9 -9
  193. package/Server/Views/Partials/OnCallNotificationDetails.ejs +48 -0
  194. package/Server/Views/ViewMessage.ejs +11 -9
  195. package/Tests/App/Accounts/LoginTwoFactorRecovery.test.tsx +972 -0
  196. package/Tests/App/Dashboard/AddNeighborToMonitoringModal.test.tsx +401 -0
  197. package/Tests/App/Dashboard/DiscoveryScanEditForm.test.tsx +707 -0
  198. package/Tests/App/Dashboard/DiscoveryScanWizardValidation.test.tsx +1908 -18
  199. package/Tests/App/Dashboard/ResourceFeed.test.tsx +230 -0
  200. package/Tests/App/Dashboard/ResourceFeedPageWiring.test.ts +216 -0
  201. package/Tests/App/Dashboard/TopologyAddToMonitoring.test.tsx +192 -0
  202. package/Tests/App/Dashboard/WorkspaceNotificationRuleConditions.test.tsx +439 -0
  203. package/Tests/Models/DatabaseModels/DateColumnDeserialization.test.ts +182 -0
  204. package/Tests/Models/DatabaseModels/RelationColumnModelTypeCoverage.test.ts +82 -0
  205. package/Tests/Models/DatabaseModels/ResourceFeedModels.test.ts +398 -0
  206. package/Tests/Models/DiscoveryScanNameColumn.test.ts +151 -16
  207. package/Tests/Models/DiscoveryScanSnmpEnabledColumn.test.ts +593 -0
  208. package/Tests/Models/NetworkDeviceCreateContract.test.ts +102 -0
  209. package/Tests/Server/API/AIGenerationProjectAIToggle.test.ts +607 -0
  210. package/Tests/Server/API/AIGenerationRequestBudget.test.ts +355 -0
  211. package/Tests/Server/API/AIKillSwitchBackstop.test.ts +602 -0
  212. package/Tests/Server/API/BaseAPIUpdateDateColumns.test.ts +154 -0
  213. package/Tests/Server/API/MicrosoftTeamsBotTestEndpoint.test.ts +335 -0
  214. package/Tests/Server/API/UserOnCallLogTimelineAcknowledgePage.test.ts +611 -0
  215. package/Tests/Server/API/UserTotpAuthAPI.test.ts +498 -4
  216. package/Tests/Server/API/UserWebAuthnBackupCodeMinting.test.ts +682 -0
  217. package/Tests/Server/Infrastructure/ExampleDockerfiles.test.ts +595 -0
  218. package/Tests/Server/Services/AIServiceDailyBudget.test.ts +9 -0
  219. package/Tests/Server/Services/AIServiceProjectAccess.test.ts +6 -0
  220. package/Tests/Server/Services/AutoImportScanCredentialSelect.test.ts +18 -0
  221. package/Tests/Server/Services/DatabaseServiceAggregateBy.test.ts +590 -0
  222. package/Tests/Server/Services/DatabaseServiceUpdateWriteRouting.test.ts +12 -0
  223. package/Tests/Server/Services/DiscoveryScanClaimHookFreeSafety.test.ts +162 -26
  224. package/Tests/Server/Services/EnterpriseLicenseServiceCreate.test.ts +292 -0
  225. package/Tests/Server/Services/FeedRetentionConsistency.test.ts +119 -12
  226. package/Tests/Server/Services/LogAggregationAttributeOperators.test.ts +109 -0
  227. package/Tests/Server/Services/MetricAggregationAttributeOperators.test.ts +170 -0
  228. package/Tests/Server/Services/MonitorTemplateServiceNetworkDeviceSync.test.ts +383 -0
  229. package/Tests/Server/Services/NetworkDeviceAutoImportRuleEngineService.test.ts +997 -3
  230. package/Tests/Server/Services/NetworkDeviceAutoImportRuleService.test.ts +830 -0
  231. package/Tests/Server/Services/NetworkDeviceAutoMonitorLifecycle.test.ts +528 -0
  232. package/Tests/Server/Services/NetworkDeviceDiscoveryScanService.test.ts +3141 -1
  233. package/Tests/Server/Services/NetworkDeviceRegisteredHostnames.test.ts +1023 -0
  234. package/Tests/Server/Services/NetworkDeviceSiteAssignmentRuleSkip.test.ts +728 -0
  235. package/Tests/Server/Services/NetworkInterfaceServiceUpsert.test.ts +795 -0
  236. package/Tests/Server/Services/NetworkSiteRollupPolicyAndMaintenance.test.ts +903 -0
  237. package/Tests/Server/Services/NetworkSiteService.test.ts +165 -24
  238. package/Tests/Server/Services/ProjectServiceChangePlan.test.ts +5 -3
  239. package/Tests/Server/Services/ProjectServiceCreateSubscriptionStarted.test.ts +5 -2
  240. package/Tests/Server/Services/ResourceCreationFeedWrites.test.ts +304 -0
  241. package/Tests/Server/Services/ResourceFeedServices.test.ts +269 -0
  242. package/Tests/Server/Services/ResourceOwnerFeedWrites.test.ts +245 -0
  243. package/Tests/Server/Services/SecurityEventLastErrorColumnWidth.test.ts +792 -0
  244. package/Tests/Server/Services/TelemetrySourceMapService.test.ts +483 -0
  245. package/Tests/Server/Services/ThreatIntelFeedService.test.ts +351 -0
  246. package/Tests/Server/Services/ThreatIntelIndicatorService.test.ts +366 -0
  247. package/Tests/Server/Services/TraceAggregationAttributeOperators.test.ts +507 -0
  248. package/Tests/Server/Services/UserTwoFactorBackupCodeGenerateIfNone.test.ts +705 -0
  249. package/Tests/Server/Services/WorkspaceNotificationRuleOnCallDutyPolicy.test.ts +306 -0
  250. package/Tests/Server/Types/Database/AggregateResultUtil.test.ts +386 -0
  251. package/Tests/Server/Types/Database/Permissions/SelectRejectionMessageContract.test.ts +424 -0
  252. package/Tests/Server/Types/Database/QueryHelperWildcard.test.ts +142 -0
  253. package/Tests/Server/Types/Workflow/Components/ApiComponentPrivateNetwork.test.ts +163 -0
  254. package/Tests/Server/Types/Workflow/Components/JavaScriptPrivateNetwork.test.ts +124 -0
  255. package/Tests/Server/Utils/AI/CodeFixAgentCompletion.test.ts +5 -0
  256. package/Tests/Server/Utils/AI/InvestigationGrader.test.ts +39 -1
  257. package/Tests/Server/Utils/AnalyticsDatabase/AttributeFilterStatement.test.ts +338 -0
  258. package/Tests/Server/Utils/AnalyticsDatabase/StatementGeneratorWildcard.test.ts +383 -0
  259. package/Tests/Server/Utils/Marketing/EmittedMarketingEvent.ts +23 -0
  260. package/Tests/Server/Utils/Marketing/MarketingEventUtil.test.ts +51 -0
  261. package/Tests/Server/Utils/Monitor/Criteria/SyntheticMonitorCriteria.test.ts +259 -0
  262. package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluatorPerSeriesFanout.test.ts +557 -0
  263. package/Tests/Server/Utils/Monitor/MonitorDependencySuppressionCreatorSkip.test.ts +12 -2
  264. package/Tests/Server/Utils/Monitor/NetworkDeviceWalkLogWritePath.test.ts +404 -0
  265. package/Tests/Server/Utils/Monitor/NetworkDeviceWalkUtil.test.ts +8 -2
  266. package/Tests/Server/Utils/Monitor/NetworkInventoryUtil.test.ts +125 -98
  267. package/Tests/Server/Utils/Monitor/PerEntityCriteriaFanOut.test.ts +444 -0
  268. package/Tests/Server/Utils/Monitor/PerSeriesSecondEntityAlerting.test.ts +1112 -0
  269. package/Tests/Server/Utils/NetworkDevice/DeviceHealthAggregation.test.ts +717 -0
  270. package/Tests/Server/Utils/NetworkDevice/RulePatternValidator.test.ts +78 -0
  271. package/Tests/Server/Utils/NetworkSite/NetworkSiteMaintenanceSuppression.test.ts +363 -0
  272. package/Tests/Server/Utils/OfflineAssetHygiene.test.ts +35 -0
  273. package/Tests/Server/Utils/OnCallNotificationContext.test.ts +908 -0
  274. package/Tests/Server/Utils/PrivateNetworkWebhookConfig.test.ts +423 -0
  275. package/Tests/Server/Utils/ResourceFeed/ResourceFeedUtil.test.ts +191 -0
  276. package/Tests/Server/Utils/SSRFProtectionPrivateNetwork.test.ts +597 -0
  277. package/Tests/Server/Utils/SecurityEvent/ConnectorErrorMessage.test.ts +819 -0
  278. package/Tests/Server/Utils/SecurityEvent/DetectionRuleEvaluator.test.ts +381 -0
  279. package/Tests/Server/Utils/SecurityEvent/GoogleSecOpsPoller.test.ts +417 -0
  280. package/Tests/Server/Utils/SecurityEvent/GoogleSecOpsPollerFailureTaxonomy.test.ts +819 -0
  281. package/Tests/Server/Utils/SecurityEvent/SecurityEventAlerting.test.ts +246 -0
  282. package/Tests/Server/Utils/SecurityEvent/ThreatIntel/TaxiiClient.test.ts +282 -0
  283. package/Tests/Server/Utils/SecurityEvent/ThreatIntel/ThreatIntelEnricher.test.ts +312 -0
  284. package/Tests/Server/Utils/SecurityEvent/ThreatIntel/ThreatIntelFeedPoller.test.ts +854 -0
  285. package/Tests/Server/Utils/SecurityEvent/ThreatIntel/ThreatIntelMatcher.test.ts +437 -0
  286. package/Tests/Server/Utils/StartServerErrorStatus.test.ts +225 -0
  287. package/Tests/Server/Utils/StatusPage/MonitorRulePatternValidator.test.ts +62 -0
  288. package/Tests/Server/Utils/StatusPageSubscriberWebhookPrivateNetwork.test.ts +119 -0
  289. package/Tests/Server/Utils/Telemetry/SourceMapResolver.test.ts +542 -0
  290. package/Tests/Server/Utils/TwoFactorBackupCodeNotification.test.ts +272 -0
  291. package/Tests/Server/Utils/VM/VMRunnerPrivateNetworkWiring.test.ts +111 -0
  292. package/Tests/Server/Utils/VendorAssets.test.ts +117 -0
  293. package/Tests/Server/Utils/Workspace/MicrosoftTeamsChannelSend.test.ts +101 -4
  294. package/Tests/Server/Utils/Workspace/MicrosoftTeamsInstallStateDiagnostics.test.ts +922 -0
  295. package/Tests/Server/Utils/Workspace/MicrosoftTeamsRosterDiagnosticMessages.test.ts +642 -0
  296. package/Tests/Server/Views/OnCallAcknowledgePage.test.ts +430 -0
  297. package/Tests/Types/API/HostnameAuthorityParsing.test.ts +1 -0
  298. package/Tests/Types/API/URLMailtoQueryString.test.ts +439 -0
  299. package/Tests/Types/API/URLQueryString.test.ts +481 -0
  300. package/Tests/Types/API/URLRouteQuerySeparation.test.ts +491 -0
  301. package/Tests/Types/BaseDatabase/Wildcard.test.ts +163 -0
  302. package/Tests/Types/BaseDatabase/WildcardPattern.test.ts +149 -0
  303. package/Tests/Types/Database/DateColumnValue.test.ts +265 -0
  304. package/Tests/Types/DateToIsoStringOrNull.test.ts +67 -0
  305. package/Tests/Types/Log/LogQueryToFilter.test.ts +218 -43
  306. package/Tests/Types/Monitor/KubernetesTemplateGroupByKeys.test.ts +225 -0
  307. package/Tests/Types/Monitor/TemplateGroupByKeys.test.ts +296 -0
  308. package/Tests/Types/NetworkAutomation/RuleRunResult.test.ts +102 -0
  309. package/Tests/Types/NetworkAutomation/RuleRunResultDescribe.test.ts +145 -0
  310. package/Tests/Types/NetworkSite/SiteHealthRollupPolicy.test.ts +58 -0
  311. package/Tests/Types/SerializableObjectDictionaryImportCycle.test.ts +15 -0
  312. package/Tests/Types/Telemetry/TelemetrySearchQuery.test.ts +620 -0
  313. package/Tests/Types/WhatsApp/WhatsAppTemplates.test.ts +110 -0
  314. package/Tests/Types/Workspace/NotificationRuleConditionUtil.test.ts +76 -6
  315. package/Tests/Types/Workspace/NotificationRules/NotificationRuleCondition.test.ts +16 -4
  316. package/Tests/Types/Workspace/NotificationRules/OnCallDutyPolicyConditions.test.ts +669 -0
  317. package/Tests/UI/Components/DictionaryFilterOperatorWildcard.test.ts +175 -0
  318. package/Tests/UI/Components/IconOpticalSize.test.tsx +377 -0
  319. package/Tests/UI/Components/LogsHistogramDragTooltip.test.tsx +393 -0
  320. package/Tests/UI/Components/LogsViewerHistogramZoom.test.tsx +248 -0
  321. package/Tests/UI/Components/TelemetryHistogramDragTooltip.test.tsx +205 -0
  322. package/Tests/UI/Components/UseHistogramZoom.test.tsx +262 -0
  323. package/Tests/UI/MicrosoftTeams/MicrosoftTeamsChatsCardInstallGuidance.test.tsx +332 -0
  324. package/Tests/UI/MicrosoftTeams/MicrosoftTeamsInstallGuidanceContent.test.tsx +643 -0
  325. package/Tests/Utils/Monitor/InterfaceInventoryUtil.test.ts +824 -0
  326. package/Tests/Utils/Monitor/NetworkDeviceMonitorTemplateUtil.test.ts +626 -0
  327. package/Tests/Utils/Monitor/NetworkTopologyUtil.test.ts +718 -0
  328. package/Tests/Utils/NetworkDevice/DeviceHealthStateUtil.test.ts +59 -0
  329. package/Tests/Utils/NetworkDiscovery/DiscoveredDeviceBuilder.test.ts +287 -2
  330. package/Tests/Utils/NetworkDiscovery/DiscoveryImportEligibility.test.ts +73 -0
  331. package/Tests/Utils/NetworkDiscovery/PingMonitorBuilder.test.ts +317 -0
  332. package/Tests/Utils/NetworkDiscovery/RescanIntervalUtil.test.ts +262 -0
  333. package/Tests/Utils/NetworkDiscovery/ScanModeUtil.test.ts +474 -0
  334. package/Tests/Utils/NetworkDiscovery/SnmpScanConfigUtil.test.ts +2442 -0
  335. package/Tests/Utils/NetworkSite/SiteMaintenanceUtil.test.ts +188 -0
  336. package/Tests/Utils/NetworkSite/SiteStatusRollupUtil.test.ts +522 -0
  337. package/Tests/Utils/NetworkSite/SiteUptimeUtil.test.ts +694 -0
  338. package/Tests/Utils/SecurityEvent/ThreatIntel/StixPatternParser.test.ts +281 -0
  339. package/Tests/Utils/Telemetry/CrossSignalScope.test.ts +87 -67
  340. package/Types/API/URL.ts +100 -28
  341. package/Types/AnalyticsDatabase/AnalyticsTableName.ts +8 -0
  342. package/Types/BaseDatabase/NotWildcard.ts +86 -0
  343. package/Types/BaseDatabase/Wildcard.ts +89 -0
  344. package/Types/BaseDatabase/WildcardPattern.ts +176 -0
  345. package/Types/Database/DateColumnValue.ts +184 -0
  346. package/Types/Database/TableColumn.ts +40 -5
  347. package/Types/Date.ts +37 -0
  348. package/Types/Email/EmailTemplateType.ts +1 -0
  349. package/Types/JSON.ts +8 -0
  350. package/Types/Log/LogQueryToFilter.ts +167 -129
  351. package/Types/Monitor/DockerAlertTemplates.ts +43 -12
  352. package/Types/Monitor/HostAlertTemplates.ts +31 -3
  353. package/Types/Monitor/KubernetesAlertTemplates.ts +98 -0
  354. package/Types/Monitor/MonitorStep.ts +49 -0
  355. package/Types/Monitor/PodmanAlertTemplates.ts +39 -12
  356. package/Types/Monitor/SnmpMonitor/CdpNeighbor.ts +14 -0
  357. package/Types/Monitor/SnmpMonitor/LldpNeighbor.ts +11 -0
  358. package/Types/Monitor/SnmpMonitor/NetworkTopology.ts +11 -4
  359. package/Types/NetworkAutomation/RuleRunResult.ts +191 -2
  360. package/Types/NetworkSite/SiteHealthRollupPolicy.ts +96 -0
  361. package/Types/Permission.ts +411 -0
  362. package/Types/Probe/ProbeApiIngestResponse.ts +42 -0
  363. package/Types/SecurityEvent/ThreatIntelConstants.ts +118 -0
  364. package/Types/SerializableObjectDictionary.ts +8 -0
  365. package/Types/Telemetry/SourceMap.ts +56 -0
  366. package/Types/Telemetry/TelemetrySearchQuery.ts +949 -0
  367. package/Types/Workspace/NotificationRules/NotificationRuleCondition.ts +12 -1
  368. package/UI/Components/Charts/Utils/useHistogramZoom.ts +101 -0
  369. package/UI/Components/Dictionary/DictionaryFilterOperator.ts +83 -0
  370. package/UI/Components/Icon/Icon.tsx +28 -1
  371. package/UI/Components/LogsViewer/LogsViewer.tsx +19 -3
  372. package/UI/Components/LogsViewer/components/LogSearchBar.tsx +26 -4
  373. package/UI/Components/LogsViewer/components/LogSearchHelp.tsx +34 -16
  374. package/UI/Components/LogsViewer/components/LogsHistogram.tsx +52 -1
  375. package/UI/Components/TelemetryViewer/TelemetryViewer.tsx +18 -2
  376. package/UI/Components/TelemetryViewer/components/TelemetryHistogram.tsx +52 -1
  377. package/UI/Components/TelemetryViewer/components/TelemetrySearchBar.tsx +15 -2
  378. package/Utils/Metrics/MetricExplorerUrl.ts +77 -15
  379. package/Utils/Monitor/InterfaceInventoryUtil.ts +251 -0
  380. package/Utils/Monitor/NetworkDeviceMonitorTemplateUtil.ts +333 -0
  381. package/Utils/Monitor/NetworkTopologyUtil.ts +249 -28
  382. package/Utils/NetworkDevice/DeviceHealthStateUtil.ts +14 -6
  383. package/Utils/NetworkDiscovery/AutoImportRuleMatcher.ts +2 -0
  384. package/Utils/NetworkDiscovery/DiscoveredDeviceBuilder.ts +49 -18
  385. package/Utils/NetworkDiscovery/PingMonitorBuilder.ts +215 -0
  386. package/Utils/NetworkDiscovery/RescanIntervalUtil.ts +148 -0
  387. package/Utils/NetworkDiscovery/ScanModeUtil.ts +105 -0
  388. package/Utils/NetworkDiscovery/SnmpScanConfigUtil.ts +827 -0
  389. package/Utils/NetworkSite/SiteMaintenanceUtil.ts +110 -0
  390. package/Utils/NetworkSite/SiteStatusRollupUtil.ts +350 -19
  391. package/Utils/NetworkSite/SiteUptimeUtil.ts +422 -21
  392. package/Utils/SecurityEvent/ThreatIntel/StixPatternParser.ts +383 -0
  393. package/Utils/Telemetry/CrossSignalScope.ts +37 -39
  394. package/build/dist/Models/AnalyticsModels/Index.js +2 -0
  395. package/build/dist/Models/AnalyticsModels/Index.js.map +1 -1
  396. package/build/dist/Models/AnalyticsModels/ThreatIntelIndicator.js +325 -0
  397. package/build/dist/Models/AnalyticsModels/ThreatIntelIndicator.js.map +1 -0
  398. package/build/dist/Models/DatabaseModels/AlertSeverity.js +4 -1
  399. package/build/dist/Models/DatabaseModels/AlertSeverity.js.map +1 -1
  400. package/build/dist/Models/DatabaseModels/CephClusterFeed.js +648 -0
  401. package/build/dist/Models/DatabaseModels/CephClusterFeed.js.map +1 -0
  402. package/build/dist/Models/DatabaseModels/CloudResourceFeed.js +648 -0
  403. package/build/dist/Models/DatabaseModels/CloudResourceFeed.js.map +1 -0
  404. package/build/dist/Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel.js +11 -0
  405. package/build/dist/Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel.js.map +1 -1
  406. package/build/dist/Models/DatabaseModels/DetectionRule.js +9 -3
  407. package/build/dist/Models/DatabaseModels/DetectionRule.js.map +1 -1
  408. package/build/dist/Models/DatabaseModels/DockerHostFeed.js +648 -0
  409. package/build/dist/Models/DatabaseModels/DockerHostFeed.js.map +1 -0
  410. package/build/dist/Models/DatabaseModels/DockerSwarmClusterFeed.js +648 -0
  411. package/build/dist/Models/DatabaseModels/DockerSwarmClusterFeed.js.map +1 -0
  412. package/build/dist/Models/DatabaseModels/GoogleSecOpsConnection.js +9 -3
  413. package/build/dist/Models/DatabaseModels/GoogleSecOpsConnection.js.map +1 -1
  414. package/build/dist/Models/DatabaseModels/HostFeed.js +648 -0
  415. package/build/dist/Models/DatabaseModels/HostFeed.js.map +1 -0
  416. package/build/dist/Models/DatabaseModels/IncidentSeverity.js +4 -1
  417. package/build/dist/Models/DatabaseModels/IncidentSeverity.js.map +1 -1
  418. package/build/dist/Models/DatabaseModels/Index.js +22 -0
  419. package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
  420. package/build/dist/Models/DatabaseModels/KubernetesClusterFeed.js +648 -0
  421. package/build/dist/Models/DatabaseModels/KubernetesClusterFeed.js.map +1 -0
  422. package/build/dist/Models/DatabaseModels/Monitor.js +81 -0
  423. package/build/dist/Models/DatabaseModels/Monitor.js.map +1 -1
  424. package/build/dist/Models/DatabaseModels/NetworkDevice.js +103 -7
  425. package/build/dist/Models/DatabaseModels/NetworkDevice.js.map +1 -1
  426. package/build/dist/Models/DatabaseModels/NetworkDeviceAutoImportRule.js +91 -6
  427. package/build/dist/Models/DatabaseModels/NetworkDeviceAutoImportRule.js.map +1 -1
  428. package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js +276 -31
  429. package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js.map +1 -1
  430. package/build/dist/Models/DatabaseModels/NetworkSite.js +124 -1
  431. package/build/dist/Models/DatabaseModels/NetworkSite.js.map +1 -1
  432. package/build/dist/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.js +1 -0
  433. package/build/dist/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.js.map +1 -1
  434. package/build/dist/Models/DatabaseModels/PodmanHostFeed.js +648 -0
  435. package/build/dist/Models/DatabaseModels/PodmanHostFeed.js.map +1 -0
  436. package/build/dist/Models/DatabaseModels/ProxmoxClusterFeed.js +648 -0
  437. package/build/dist/Models/DatabaseModels/ProxmoxClusterFeed.js.map +1 -0
  438. package/build/dist/Models/DatabaseModels/ScheduledMaintenance.js +66 -0
  439. package/build/dist/Models/DatabaseModels/ScheduledMaintenance.js.map +1 -1
  440. package/build/dist/Models/DatabaseModels/ServiceFeed.js +648 -0
  441. package/build/dist/Models/DatabaseModels/ServiceFeed.js.map +1 -0
  442. package/build/dist/Models/DatabaseModels/TelemetrySourceMap.js +496 -0
  443. package/build/dist/Models/DatabaseModels/TelemetrySourceMap.js.map +1 -0
  444. package/build/dist/Models/DatabaseModels/ThreatIntelFeed.js +800 -0
  445. package/build/dist/Models/DatabaseModels/ThreatIntelFeed.js.map +1 -0
  446. package/build/dist/Models/DatabaseModels/UserOnCallLog.js +1 -0
  447. package/build/dist/Models/DatabaseModels/UserOnCallLog.js.map +1 -1
  448. package/build/dist/Models/DatabaseModels/UserTotpAuth.js +1 -0
  449. package/build/dist/Models/DatabaseModels/UserTotpAuth.js.map +1 -1
  450. package/build/dist/Models/DatabaseModels/UserWebAuthn.js +1 -0
  451. package/build/dist/Models/DatabaseModels/UserWebAuthn.js.map +1 -1
  452. package/build/dist/Server/API/AlertAPI.js +18 -1
  453. package/build/dist/Server/API/AlertAPI.js.map +1 -1
  454. package/build/dist/Server/API/BaseAPI.js +8 -1
  455. package/build/dist/Server/API/BaseAPI.js.map +1 -1
  456. package/build/dist/Server/API/IncidentAPI.js +35 -1
  457. package/build/dist/Server/API/IncidentAPI.js.map +1 -1
  458. package/build/dist/Server/API/IncidentEpisodeAPI.js +18 -1
  459. package/build/dist/Server/API/IncidentEpisodeAPI.js.map +1 -1
  460. package/build/dist/Server/API/MicrosoftTeamsAPI.js +30 -2
  461. package/build/dist/Server/API/MicrosoftTeamsAPI.js.map +1 -1
  462. package/build/dist/Server/API/ScheduledMaintenanceAPI.js +18 -1
  463. package/build/dist/Server/API/ScheduledMaintenanceAPI.js.map +1 -1
  464. package/build/dist/Server/API/SlackAPI.js +45 -0
  465. package/build/dist/Server/API/SlackAPI.js.map +1 -1
  466. package/build/dist/Server/API/TelemetryAPI.js +100 -35
  467. package/build/dist/Server/API/TelemetryAPI.js.map +1 -1
  468. package/build/dist/Server/API/UserOnCallLogTimelineAPI.js +64 -59
  469. package/build/dist/Server/API/UserOnCallLogTimelineAPI.js.map +1 -1
  470. package/build/dist/Server/API/UserTotpAuthAPI.js +65 -1
  471. package/build/dist/Server/API/UserTotpAuthAPI.js.map +1 -1
  472. package/build/dist/Server/API/UserWebAuthnAPI.js +42 -1
  473. package/build/dist/Server/API/UserWebAuthnAPI.js.map +1 -1
  474. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787923136162-MigrationName.js +26 -0
  475. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787923136162-MigrationName.js.map +1 -0
  476. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789600000000-AddAutoProvisionedNetworkDeviceMonitors.js +22 -0
  477. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789600000000-AddAutoProvisionedNetworkDeviceMonitors.js.map +1 -0
  478. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789700000000-AddNetworkScaleIndexes.js +88 -0
  479. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789700000000-AddNetworkScaleIndexes.js.map +1 -0
  480. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789800000000-WidenSecurityEventLastErrorColumns.js +39 -0
  481. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789800000000-WidenSecurityEventLastErrorColumns.js.map +1 -0
  482. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789900000000-AddNetworkSiteRollupPolicyAndMaintenance.js +34 -0
  483. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789900000000-AddNetworkSiteRollupPolicyAndMaintenance.js.map +1 -0
  484. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790000000000-AddTelemetrySourceMap.js +32 -0
  485. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790000000000-AddTelemetrySourceMap.js.map +1 -0
  486. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790000000001-AddSnmpConfigsToNetworkDeviceDiscoveryScan.js +61 -0
  487. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790000000001-AddSnmpConfigsToNetworkDeviceDiscoveryScan.js.map +1 -0
  488. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790003445000-AddSnmpEnabledToNetworkDeviceDiscoveryScan.js +23 -0
  489. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790003445000-AddSnmpEnabledToNetworkDeviceDiscoveryScan.js.map +1 -0
  490. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790100000000-AddResourceActivityFeeds.js +179 -0
  491. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790100000000-AddResourceActivityFeeds.js.map +1 -0
  492. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +18 -0
  493. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
  494. package/build/dist/Server/Middleware/IdentityRateLimit.js +40 -3
  495. package/build/dist/Server/Middleware/IdentityRateLimit.js.map +1 -1
  496. package/build/dist/Server/Services/AIService.js +177 -30
  497. package/build/dist/Server/Services/AIService.js.map +1 -1
  498. package/build/dist/Server/Services/CephClusterFeedService.js +89 -0
  499. package/build/dist/Server/Services/CephClusterFeedService.js.map +1 -0
  500. package/build/dist/Server/Services/CephClusterLabelRuleEngineService.js +27 -3
  501. package/build/dist/Server/Services/CephClusterLabelRuleEngineService.js.map +1 -1
  502. package/build/dist/Server/Services/CephClusterOwnerRuleEngineService.js +21 -0
  503. package/build/dist/Server/Services/CephClusterOwnerRuleEngineService.js.map +1 -1
  504. package/build/dist/Server/Services/CephClusterOwnerTeamService.js +120 -0
  505. package/build/dist/Server/Services/CephClusterOwnerTeamService.js.map +1 -1
  506. package/build/dist/Server/Services/CephClusterOwnerUserService.js +113 -0
  507. package/build/dist/Server/Services/CephClusterOwnerUserService.js.map +1 -1
  508. package/build/dist/Server/Services/CephClusterService.js +175 -1
  509. package/build/dist/Server/Services/CephClusterService.js.map +1 -1
  510. package/build/dist/Server/Services/CloudResourceFeedService.js +89 -0
  511. package/build/dist/Server/Services/CloudResourceFeedService.js.map +1 -0
  512. package/build/dist/Server/Services/CloudResourceLabelRuleEngineService.js +27 -3
  513. package/build/dist/Server/Services/CloudResourceLabelRuleEngineService.js.map +1 -1
  514. package/build/dist/Server/Services/CloudResourceOwnerRuleEngineService.js +28 -3
  515. package/build/dist/Server/Services/CloudResourceOwnerRuleEngineService.js.map +1 -1
  516. package/build/dist/Server/Services/CloudResourceOwnerTeamService.js +120 -0
  517. package/build/dist/Server/Services/CloudResourceOwnerTeamService.js.map +1 -1
  518. package/build/dist/Server/Services/CloudResourceOwnerUserService.js +113 -0
  519. package/build/dist/Server/Services/CloudResourceOwnerUserService.js.map +1 -1
  520. package/build/dist/Server/Services/CloudResourceService.js +177 -1
  521. package/build/dist/Server/Services/CloudResourceService.js.map +1 -1
  522. package/build/dist/Server/Services/DatabaseService.js +201 -0
  523. package/build/dist/Server/Services/DatabaseService.js.map +1 -1
  524. package/build/dist/Server/Services/DockerHostFeedService.js +89 -0
  525. package/build/dist/Server/Services/DockerHostFeedService.js.map +1 -0
  526. package/build/dist/Server/Services/DockerHostLabelRuleEngineService.js +27 -3
  527. package/build/dist/Server/Services/DockerHostLabelRuleEngineService.js.map +1 -1
  528. package/build/dist/Server/Services/DockerHostOwnerRuleEngineService.js +21 -0
  529. package/build/dist/Server/Services/DockerHostOwnerRuleEngineService.js.map +1 -1
  530. package/build/dist/Server/Services/DockerHostOwnerTeamService.js +120 -0
  531. package/build/dist/Server/Services/DockerHostOwnerTeamService.js.map +1 -1
  532. package/build/dist/Server/Services/DockerHostOwnerUserService.js +113 -0
  533. package/build/dist/Server/Services/DockerHostOwnerUserService.js.map +1 -1
  534. package/build/dist/Server/Services/DockerHostService.js +177 -1
  535. package/build/dist/Server/Services/DockerHostService.js.map +1 -1
  536. package/build/dist/Server/Services/DockerSwarmClusterFeedService.js +90 -0
  537. package/build/dist/Server/Services/DockerSwarmClusterFeedService.js.map +1 -0
  538. package/build/dist/Server/Services/DockerSwarmClusterLabelRuleEngineService.js +27 -3
  539. package/build/dist/Server/Services/DockerSwarmClusterLabelRuleEngineService.js.map +1 -1
  540. package/build/dist/Server/Services/DockerSwarmClusterOwnerRuleEngineService.js +21 -0
  541. package/build/dist/Server/Services/DockerSwarmClusterOwnerRuleEngineService.js.map +1 -1
  542. package/build/dist/Server/Services/DockerSwarmClusterOwnerTeamService.js +120 -0
  543. package/build/dist/Server/Services/DockerSwarmClusterOwnerTeamService.js.map +1 -1
  544. package/build/dist/Server/Services/DockerSwarmClusterOwnerUserService.js +113 -0
  545. package/build/dist/Server/Services/DockerSwarmClusterOwnerUserService.js.map +1 -1
  546. package/build/dist/Server/Services/DockerSwarmClusterService.js +175 -1
  547. package/build/dist/Server/Services/DockerSwarmClusterService.js.map +1 -1
  548. package/build/dist/Server/Services/EnterpriseLicenseService.js +40 -30
  549. package/build/dist/Server/Services/EnterpriseLicenseService.js.map +1 -1
  550. package/build/dist/Server/Services/ExceptionAggregationService.js +8 -2
  551. package/build/dist/Server/Services/ExceptionAggregationService.js.map +1 -1
  552. package/build/dist/Server/Services/HostFeedService.js +89 -0
  553. package/build/dist/Server/Services/HostFeedService.js.map +1 -0
  554. package/build/dist/Server/Services/HostLabelRuleEngineService.js +27 -3
  555. package/build/dist/Server/Services/HostLabelRuleEngineService.js.map +1 -1
  556. package/build/dist/Server/Services/HostOwnerRuleEngineService.js +21 -0
  557. package/build/dist/Server/Services/HostOwnerRuleEngineService.js.map +1 -1
  558. package/build/dist/Server/Services/HostOwnerTeamService.js +120 -0
  559. package/build/dist/Server/Services/HostOwnerTeamService.js.map +1 -1
  560. package/build/dist/Server/Services/HostOwnerUserService.js +113 -0
  561. package/build/dist/Server/Services/HostOwnerUserService.js.map +1 -1
  562. package/build/dist/Server/Services/HostService.js +175 -1
  563. package/build/dist/Server/Services/HostService.js.map +1 -1
  564. package/build/dist/Server/Services/IncidentService.js +10 -0
  565. package/build/dist/Server/Services/IncidentService.js.map +1 -1
  566. package/build/dist/Server/Services/Index.js +24 -0
  567. package/build/dist/Server/Services/Index.js.map +1 -1
  568. package/build/dist/Server/Services/KubernetesClusterFeedService.js +89 -0
  569. package/build/dist/Server/Services/KubernetesClusterFeedService.js.map +1 -0
  570. package/build/dist/Server/Services/KubernetesClusterLabelRuleEngineService.js +27 -3
  571. package/build/dist/Server/Services/KubernetesClusterLabelRuleEngineService.js.map +1 -1
  572. package/build/dist/Server/Services/KubernetesClusterOwnerRuleEngineService.js +21 -0
  573. package/build/dist/Server/Services/KubernetesClusterOwnerRuleEngineService.js.map +1 -1
  574. package/build/dist/Server/Services/KubernetesClusterOwnerTeamService.js +120 -0
  575. package/build/dist/Server/Services/KubernetesClusterOwnerTeamService.js.map +1 -1
  576. package/build/dist/Server/Services/KubernetesClusterOwnerUserService.js +113 -0
  577. package/build/dist/Server/Services/KubernetesClusterOwnerUserService.js.map +1 -1
  578. package/build/dist/Server/Services/KubernetesClusterService.js +177 -1
  579. package/build/dist/Server/Services/KubernetesClusterService.js.map +1 -1
  580. package/build/dist/Server/Services/LogAggregationService.js +19 -196
  581. package/build/dist/Server/Services/LogAggregationService.js.map +1 -1
  582. package/build/dist/Server/Services/MetricAggregationService.js +59 -0
  583. package/build/dist/Server/Services/MetricAggregationService.js.map +1 -1
  584. package/build/dist/Server/Services/MonitorService.js +115 -13
  585. package/build/dist/Server/Services/MonitorService.js.map +1 -1
  586. package/build/dist/Server/Services/MonitorTemplateService.js +86 -0
  587. package/build/dist/Server/Services/MonitorTemplateService.js.map +1 -1
  588. package/build/dist/Server/Services/NetworkDeviceAutoImportRuleEngineService.js +561 -67
  589. package/build/dist/Server/Services/NetworkDeviceAutoImportRuleEngineService.js.map +1 -1
  590. package/build/dist/Server/Services/NetworkDeviceAutoImportRuleService.js +130 -16
  591. package/build/dist/Server/Services/NetworkDeviceAutoImportRuleService.js.map +1 -1
  592. package/build/dist/Server/Services/NetworkDeviceDiscoveryScanService.js +850 -8
  593. package/build/dist/Server/Services/NetworkDeviceDiscoveryScanService.js.map +1 -1
  594. package/build/dist/Server/Services/NetworkDeviceService.js +594 -5
  595. package/build/dist/Server/Services/NetworkDeviceService.js.map +1 -1
  596. package/build/dist/Server/Services/NetworkInterfaceService.js +306 -0
  597. package/build/dist/Server/Services/NetworkInterfaceService.js.map +1 -1
  598. package/build/dist/Server/Services/NetworkSiteService.js +408 -47
  599. package/build/dist/Server/Services/NetworkSiteService.js.map +1 -1
  600. package/build/dist/Server/Services/PodmanHostFeedService.js +89 -0
  601. package/build/dist/Server/Services/PodmanHostFeedService.js.map +1 -0
  602. package/build/dist/Server/Services/PodmanHostLabelRuleEngineService.js +27 -3
  603. package/build/dist/Server/Services/PodmanHostLabelRuleEngineService.js.map +1 -1
  604. package/build/dist/Server/Services/PodmanHostOwnerRuleEngineService.js +21 -0
  605. package/build/dist/Server/Services/PodmanHostOwnerRuleEngineService.js.map +1 -1
  606. package/build/dist/Server/Services/PodmanHostOwnerTeamService.js +120 -0
  607. package/build/dist/Server/Services/PodmanHostOwnerTeamService.js.map +1 -1
  608. package/build/dist/Server/Services/PodmanHostOwnerUserService.js +113 -0
  609. package/build/dist/Server/Services/PodmanHostOwnerUserService.js.map +1 -1
  610. package/build/dist/Server/Services/PodmanHostService.js +177 -1
  611. package/build/dist/Server/Services/PodmanHostService.js.map +1 -1
  612. package/build/dist/Server/Services/ProjectService.js +40 -30
  613. package/build/dist/Server/Services/ProjectService.js.map +1 -1
  614. package/build/dist/Server/Services/ProxmoxClusterFeedService.js +89 -0
  615. package/build/dist/Server/Services/ProxmoxClusterFeedService.js.map +1 -0
  616. package/build/dist/Server/Services/ProxmoxClusterLabelRuleEngineService.js +27 -3
  617. package/build/dist/Server/Services/ProxmoxClusterLabelRuleEngineService.js.map +1 -1
  618. package/build/dist/Server/Services/ProxmoxClusterOwnerRuleEngineService.js +21 -0
  619. package/build/dist/Server/Services/ProxmoxClusterOwnerRuleEngineService.js.map +1 -1
  620. package/build/dist/Server/Services/ProxmoxClusterOwnerTeamService.js +120 -0
  621. package/build/dist/Server/Services/ProxmoxClusterOwnerTeamService.js.map +1 -1
  622. package/build/dist/Server/Services/ProxmoxClusterOwnerUserService.js +113 -0
  623. package/build/dist/Server/Services/ProxmoxClusterOwnerUserService.js.map +1 -1
  624. package/build/dist/Server/Services/ProxmoxClusterService.js +175 -1
  625. package/build/dist/Server/Services/ProxmoxClusterService.js.map +1 -1
  626. package/build/dist/Server/Services/ScheduledMaintenanceStateTimelineService.js +56 -0
  627. package/build/dist/Server/Services/ScheduledMaintenanceStateTimelineService.js.map +1 -1
  628. package/build/dist/Server/Services/ServiceFeedService.js +89 -0
  629. package/build/dist/Server/Services/ServiceFeedService.js.map +1 -0
  630. package/build/dist/Server/Services/ServiceLabelRuleEngineService.js +27 -3
  631. package/build/dist/Server/Services/ServiceLabelRuleEngineService.js.map +1 -1
  632. package/build/dist/Server/Services/ServiceOwnerRuleEngineService.js +24 -0
  633. package/build/dist/Server/Services/ServiceOwnerRuleEngineService.js.map +1 -1
  634. package/build/dist/Server/Services/ServiceOwnerTeamService.js +120 -0
  635. package/build/dist/Server/Services/ServiceOwnerTeamService.js.map +1 -1
  636. package/build/dist/Server/Services/ServiceOwnerUserService.js +113 -0
  637. package/build/dist/Server/Services/ServiceOwnerUserService.js.map +1 -1
  638. package/build/dist/Server/Services/ServiceService.js +173 -2
  639. package/build/dist/Server/Services/ServiceService.js.map +1 -1
  640. package/build/dist/Server/Services/StatusPageSubscriberService.js +7 -0
  641. package/build/dist/Server/Services/StatusPageSubscriberService.js.map +1 -1
  642. package/build/dist/Server/Services/TelemetryAttributeService.js +9 -3
  643. package/build/dist/Server/Services/TelemetryAttributeService.js.map +1 -1
  644. package/build/dist/Server/Services/TelemetrySourceMapService.js +265 -0
  645. package/build/dist/Server/Services/TelemetrySourceMapService.js.map +1 -0
  646. package/build/dist/Server/Services/ThreatIntelFeedService.js +157 -0
  647. package/build/dist/Server/Services/ThreatIntelFeedService.js.map +1 -0
  648. package/build/dist/Server/Services/ThreatIntelIndicatorService.js +276 -0
  649. package/build/dist/Server/Services/ThreatIntelIndicatorService.js.map +1 -0
  650. package/build/dist/Server/Services/TraceAggregationService.js +62 -6
  651. package/build/dist/Server/Services/TraceAggregationService.js.map +1 -1
  652. package/build/dist/Server/Services/UserService.js +22 -13
  653. package/build/dist/Server/Services/UserService.js.map +1 -1
  654. package/build/dist/Server/Services/UserTwoFactorBackupCodeService.js +120 -0
  655. package/build/dist/Server/Services/UserTwoFactorBackupCodeService.js.map +1 -1
  656. package/build/dist/Server/Services/UserWebhookService.js +11 -2
  657. package/build/dist/Server/Services/UserWebhookService.js.map +1 -1
  658. package/build/dist/Server/Types/AnalyticsDatabase/ModelPermission.js +12 -1
  659. package/build/dist/Server/Types/AnalyticsDatabase/ModelPermission.js.map +1 -1
  660. package/build/dist/Server/Types/Database/AggregateBy.js +2 -0
  661. package/build/dist/Server/Types/Database/AggregateBy.js.map +1 -0
  662. package/build/dist/Server/Types/Database/AggregateResultUtil.js +90 -0
  663. package/build/dist/Server/Types/Database/AggregateResultUtil.js.map +1 -0
  664. package/build/dist/Server/Types/Database/JSONColumnQuery.js +14 -0
  665. package/build/dist/Server/Types/Database/JSONColumnQuery.js.map +1 -1
  666. package/build/dist/Server/Types/Database/QueryHelper.js +42 -0
  667. package/build/dist/Server/Types/Database/QueryHelper.js.map +1 -1
  668. package/build/dist/Server/Types/Database/QueryUtil.js +18 -0
  669. package/build/dist/Server/Types/Database/QueryUtil.js.map +1 -1
  670. package/build/dist/Server/Types/Workflow/Components/API/Utils.js +10 -1
  671. package/build/dist/Server/Types/Workflow/Components/API/Utils.js.map +1 -1
  672. package/build/dist/Server/Types/Workflow/Components/JavaScript.js +8 -0
  673. package/build/dist/Server/Types/Workflow/Components/JavaScript.js.map +1 -1
  674. package/build/dist/Server/Utils/AI/CodeFix/CodeFixAgentCompletion.js +8 -0
  675. package/build/dist/Server/Utils/AI/CodeFix/CodeFixAgentCompletion.js.map +1 -1
  676. package/build/dist/Server/Utils/AI/SRE/InvestigationGrader.js +15 -0
  677. package/build/dist/Server/Utils/AI/SRE/InvestigationGrader.js.map +1 -1
  678. package/build/dist/Server/Utils/AnalyticsDatabase/AttributeFilterStatement.js +266 -0
  679. package/build/dist/Server/Utils/AnalyticsDatabase/AttributeFilterStatement.js.map +1 -0
  680. package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js +134 -0
  681. package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js.map +1 -1
  682. package/build/dist/Server/Utils/DataSource/HttpFetch.js +8 -0
  683. package/build/dist/Server/Utils/DataSource/HttpFetch.js.map +1 -1
  684. package/build/dist/Server/Utils/Database/RelationIdUtil.js +31 -0
  685. package/build/dist/Server/Utils/Database/RelationIdUtil.js.map +1 -1
  686. package/build/dist/Server/Utils/Marketing/MarketingEventUtil.js +26 -8
  687. package/build/dist/Server/Utils/Marketing/MarketingEventUtil.js.map +1 -1
  688. package/build/dist/Server/Utils/Monitor/Criteria/ServerMonitorCriteria.js +42 -17
  689. package/build/dist/Server/Utils/Monitor/Criteria/ServerMonitorCriteria.js.map +1 -1
  690. package/build/dist/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.js +9 -1
  691. package/build/dist/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.js.map +1 -1
  692. package/build/dist/Server/Utils/Monitor/Criteria/SyntheticMonitor.js +15 -2
  693. package/build/dist/Server/Utils/Monitor/Criteria/SyntheticMonitor.js.map +1 -1
  694. package/build/dist/Server/Utils/Monitor/MonitorAlert.js +386 -271
  695. package/build/dist/Server/Utils/Monitor/MonitorAlert.js.map +1 -1
  696. package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +278 -64
  697. package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
  698. package/build/dist/Server/Utils/Monitor/MonitorIncident.js +469 -350
  699. package/build/dist/Server/Utils/Monitor/MonitorIncident.js.map +1 -1
  700. package/build/dist/Server/Utils/Monitor/MonitorResource.js +183 -44
  701. package/build/dist/Server/Utils/Monitor/MonitorResource.js.map +1 -1
  702. package/build/dist/Server/Utils/Monitor/NetworkDeviceWalkUtil.js +46 -3
  703. package/build/dist/Server/Utils/Monitor/NetworkDeviceWalkUtil.js.map +1 -1
  704. package/build/dist/Server/Utils/Monitor/NetworkInventoryUtil.js +18 -91
  705. package/build/dist/Server/Utils/Monitor/NetworkInventoryUtil.js.map +1 -1
  706. package/build/dist/Server/Utils/Monitor/PerEntityCriteriaFanOut.js +194 -0
  707. package/build/dist/Server/Utils/Monitor/PerEntityCriteriaFanOut.js.map +1 -0
  708. package/build/dist/Server/Utils/NetworkDevice/DeviceHealthAggregation.js +332 -0
  709. package/build/dist/Server/Utils/NetworkDevice/DeviceHealthAggregation.js.map +1 -0
  710. package/build/dist/Server/Utils/NetworkSite/NetworkSiteMaintenanceSuppression.js +279 -0
  711. package/build/dist/Server/Utils/NetworkSite/NetworkSiteMaintenanceSuppression.js.map +1 -0
  712. package/build/dist/Server/Utils/OnCallNotificationContext.js +415 -0
  713. package/build/dist/Server/Utils/OnCallNotificationContext.js.map +1 -0
  714. package/build/dist/Server/Utils/PrivateNetworkWebhookConfig.js +424 -0
  715. package/build/dist/Server/Utils/PrivateNetworkWebhookConfig.js.map +1 -0
  716. package/build/dist/Server/Utils/ResourceFeed/ResourceFeedUtil.js +108 -0
  717. package/build/dist/Server/Utils/ResourceFeed/ResourceFeedUtil.js.map +1 -0
  718. package/build/dist/Server/Utils/Response.js +12 -1
  719. package/build/dist/Server/Utils/Response.js.map +1 -1
  720. package/build/dist/Server/Utils/SSRFProtection.js +160 -58
  721. package/build/dist/Server/Utils/SSRFProtection.js.map +1 -1
  722. package/build/dist/Server/Utils/SecurityEvent/ConnectorErrorMessage.js +89 -0
  723. package/build/dist/Server/Utils/SecurityEvent/ConnectorErrorMessage.js.map +1 -0
  724. package/build/dist/Server/Utils/SecurityEvent/DetectionRuleEvaluator.js +75 -234
  725. package/build/dist/Server/Utils/SecurityEvent/DetectionRuleEvaluator.js.map +1 -1
  726. package/build/dist/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsPoller.js +41 -16
  727. package/build/dist/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsPoller.js.map +1 -1
  728. package/build/dist/Server/Utils/SecurityEvent/SecurityEventAlerting.js +217 -0
  729. package/build/dist/Server/Utils/SecurityEvent/SecurityEventAlerting.js.map +1 -0
  730. package/build/dist/Server/Utils/SecurityEvent/ThreatIntel/TaxiiClient.js +103 -0
  731. package/build/dist/Server/Utils/SecurityEvent/ThreatIntel/TaxiiClient.js.map +1 -0
  732. package/build/dist/Server/Utils/SecurityEvent/ThreatIntel/ThreatIntelEnricher.js +168 -0
  733. package/build/dist/Server/Utils/SecurityEvent/ThreatIntel/ThreatIntelEnricher.js.map +1 -0
  734. package/build/dist/Server/Utils/SecurityEvent/ThreatIntel/ThreatIntelFeedPoller.js +527 -0
  735. package/build/dist/Server/Utils/SecurityEvent/ThreatIntel/ThreatIntelFeedPoller.js.map +1 -0
  736. package/build/dist/Server/Utils/SecurityEvent/ThreatIntel/ThreatIntelMatcher.js +376 -0
  737. package/build/dist/Server/Utils/SecurityEvent/ThreatIntel/ThreatIntelMatcher.js.map +1 -0
  738. package/build/dist/Server/Utils/StartServer.js +70 -44
  739. package/build/dist/Server/Utils/StartServer.js.map +1 -1
  740. package/build/dist/Server/Utils/StatusPageSubscriberWebhook.js +3 -0
  741. package/build/dist/Server/Utils/StatusPageSubscriberWebhook.js.map +1 -1
  742. package/build/dist/Server/Utils/Telemetry/SourceMapResolver.js +327 -0
  743. package/build/dist/Server/Utils/Telemetry/SourceMapResolver.js.map +1 -0
  744. package/build/dist/Server/Utils/TwoFactorBackupCodeNotification.js +84 -0
  745. package/build/dist/Server/Utils/TwoFactorBackupCodeNotification.js.map +1 -0
  746. package/build/dist/Server/Utils/VM/VMAPI.js.map +1 -1
  747. package/build/dist/Server/Utils/VM/VMRunner.js +10 -1
  748. package/build/dist/Server/Utils/VM/VMRunner.js.map +1 -1
  749. package/build/dist/Server/Utils/VendorAssets.js +29 -0
  750. package/build/dist/Server/Utils/VendorAssets.js.map +1 -1
  751. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js +121 -6
  752. package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js.map +1 -1
  753. package/build/dist/Types/API/URL.js +88 -27
  754. package/build/dist/Types/API/URL.js.map +1 -1
  755. package/build/dist/Types/AnalyticsDatabase/AnalyticsTableName.js +8 -0
  756. package/build/dist/Types/AnalyticsDatabase/AnalyticsTableName.js.map +1 -1
  757. package/build/dist/Types/BaseDatabase/NotWildcard.js +72 -0
  758. package/build/dist/Types/BaseDatabase/NotWildcard.js.map +1 -0
  759. package/build/dist/Types/BaseDatabase/Wildcard.js +75 -0
  760. package/build/dist/Types/BaseDatabase/Wildcard.js.map +1 -0
  761. package/build/dist/Types/BaseDatabase/WildcardPattern.js +137 -0
  762. package/build/dist/Types/BaseDatabase/WildcardPattern.js.map +1 -0
  763. package/build/dist/Types/Database/DateColumnValue.js +125 -0
  764. package/build/dist/Types/Database/DateColumnValue.js.map +1 -0
  765. package/build/dist/Types/Database/TableColumn.js +18 -2
  766. package/build/dist/Types/Database/TableColumn.js.map +1 -1
  767. package/build/dist/Types/Date.js +31 -0
  768. package/build/dist/Types/Date.js.map +1 -1
  769. package/build/dist/Types/Email/EmailTemplateType.js +1 -0
  770. package/build/dist/Types/Email/EmailTemplateType.js.map +1 -1
  771. package/build/dist/Types/JSON.js +2 -0
  772. package/build/dist/Types/JSON.js.map +1 -1
  773. package/build/dist/Types/Log/LogQueryToFilter.js +111 -108
  774. package/build/dist/Types/Log/LogQueryToFilter.js.map +1 -1
  775. package/build/dist/Types/Monitor/DockerAlertTemplates.js +40 -16
  776. package/build/dist/Types/Monitor/DockerAlertTemplates.js.map +1 -1
  777. package/build/dist/Types/Monitor/HostAlertTemplates.js +29 -7
  778. package/build/dist/Types/Monitor/HostAlertTemplates.js.map +1 -1
  779. package/build/dist/Types/Monitor/KubernetesAlertTemplates.js +98 -4
  780. package/build/dist/Types/Monitor/KubernetesAlertTemplates.js.map +1 -1
  781. package/build/dist/Types/Monitor/MonitorStep.js +40 -0
  782. package/build/dist/Types/Monitor/MonitorStep.js.map +1 -1
  783. package/build/dist/Types/Monitor/PodmanAlertTemplates.js +36 -16
  784. package/build/dist/Types/Monitor/PodmanAlertTemplates.js.map +1 -1
  785. package/build/dist/Types/NetworkAutomation/RuleRunResult.js +90 -0
  786. package/build/dist/Types/NetworkAutomation/RuleRunResult.js.map +1 -1
  787. package/build/dist/Types/NetworkSite/SiteHealthRollupPolicy.js +84 -0
  788. package/build/dist/Types/NetworkSite/SiteHealthRollupPolicy.js.map +1 -0
  789. package/build/dist/Types/Permission.js +354 -0
  790. package/build/dist/Types/Permission.js.map +1 -1
  791. package/build/dist/Types/SecurityEvent/ThreatIntelConstants.js +100 -0
  792. package/build/dist/Types/SecurityEvent/ThreatIntelConstants.js.map +1 -0
  793. package/build/dist/Types/SerializableObjectDictionary.js +8 -0
  794. package/build/dist/Types/SerializableObjectDictionary.js.map +1 -1
  795. package/build/dist/Types/Telemetry/SourceMap.js +9 -0
  796. package/build/dist/Types/Telemetry/SourceMap.js.map +1 -0
  797. package/build/dist/Types/Telemetry/TelemetrySearchQuery.js +661 -0
  798. package/build/dist/Types/Telemetry/TelemetrySearchQuery.js.map +1 -0
  799. package/build/dist/Types/Workspace/NotificationRules/NotificationRuleCondition.js +12 -1
  800. package/build/dist/Types/Workspace/NotificationRules/NotificationRuleCondition.js.map +1 -1
  801. package/build/dist/UI/Components/Charts/Utils/useHistogramZoom.js +47 -0
  802. package/build/dist/UI/Components/Charts/Utils/useHistogramZoom.js.map +1 -0
  803. package/build/dist/UI/Components/Dictionary/DictionaryFilterOperator.js +67 -0
  804. package/build/dist/UI/Components/Dictionary/DictionaryFilterOperator.js.map +1 -1
  805. package/build/dist/UI/Components/Icon/Icon.js +28 -1
  806. package/build/dist/UI/Components/Icon/Icon.js.map +1 -1
  807. package/build/dist/UI/Components/LogsViewer/LogsViewer.js +15 -3
  808. package/build/dist/UI/Components/LogsViewer/LogsViewer.js.map +1 -1
  809. package/build/dist/UI/Components/LogsViewer/components/LogSearchBar.js +25 -4
  810. package/build/dist/UI/Components/LogsViewer/components/LogSearchBar.js.map +1 -1
  811. package/build/dist/UI/Components/LogsViewer/components/LogSearchHelp.js +36 -16
  812. package/build/dist/UI/Components/LogsViewer/components/LogSearchHelp.js.map +1 -1
  813. package/build/dist/UI/Components/LogsViewer/components/LogsHistogram.js +33 -5
  814. package/build/dist/UI/Components/LogsViewer/components/LogsHistogram.js.map +1 -1
  815. package/build/dist/UI/Components/TelemetryViewer/TelemetryViewer.js +14 -2
  816. package/build/dist/UI/Components/TelemetryViewer/TelemetryViewer.js.map +1 -1
  817. package/build/dist/UI/Components/TelemetryViewer/components/TelemetryHistogram.js +33 -5
  818. package/build/dist/UI/Components/TelemetryViewer/components/TelemetryHistogram.js.map +1 -1
  819. package/build/dist/UI/Components/TelemetryViewer/components/TelemetrySearchBar.js +14 -2
  820. package/build/dist/UI/Components/TelemetryViewer/components/TelemetrySearchBar.js.map +1 -1
  821. package/build/dist/Utils/Metrics/MetricExplorerUrl.js +54 -9
  822. package/build/dist/Utils/Metrics/MetricExplorerUrl.js.map +1 -1
  823. package/build/dist/Utils/Monitor/InterfaceInventoryUtil.js +128 -0
  824. package/build/dist/Utils/Monitor/InterfaceInventoryUtil.js.map +1 -0
  825. package/build/dist/Utils/Monitor/NetworkDeviceMonitorTemplateUtil.js +190 -0
  826. package/build/dist/Utils/Monitor/NetworkDeviceMonitorTemplateUtil.js.map +1 -0
  827. package/build/dist/Utils/Monitor/NetworkTopologyUtil.js +206 -28
  828. package/build/dist/Utils/Monitor/NetworkTopologyUtil.js.map +1 -1
  829. package/build/dist/Utils/NetworkDevice/DeviceHealthStateUtil.js +14 -7
  830. package/build/dist/Utils/NetworkDevice/DeviceHealthStateUtil.js.map +1 -1
  831. package/build/dist/Utils/NetworkDiscovery/AutoImportRuleMatcher.js.map +1 -1
  832. package/build/dist/Utils/NetworkDiscovery/DiscoveredDeviceBuilder.js +34 -18
  833. package/build/dist/Utils/NetworkDiscovery/DiscoveredDeviceBuilder.js.map +1 -1
  834. package/build/dist/Utils/NetworkDiscovery/PingMonitorBuilder.js +163 -0
  835. package/build/dist/Utils/NetworkDiscovery/PingMonitorBuilder.js.map +1 -0
  836. package/build/dist/Utils/NetworkDiscovery/RescanIntervalUtil.js +99 -0
  837. package/build/dist/Utils/NetworkDiscovery/RescanIntervalUtil.js.map +1 -0
  838. package/build/dist/Utils/NetworkDiscovery/ScanModeUtil.js +85 -0
  839. package/build/dist/Utils/NetworkDiscovery/ScanModeUtil.js.map +1 -0
  840. package/build/dist/Utils/NetworkDiscovery/SnmpScanConfigUtil.js +560 -0
  841. package/build/dist/Utils/NetworkDiscovery/SnmpScanConfigUtil.js.map +1 -0
  842. package/build/dist/Utils/NetworkSite/SiteMaintenanceUtil.js +56 -0
  843. package/build/dist/Utils/NetworkSite/SiteMaintenanceUtil.js.map +1 -0
  844. package/build/dist/Utils/NetworkSite/SiteStatusRollupUtil.js +185 -10
  845. package/build/dist/Utils/NetworkSite/SiteStatusRollupUtil.js.map +1 -1
  846. package/build/dist/Utils/NetworkSite/SiteUptimeUtil.js +248 -21
  847. package/build/dist/Utils/NetworkSite/SiteUptimeUtil.js.map +1 -1
  848. package/build/dist/Utils/SecurityEvent/ThreatIntel/StixPatternParser.js +255 -0
  849. package/build/dist/Utils/SecurityEvent/ThreatIntel/StixPatternParser.js.map +1 -0
  850. package/build/dist/Utils/Telemetry/CrossSignalScope.js +27 -30
  851. package/build/dist/Utils/Telemetry/CrossSignalScope.js.map +1 -1
  852. package/package.json +2 -1
  853. package/Tests/Types/Log/LogQueryParser.test.ts +0 -186
  854. package/Types/Log/LogQueryParser.ts +0 -252
  855. package/build/dist/Types/Log/LogQueryParser.js +0 -200
  856. package/build/dist/Types/Log/LogQueryParser.js.map +0 -1
@@ -0,0 +1,819 @@
1
+ import { generateKeyPairSync } from "crypto";
2
+ import GoogleSecOpsConnection from "../../../../Models/DatabaseModels/GoogleSecOpsConnection";
3
+ import GoogleSecOpsConnectionService from "../../../../Server/Services/GoogleSecOpsConnectionService";
4
+ import OTelIngestService, {
5
+ TelemetryServiceMetadata,
6
+ } from "../../../../Server/Services/OpenTelemetryIngestService";
7
+ import SecurityEventService from "../../../../Server/Services/SecurityEventService";
8
+ import logger from "../../../../Server/Utils/Logger";
9
+ import { MAX_CONNECTOR_ERROR_MESSAGE_LENGTH } from "../../../../Server/Utils/SecurityEvent/ConnectorErrorMessage";
10
+ import GoogleSecOpsClient, {
11
+ FetchLike,
12
+ FetchResponseLike,
13
+ } from "../../../../Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsClient";
14
+ import GoogleSecOpsPoller from "../../../../Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsPoller";
15
+ import { JSONObject } from "../../../../Types/JSON";
16
+ import ObjectID from "../../../../Types/ObjectID";
17
+ import ServiceType from "../../../../Types/Telemetry/ServiceType";
18
+ import { getJestSpyOn } from "../../../Spy";
19
+ import {
20
+ afterEach,
21
+ beforeAll,
22
+ beforeEach,
23
+ describe,
24
+ expect,
25
+ jest,
26
+ test,
27
+ } from "@jest/globals";
28
+
29
+ /*
30
+ * What `Last Error` on a Google SecOps connection actually means.
31
+ *
32
+ * The connections page and the integration doc both used to tell operators
33
+ * that Last Error "carries verbatim whatever the Chronicle API returned"
34
+ * and that a populated value means "the poll ran and Chronicle rejected
35
+ * it". Neither was true. pollAllDueConnections has exactly one catch block,
36
+ * and everything the poll can throw funnels through it: the OAuth token
37
+ * exchange against the service account's own token_uri (which happens
38
+ * before Chronicle is contacted at all), Chronicle's own rejection, the
39
+ * client's non-JSON-body guard, pollConnection's missing-field guard, and
40
+ * a telemetry-store write that fails AFTER a completely successful
41
+ * Chronicle fetch. Told "Chronicle rejected it", an operator staring at a
42
+ * ClickHouse outage would open a ticket with Google support.
43
+ *
44
+ * Both texts have been rewritten around a three-way split keyed on the
45
+ * message prefix:
46
+ *
47
+ * 1. `Google token exchange failed (HTTP ...)` — the credential was
48
+ * rejected at Google's OAuth endpoint, before Chronicle.
49
+ * 2. `Google SecOps alerts fetch failed (HTTP ...)` — Chronicle itself
50
+ * rejected the request.
51
+ * 3. anything else — the alerts came back and the failure was on
52
+ * OneUptime's side.
53
+ *
54
+ * This file pins that split so it stays true. Every case is driven through
55
+ * pollAllDueConnections with the REAL GoogleSecOpsClient over an injected
56
+ * transport, so the asserted string is the one an operator would read off
57
+ * the row rather than one this test invented. The two Google prefixes are
58
+ * likewise derived — the client is driven to failure with an empty body,
59
+ * which makes the message it throws be precisely its own prefix — so
60
+ * editing the template in GoogleSecOpsClient moves the expectation with it
61
+ * instead of silently invalidating a pasted literal.
62
+ */
63
+
64
+ const PROJECT_ID: ObjectID = new ObjectID(
65
+ "11111111-1111-4111-8111-111111111111",
66
+ );
67
+ const CONNECTION_ID: ObjectID = new ObjectID(
68
+ "22222222-2222-4222-8222-222222222222",
69
+ );
70
+
71
+ const INSTANCE_RESOURCE_NAME: string =
72
+ "projects/my-project/locations/us/instances/3f0a-instance";
73
+
74
+ /*
75
+ * Google's real OAuth endpoint, and the point of taxonomy bucket 1: this
76
+ * host is not Chronicle, and a failure here happens before a single byte
77
+ * is sent to Chronicle.
78
+ */
79
+ const GOOGLE_TOKEN_URI: string = "https://oauth2.googleapis.com/token";
80
+
81
+ /*
82
+ * A real RS256 key, because the client genuinely signs a JWT assertion on
83
+ * the way to the token endpoint; a fake key would fail inside jwt.sign and
84
+ * produce a completely different error than the one under test.
85
+ */
86
+ const { privateKey } = generateKeyPairSync("rsa", {
87
+ modulusLength: 2048,
88
+ privateKeyEncoding: { type: "pkcs8", format: "pem" },
89
+ publicKeyEncoding: { type: "spki", format: "pem" },
90
+ });
91
+
92
+ const SERVICE_ACCOUNT_JSON: string = JSON.stringify({
93
+ client_email: "poller@example.iam.gserviceaccount.com",
94
+ private_key: privateKey,
95
+ token_uri: GOOGLE_TOKEN_URI,
96
+ });
97
+
98
+ /*
99
+ * The statuses used both to DERIVE each prefix and to provoke each
100
+ * failure, so the derived prefix and the produced message agree on the
101
+ * HTTP status embedded in them.
102
+ */
103
+ const TOKEN_EXCHANGE_FAILURE_STATUS: number = 401;
104
+ const ALERTS_FETCH_FAILURE_STATUS: number = 403;
105
+
106
+ /*
107
+ * The bucket-3 failure the review surfaced: a telemetry-store write that
108
+ * blows up after Chronicle already answered. Shaped like a real ClickHouse
109
+ * error, which echoes the statement back.
110
+ */
111
+ const CLICKHOUSE_OUTAGE_MESSAGE: string =
112
+ "Code: 210. DB::NetException: Connection refused (clickhouse:9000). " +
113
+ "(NETWORK_ERROR) (version 24.3.1.1) while executing INSERT INTO " +
114
+ "oneuptime.SecurityEvent (projectId, time, classUid, ruleName) FORMAT JSONEachRow";
115
+
116
+ interface StubbedResponse {
117
+ status: number;
118
+ body: string;
119
+ }
120
+
121
+ interface RecordedRequest {
122
+ url: string;
123
+ method: string;
124
+ }
125
+
126
+ // The shape of one updateOneById call, for readable assertions.
127
+ interface ConnectionUpdateCall {
128
+ id: ObjectID;
129
+ data: JSONObject;
130
+ }
131
+
132
+ interface PollRun {
133
+ client: GoogleSecOpsClient;
134
+ requests: Array<RecordedRequest>;
135
+ updates: Array<ConnectionUpdateCall>;
136
+ insertedBatches: Array<Array<JSONObject>>;
137
+ }
138
+
139
+ /*
140
+ * Captured at import time, before any spy replaces it. pollAllDueConnections
141
+ * calls `this.pollConnection(connection)` with no client override, so the
142
+ * only way to put an injected transport under a full end-to-end tick is to
143
+ * spy on pollConnection and delegate straight back to the real, decorated
144
+ * implementation with a client attached. Everything inside pollConnection —
145
+ * the guard, the window arithmetic, the normalizer, the insert, the
146
+ * bookkeeping write — still runs for real.
147
+ */
148
+ const originalPollConnection: (
149
+ connection: GoogleSecOpsConnection,
150
+ clientOverride?: GoogleSecOpsClient | undefined,
151
+ ) => Promise<number> =
152
+ GoogleSecOpsPoller.pollConnection.bind(GoogleSecOpsPoller);
153
+
154
+ function makeConnection(): GoogleSecOpsConnection {
155
+ const connection: GoogleSecOpsConnection = new GoogleSecOpsConnection();
156
+ connection._id = CONNECTION_ID.toString();
157
+ connection.projectId = PROJECT_ID;
158
+ connection.name = "Prod tenant";
159
+ connection.region = "us";
160
+ connection.instanceResourceName = INSTANCE_RESOURCE_NAME;
161
+ connection.serviceAccountJson = SERVICE_ACCOUNT_JSON;
162
+ connection.pollIntervalInMinutes = 5;
163
+ // lastPolledAt left unset: never polled, therefore always due.
164
+ return connection;
165
+ }
166
+
167
+ function makeServiceMetadata(): TelemetryServiceMetadata {
168
+ return {
169
+ serviceName: "Google SecOps",
170
+ primaryEntityId: new ObjectID("33333333-3333-4333-8333-333333333333"),
171
+ primaryEntityType: ServiceType.OpenTelemetry,
172
+ dataRententionInDays: 15,
173
+ serviceRetentionConfig: null,
174
+ serviceRetentionInDays: null,
175
+ projectRetentionConfig: null,
176
+ projectRetentionInDays: 15,
177
+ };
178
+ }
179
+
180
+ function okTokenResponse(): StubbedResponse {
181
+ return {
182
+ status: 200,
183
+ body: JSON.stringify({ access_token: "test-token", expires_in: 3600 }),
184
+ };
185
+ }
186
+
187
+ /*
188
+ * One alert that the normalizer turns into a Detection Finding row, so the
189
+ * telemetry-store path is genuinely reached with something to write.
190
+ */
191
+ function alertsResponseWithOneAlert(): StubbedResponse {
192
+ return {
193
+ status: 200,
194
+ body: JSON.stringify({
195
+ alerts: [
196
+ {
197
+ id: "alert-1",
198
+ detection: [{ ruleName: "Brute force", severity: "HIGH" }],
199
+ },
200
+ ],
201
+ }),
202
+ };
203
+ }
204
+
205
+ /*
206
+ * Transport routed by URL rather than by call order, so a test can assert
207
+ * which Google endpoint was actually reached — the difference between
208
+ * taxonomy bucket 1 and bucket 2.
209
+ */
210
+ function makeFetch(responses: {
211
+ token: StubbedResponse;
212
+ alerts: StubbedResponse;
213
+ }): {
214
+ fetchImplementation: FetchLike;
215
+ requests: Array<RecordedRequest>;
216
+ } {
217
+ const requests: Array<RecordedRequest> = [];
218
+
219
+ const fetchImplementation: FetchLike = (
220
+ url: string,
221
+ init: {
222
+ method: string;
223
+ headers: Record<string, string>;
224
+ body?: string | undefined;
225
+ },
226
+ ): Promise<FetchResponseLike> => {
227
+ requests.push({ url: url, method: init.method });
228
+
229
+ const response: StubbedResponse =
230
+ url === GOOGLE_TOKEN_URI ? responses.token : responses.alerts;
231
+
232
+ return Promise.resolve({
233
+ ok: response.status >= 200 && response.status < 300,
234
+ status: response.status,
235
+ text: (): Promise<string> => {
236
+ return Promise.resolve(response.body);
237
+ },
238
+ });
239
+ };
240
+
241
+ return { fetchImplementation: fetchImplementation, requests: requests };
242
+ }
243
+
244
+ function makeClient(responses: {
245
+ token: StubbedResponse;
246
+ alerts: StubbedResponse;
247
+ }): { client: GoogleSecOpsClient; requests: Array<RecordedRequest> } {
248
+ const { fetchImplementation, requests } = makeFetch(responses);
249
+
250
+ const client: GoogleSecOpsClient = new GoogleSecOpsClient({
251
+ region: "us",
252
+ instanceResourceName: INSTANCE_RESOURCE_NAME,
253
+ serviceAccountJson: SERVICE_ACCOUNT_JSON,
254
+ fetchImplementation: fetchImplementation,
255
+ });
256
+
257
+ return { client: client, requests: requests };
258
+ }
259
+
260
+ /*
261
+ * Drive the real client to failure and hand back the message it threw.
262
+ * This is the derivation primitive: whatever GoogleSecOpsClient's error
263
+ * templates say today, that is what these tests assert against.
264
+ */
265
+ async function messageThrownByClient(responses: {
266
+ token: StubbedResponse;
267
+ alerts: StubbedResponse;
268
+ }): Promise<string> {
269
+ const { client } = makeClient(responses);
270
+
271
+ try {
272
+ await client.fetchDetectionAlerts({
273
+ startTime: new Date("2026-08-21T09:00:00.000Z"),
274
+ endTime: new Date("2026-08-21T10:00:00.000Z"),
275
+ });
276
+ } catch (error) {
277
+ return (error as Error).message;
278
+ }
279
+
280
+ throw new Error(
281
+ "GoogleSecOpsClient was expected to throw for this response fixture.",
282
+ );
283
+ }
284
+
285
+ /*
286
+ * The prefixes, derived rather than pasted.
287
+ *
288
+ * Both client templates are `<prefix>${responseText.slice(0, 500)}`, so
289
+ * driving the failure with an EMPTY response body makes the thrown message
290
+ * be exactly the prefix — trailing ": " and embedded HTTP status included.
291
+ */
292
+ let tokenExchangePrefix: string = "";
293
+ let alertsFetchPrefix: string = "";
294
+
295
+ /*
296
+ * The status-free half of each prefix ("Google token exchange failed",
297
+ * "Google SecOps alerts fetch failed"), split off structurally at the
298
+ * " (HTTP" the client itself inserts. This is what the rewritten guidance
299
+ * asks operators to read, and what the cross-check classifies on.
300
+ */
301
+ let tokenExchangeFamily: string = "";
302
+ let alertsFetchFamily: string = "";
303
+
304
+ // The client's own non-JSON guard message, likewise taken from the client.
305
+ let nonJsonBodyMessage: string = "";
306
+
307
+ // pollConnection's missing-field guard message, taken from the poller.
308
+ let missingFieldMessage: string = "";
309
+
310
+ function familyOf(prefix: string): string {
311
+ const httpMarkerIndex: number = prefix.indexOf(" (HTTP");
312
+
313
+ if (httpMarkerIndex === -1) {
314
+ return prefix.trim();
315
+ }
316
+
317
+ return prefix.slice(0, httpMarkerIndex);
318
+ }
319
+
320
+ /*
321
+ * The single rule the rewritten docs and the in-product help both hang on:
322
+ * does this message open with a prefix naming a Google request?
323
+ */
324
+ function carriesGoogleRequestPrefix(message: string): boolean {
325
+ return (
326
+ message.startsWith(tokenExchangeFamily) ||
327
+ message.startsWith(alertsFetchFamily)
328
+ );
329
+ }
330
+
331
+ beforeAll(async () => {
332
+ tokenExchangePrefix = await messageThrownByClient({
333
+ token: { status: TOKEN_EXCHANGE_FAILURE_STATUS, body: "" },
334
+ alerts: okTokenResponse(),
335
+ });
336
+
337
+ alertsFetchPrefix = await messageThrownByClient({
338
+ token: okTokenResponse(),
339
+ alerts: { status: ALERTS_FETCH_FAILURE_STATUS, body: "" },
340
+ });
341
+
342
+ nonJsonBodyMessage = await messageThrownByClient({
343
+ token: okTokenResponse(),
344
+ alerts: { status: 200, body: "<html><body>502 Bad Gateway</body></html>" },
345
+ });
346
+
347
+ tokenExchangeFamily = familyOf(tokenExchangePrefix);
348
+ alertsFetchFamily = familyOf(alertsFetchPrefix);
349
+
350
+ /*
351
+ * Derived by calling the real pollConnection with an incomplete row. The
352
+ * guard fires before any client is constructed, so no transport and no
353
+ * service stubs are involved.
354
+ */
355
+ const incomplete: GoogleSecOpsConnection = makeConnection();
356
+ delete incomplete.region;
357
+
358
+ let guardThrew: boolean = false;
359
+
360
+ try {
361
+ await originalPollConnection(incomplete, undefined);
362
+ } catch (error) {
363
+ guardThrew = true;
364
+ missingFieldMessage = (error as Error).message;
365
+ }
366
+
367
+ if (!guardThrew) {
368
+ throw new Error(
369
+ "pollConnection was expected to reject an incomplete connection.",
370
+ );
371
+ }
372
+ });
373
+
374
+ /*
375
+ * One full tick: findBy returns exactly this connection, the poll runs the
376
+ * real pollConnection against the injected transport, and every write is
377
+ * captured instead of performed.
378
+ */
379
+ async function runPollTick(options: {
380
+ connection: GoogleSecOpsConnection;
381
+ responses: { token: StubbedResponse; alerts: StubbedResponse };
382
+ insertJsonRows?: ((rows: Array<JSONObject>) => Promise<void>) | undefined;
383
+ }): Promise<PollRun> {
384
+ const updates: Array<ConnectionUpdateCall> = [];
385
+ const insertedBatches: Array<Array<JSONObject>> = [];
386
+
387
+ getJestSpyOn(GoogleSecOpsConnectionService, "findBy").mockResolvedValue([
388
+ options.connection,
389
+ ] as never);
390
+
391
+ getJestSpyOn(
392
+ GoogleSecOpsConnectionService,
393
+ "updateOneById",
394
+ ).mockImplementation(((call: ConnectionUpdateCall): Promise<void> => {
395
+ updates.push(call);
396
+ return Promise.resolve();
397
+ }) as never);
398
+
399
+ getJestSpyOn(OTelIngestService, "telemetryServiceFromName").mockResolvedValue(
400
+ makeServiceMetadata() as never,
401
+ );
402
+
403
+ getJestSpyOn(SecurityEventService, "insertJsonRows").mockImplementation(((
404
+ rows: Array<JSONObject>,
405
+ ): Promise<void> => {
406
+ insertedBatches.push(rows);
407
+
408
+ if (options.insertJsonRows) {
409
+ return options.insertJsonRows(rows);
410
+ }
411
+
412
+ return Promise.resolve();
413
+ }) as never);
414
+
415
+ const { client, requests } = makeClient(options.responses);
416
+
417
+ getJestSpyOn(GoogleSecOpsPoller, "pollConnection").mockImplementation(((
418
+ connection: GoogleSecOpsConnection,
419
+ ): Promise<number> => {
420
+ return originalPollConnection(connection, client);
421
+ }) as never);
422
+
423
+ await GoogleSecOpsPoller.pollAllDueConnections();
424
+
425
+ return {
426
+ client: client,
427
+ requests: requests,
428
+ updates: updates,
429
+ insertedBatches: insertedBatches,
430
+ };
431
+ }
432
+
433
+ /*
434
+ * The one value an operator reads off the row. Every case asserts that a
435
+ * single bookkeeping write happened and that it stamped lastPolledAt —
436
+ * a failure with no stamp is the silent-connector outage all over again.
437
+ */
438
+ function recordedLastError(run: PollRun): string {
439
+ expect(run.updates).toHaveLength(1);
440
+ expect(run.updates[0]!.id.toString()).toBe(CONNECTION_ID.toString());
441
+ expect(run.updates[0]!.data["lastPolledAt"]).toBeInstanceOf(Date);
442
+
443
+ const lastError: unknown = run.updates[0]!.data["lastError"];
444
+ expect(typeof lastError).toBe("string");
445
+
446
+ // Whatever it says, it must still fit the column the clamp exists for.
447
+ expect((lastError as string).length).toBeLessThanOrEqual(
448
+ MAX_CONNECTOR_ERROR_MESSAGE_LENGTH,
449
+ );
450
+
451
+ return lastError as string;
452
+ }
453
+
454
+ async function tokenExchangeFailureRun(): Promise<PollRun> {
455
+ return runPollTick({
456
+ connection: makeConnection(),
457
+ responses: {
458
+ token: {
459
+ status: TOKEN_EXCHANGE_FAILURE_STATUS,
460
+ body: JSON.stringify({
461
+ error: "invalid_grant",
462
+ error_description: "Invalid JWT Signature.",
463
+ }),
464
+ },
465
+ alerts: alertsResponseWithOneAlert(),
466
+ },
467
+ });
468
+ }
469
+
470
+ async function alertsFetchFailureRun(): Promise<PollRun> {
471
+ return runPollTick({
472
+ connection: makeConnection(),
473
+ responses: {
474
+ token: okTokenResponse(),
475
+ alerts: {
476
+ status: ALERTS_FETCH_FAILURE_STATUS,
477
+ body: JSON.stringify({
478
+ error: {
479
+ code: ALERTS_FETCH_FAILURE_STATUS,
480
+ status: "PERMISSION_DENIED",
481
+ message:
482
+ "Caller does not have permission 'chronicle.legacies.legacyFetchAlertsView'.",
483
+ },
484
+ }),
485
+ },
486
+ },
487
+ });
488
+ }
489
+
490
+ async function telemetryStoreFailureRun(): Promise<PollRun> {
491
+ return runPollTick({
492
+ connection: makeConnection(),
493
+ responses: {
494
+ token: okTokenResponse(),
495
+ alerts: alertsResponseWithOneAlert(),
496
+ },
497
+ insertJsonRows: (): Promise<void> => {
498
+ return Promise.reject(new Error(CLICKHOUSE_OUTAGE_MESSAGE));
499
+ },
500
+ });
501
+ }
502
+
503
+ async function nonJsonBodyRun(): Promise<PollRun> {
504
+ return runPollTick({
505
+ connection: makeConnection(),
506
+ responses: {
507
+ token: okTokenResponse(),
508
+ alerts: {
509
+ status: 200,
510
+ body: "<html><body>502 Bad Gateway</body></html>",
511
+ },
512
+ },
513
+ });
514
+ }
515
+
516
+ async function missingFieldRun(): Promise<PollRun> {
517
+ const incomplete: GoogleSecOpsConnection = makeConnection();
518
+ delete incomplete.region;
519
+
520
+ return runPollTick({
521
+ connection: incomplete,
522
+ responses: {
523
+ token: okTokenResponse(),
524
+ alerts: alertsResponseWithOneAlert(),
525
+ },
526
+ });
527
+ }
528
+
529
+ describe("GoogleSecOpsPoller lastError failure taxonomy", () => {
530
+ beforeEach(() => {
531
+ // Every test here drives an expected failure down the logging path.
532
+ getJestSpyOn(logger, "error").mockImplementation((() => {
533
+ return undefined;
534
+ }) as never);
535
+ });
536
+
537
+ afterEach(() => {
538
+ jest.restoreAllMocks();
539
+ });
540
+
541
+ test("the derived prefixes really are prefixes, and really do differ", () => {
542
+ /*
543
+ * Guards the derivation itself. If GoogleSecOpsClient ever stops
544
+ * putting a distinguishable, status-bearing prefix in front of the
545
+ * echoed body, the whole taxonomy the guidance promises collapses and
546
+ * this is where it shows up first.
547
+ */
548
+ expect(tokenExchangePrefix.length).toBeGreaterThan(0);
549
+ expect(alertsFetchPrefix.length).toBeGreaterThan(0);
550
+ expect(tokenExchangePrefix).not.toBe(alertsFetchPrefix);
551
+
552
+ // The statuses used to provoke each failure are inside each prefix.
553
+ expect(tokenExchangePrefix).toContain(
554
+ String(TOKEN_EXCHANGE_FAILURE_STATUS),
555
+ );
556
+ expect(alertsFetchPrefix).toContain(String(ALERTS_FETCH_FAILURE_STATUS));
557
+
558
+ /*
559
+ * Neither family is a prefix of the other, so "read the prefix first"
560
+ * is an unambiguous instruction rather than a coin flip.
561
+ */
562
+ expect(tokenExchangeFamily.startsWith(alertsFetchFamily)).toBe(false);
563
+ expect(alertsFetchFamily.startsWith(tokenExchangeFamily)).toBe(false);
564
+ });
565
+
566
+ /*
567
+ * Bucket 1. The credential is rejected at oauth2.googleapis.com — the
568
+ * token_uri out of the customer's own service-account JSON — before a
569
+ * single request is made to Chronicle. This is exactly why the rewritten
570
+ * guidance tells operators to read the prefix first: the old text sent
571
+ * whoever saw this to Chronicle's permissions, when the key itself is
572
+ * what Google refused.
573
+ */
574
+ test("a token-exchange failure is recorded under the token-exchange prefix, before Chronicle is contacted", async () => {
575
+ const run: PollRun = await tokenExchangeFailureRun();
576
+ const lastError: string = recordedLastError(run);
577
+
578
+ expect(lastError.startsWith(tokenExchangePrefix)).toBe(true);
579
+ expect(lastError.startsWith(alertsFetchPrefix)).toBe(false);
580
+
581
+ // The echoed OAuth body rides along behind the prefix.
582
+ expect(lastError).toContain("invalid_grant");
583
+
584
+ /*
585
+ * The load-bearing half: only Google's OAuth host was called. Nothing
586
+ * went to the Chronicle base URL, so "Chronicle rejected it" would
587
+ * have been a flatly false thing to tell this operator.
588
+ */
589
+ expect(run.requests).toHaveLength(1);
590
+ expect(run.requests[0]!.url).toBe(GOOGLE_TOKEN_URI);
591
+ expect(
592
+ run.requests.some((request: RecordedRequest): boolean => {
593
+ return request.url.startsWith(run.client.getApiBaseUrl());
594
+ }),
595
+ ).toBe(false);
596
+
597
+ // Nothing was ingested, so the cursor must not have moved.
598
+ expect(run.insertedBatches).toHaveLength(0);
599
+ expect(
600
+ Object.prototype.hasOwnProperty.call(run.updates[0]!.data, "cursor"),
601
+ ).toBe(false);
602
+ });
603
+
604
+ /*
605
+ * Bucket 2: the only case the old text described correctly. The token
606
+ * exchange succeeded, the request reached Chronicle, and Chronicle said
607
+ * no.
608
+ */
609
+ test("an alerts-fetch failure is recorded under the alerts-fetch prefix", async () => {
610
+ const run: PollRun = await alertsFetchFailureRun();
611
+ const lastError: string = recordedLastError(run);
612
+
613
+ expect(lastError.startsWith(alertsFetchPrefix)).toBe(true);
614
+ expect(lastError.startsWith(tokenExchangePrefix)).toBe(false);
615
+ expect(lastError).toContain("PERMISSION_DENIED");
616
+
617
+ // Token endpoint first, then Chronicle: the failure is genuinely theirs.
618
+ expect(run.requests).toHaveLength(2);
619
+ expect(run.requests[0]!.url).toBe(GOOGLE_TOKEN_URI);
620
+ expect(run.requests[1]!.url.startsWith(run.client.getApiBaseUrl())).toBe(
621
+ true,
622
+ );
623
+
624
+ expect(run.insertedBatches).toHaveLength(0);
625
+ expect(
626
+ Object.prototype.hasOwnProperty.call(run.updates[0]!.data, "cursor"),
627
+ ).toBe(false);
628
+ });
629
+
630
+ /*
631
+ * Bucket 3, and the reason the guidance was rewritten at all.
632
+ *
633
+ * Chronicle answered perfectly: the token was issued, the alerts came
634
+ * back, the normalizer produced a row. The poll then died writing that
635
+ * row to the telemetry store — a OneUptime-side outage that lands in
636
+ * lastError through the same catch block as everything above. An
637
+ * operator told "the poll ran and Chronicle rejected it" would take a
638
+ * ClickHouse outage to Google support.
639
+ */
640
+ test("a telemetry-store failure is recorded with NO Google prefix, and does not advance the cursor", async () => {
641
+ const run: PollRun = await telemetryStoreFailureRun();
642
+ const lastError: string = recordedLastError(run);
643
+
644
+ // The alerts really did arrive — both Google calls succeeded...
645
+ expect(run.requests).toHaveLength(2);
646
+ expect(run.requests[0]!.url).toBe(GOOGLE_TOKEN_URI);
647
+ expect(run.requests[1]!.url.startsWith(run.client.getApiBaseUrl())).toBe(
648
+ true,
649
+ );
650
+
651
+ // ...and a row was built and handed to the store before it blew up.
652
+ expect(run.insertedBatches).toHaveLength(1);
653
+ expect(run.insertedBatches[0]).toHaveLength(1);
654
+ expect(run.insertedBatches[0]![0]!["className"]).toBe("Detection Finding");
655
+
656
+ // The third bullet's promise, stated exactly.
657
+ expect(carriesGoogleRequestPrefix(lastError)).toBe(false);
658
+ expect(lastError).toContain("clickhouse");
659
+ expect(lastError).toBe(CLICKHOUSE_OUTAGE_MESSAGE);
660
+
661
+ /*
662
+ * And the durability half. pollConnection writes lastPolledAt, cursor
663
+ * and a cleared lastError together at the very end, so a throw from
664
+ * insertJsonRows skips all three; the catch block's bookkeeping write
665
+ * carries lastPolledAt and lastError only. The cursor therefore stays
666
+ * where it was and the same window is re-fetched next tick, which is
667
+ * the correct outcome for alerts that were never durably ingested.
668
+ */
669
+ expect(
670
+ Object.prototype.hasOwnProperty.call(run.updates[0]!.data, "cursor"),
671
+ ).toBe(false);
672
+ expect(Object.keys(run.updates[0]!.data).sort()).toEqual([
673
+ "lastError",
674
+ "lastPolledAt",
675
+ ]);
676
+ });
677
+
678
+ /*
679
+ * The client's own non-JSON guard. Chronicle returned a 2xx with an HTML
680
+ * error page in it — a proxy or gateway between the poller and Chronicle
681
+ * is the usual cause — so there is no HTTP status to prefix with and the
682
+ * message carries neither Google request prefix.
683
+ */
684
+ test("a non-JSON alerts body reaches lastError with no HTTP-status prefix", async () => {
685
+ const run: PollRun = await nonJsonBodyRun();
686
+ const lastError: string = recordedLastError(run);
687
+
688
+ // Byte-for-byte the client's own guard message, derived from it above.
689
+ expect(lastError).toBe(nonJsonBodyMessage);
690
+
691
+ // No status-bearing prefix, because there was no failing status.
692
+ expect(lastError.startsWith(tokenExchangePrefix)).toBe(false);
693
+ expect(lastError.startsWith(alertsFetchPrefix)).toBe(false);
694
+ expect(lastError).not.toContain("(HTTP");
695
+
696
+ // The request did reach Chronicle; the body it returned was unusable.
697
+ expect(run.requests).toHaveLength(2);
698
+ expect(run.insertedBatches).toHaveLength(0);
699
+ });
700
+
701
+ /*
702
+ * pollConnection's own precondition. A connection row missing region (or
703
+ * projectId, or credentials) never reaches Google at all, and its
704
+ * message is written by the poller rather than by any API — so it is a
705
+ * OneUptime-side message by construction.
706
+ */
707
+ test("the missing-field guard is recorded through the same path when a row is incomplete", async () => {
708
+ const run: PollRun = await missingFieldRun();
709
+ const lastError: string = recordedLastError(run);
710
+
711
+ // Exactly the guard's own text, derived from the poller in beforeAll.
712
+ expect(lastError).toBe(missingFieldMessage);
713
+ expect(carriesGoogleRequestPrefix(lastError)).toBe(false);
714
+
715
+ /*
716
+ * The trap in this one. The guard's own wording opens with the words
717
+ * "Google SecOps", so an operator skimming for "does this start with
718
+ * something about Google" can misfile it as a Chronicle problem — it
719
+ * is not, and no request ever left the process. Only the full request
720
+ * prefixes classify correctly, which is why the guidance names them in
721
+ * full rather than saying "a Google-looking message".
722
+ */
723
+ expect(lastError.startsWith("Google")).toBe(true);
724
+ expect(lastError.startsWith(alertsFetchFamily)).toBe(false);
725
+ expect(lastError.startsWith(tokenExchangeFamily)).toBe(false);
726
+
727
+ // Not one request left the process.
728
+ expect(run.requests).toHaveLength(0);
729
+ expect(run.insertedBatches).toHaveLength(0);
730
+ });
731
+
732
+ /*
733
+ * The cross-check that turns the docs' three-way split from an assertion
734
+ * into a verified property: run every failure the catch block can see,
735
+ * collect what each one actually stored, and check the classification in
736
+ * one place.
737
+ *
738
+ * Note the non-JSON-body row. It originates at Chronicle, yet it carries
739
+ * no Google request prefix, so the guidance's rule files it under
740
+ * "anything else" alongside the genuinely OneUptime-side failures. It is
741
+ * still distinguishable — it names the alerts fetch and carries no HTTP
742
+ * status — but it is the one case where "anything else means the alerts
743
+ * came back fine" over-reaches, and it is pinned here so that stays
744
+ * visible rather than being discovered by an operator.
745
+ */
746
+ test("exactly the HTTP failures at Google carry a Google prefix; the OneUptime-side ones do not", async () => {
747
+ const cases: Array<{
748
+ label: string;
749
+ lastError: string;
750
+ expectedGooglePrefix: boolean;
751
+ }> = [
752
+ {
753
+ label: "token exchange rejected at Google OAuth",
754
+ lastError: recordedLastError(await tokenExchangeFailureRun()),
755
+ expectedGooglePrefix: true,
756
+ },
757
+ {
758
+ label: "alerts fetch rejected by Chronicle",
759
+ lastError: recordedLastError(await alertsFetchFailureRun()),
760
+ expectedGooglePrefix: true,
761
+ },
762
+ {
763
+ label: "telemetry store rejected the write after a good fetch",
764
+ lastError: recordedLastError(await telemetryStoreFailureRun()),
765
+ expectedGooglePrefix: false,
766
+ },
767
+ {
768
+ label: "connection row missing required fields",
769
+ lastError: recordedLastError(await missingFieldRun()),
770
+ expectedGooglePrefix: false,
771
+ },
772
+ {
773
+ label: "non-JSON body from the alerts endpoint",
774
+ lastError: recordedLastError(await nonJsonBodyRun()),
775
+ expectedGooglePrefix: false,
776
+ },
777
+ ];
778
+
779
+ expect(
780
+ cases.map(
781
+ (item: {
782
+ label: string;
783
+ lastError: string;
784
+ expectedGooglePrefix: boolean;
785
+ }): { label: string; carriesGooglePrefix: boolean } => {
786
+ return {
787
+ label: item.label,
788
+ carriesGooglePrefix: carriesGoogleRequestPrefix(item.lastError),
789
+ };
790
+ },
791
+ ),
792
+ ).toEqual(
793
+ cases.map(
794
+ (item: {
795
+ label: string;
796
+ lastError: string;
797
+ expectedGooglePrefix: boolean;
798
+ }): { label: string; carriesGooglePrefix: boolean } => {
799
+ return {
800
+ label: item.label,
801
+ carriesGooglePrefix: item.expectedGooglePrefix,
802
+ };
803
+ },
804
+ ),
805
+ );
806
+
807
+ /*
808
+ * And the messages are all distinct, so the taxonomy is actually
809
+ * partitioning five different failures rather than collapsing some of
810
+ * them into one indistinguishable string.
811
+ */
812
+ const distinct: Set<string> = new Set(
813
+ cases.map((item: { lastError: string }): string => {
814
+ return item.lastError;
815
+ }),
816
+ );
817
+ expect(distinct.size).toBe(cases.length);
818
+ });
819
+ });