@oneuptime/common 12.0.25 → 12.0.26
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.
- package/Models/AnalyticsModels/Index.ts +2 -0
- package/Models/AnalyticsModels/ThreatIntelIndicator.ts +413 -0
- package/Models/DatabaseModels/AlertSeverity.ts +4 -1
- package/Models/DatabaseModels/CephClusterFeed.ts +625 -0
- package/Models/DatabaseModels/CloudResourceFeed.ts +625 -0
- package/Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel.ts +13 -0
- package/Models/DatabaseModels/DetectionRule.ts +9 -3
- package/Models/DatabaseModels/DockerHostFeed.ts +625 -0
- package/Models/DatabaseModels/DockerSwarmClusterFeed.ts +628 -0
- package/Models/DatabaseModels/GoogleSecOpsConnection.ts +9 -3
- package/Models/DatabaseModels/HostFeed.ts +625 -0
- package/Models/DatabaseModels/IncidentSeverity.ts +4 -1
- package/Models/DatabaseModels/Index.ts +22 -0
- package/Models/DatabaseModels/KubernetesClusterFeed.ts +628 -0
- package/Models/DatabaseModels/Monitor.ts +87 -0
- package/Models/DatabaseModels/NetworkDevice.ts +96 -5
- package/Models/DatabaseModels/NetworkDeviceAutoImportRule.ts +92 -6
- package/Models/DatabaseModels/NetworkDeviceDiscoveryScan.ts +301 -31
- package/Models/DatabaseModels/NetworkSite.ts +120 -0
- package/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.ts +1 -0
- package/Models/DatabaseModels/PodmanHostFeed.ts +625 -0
- package/Models/DatabaseModels/ProxmoxClusterFeed.ts +626 -0
- package/Models/DatabaseModels/ScheduledMaintenance.ts +67 -0
- package/Models/DatabaseModels/ServiceFeed.ts +625 -0
- package/Models/DatabaseModels/TelemetrySourceMap.ts +474 -0
- package/Models/DatabaseModels/ThreatIntelFeed.ts +758 -0
- package/Models/DatabaseModels/UserOnCallLog.ts +1 -0
- package/Models/DatabaseModels/UserTotpAuth.ts +1 -0
- package/Models/DatabaseModels/UserWebAuthn.ts +1 -0
- package/Server/API/AlertAPI.ts +23 -1
- package/Server/API/BaseAPI.ts +14 -3
- package/Server/API/IncidentAPI.ts +41 -1
- package/Server/API/IncidentEpisodeAPI.ts +23 -1
- package/Server/API/MicrosoftTeamsAPI.ts +31 -2
- package/Server/API/ScheduledMaintenanceAPI.ts +23 -1
- package/Server/API/SlackAPI.ts +48 -0
- package/Server/API/TelemetryAPI.ts +167 -42
- package/Server/API/UserOnCallLogTimelineAPI.ts +75 -61
- package/Server/API/UserTotpAuthAPI.ts +67 -1
- package/Server/API/UserWebAuthnAPI.ts +44 -1
- package/Server/Infrastructure/Postgres/SchemaMigrations/1787923136162-MigrationName.ts +57 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1789600000000-AddAutoProvisionedNetworkDeviceMonitors.ts +49 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1789700000000-AddNetworkScaleIndexes.ts +129 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1789800000000-WidenSecurityEventLastErrorColumns.ts +54 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1789900000000-AddNetworkSiteRollupPolicyAndMaintenance.ts +64 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1790000000000-AddTelemetrySourceMap.ts +64 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1790000000001-AddSnmpConfigsToNetworkDeviceDiscoveryScan.ts +72 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1790003445000-AddSnmpEnabledToNetworkDeviceDiscoveryScan.ts +31 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1790100000000-AddResourceActivityFeeds.ts +489 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +18 -0
- package/Server/Middleware/IdentityRateLimit.ts +53 -3
- package/Server/Services/AIService.ts +181 -41
- package/Server/Services/CephClusterFeedService.ts +99 -0
- package/Server/Services/CephClusterLabelRuleEngineService.ts +29 -0
- package/Server/Services/CephClusterOwnerRuleEngineService.ts +23 -0
- package/Server/Services/CephClusterOwnerTeamService.ts +129 -0
- package/Server/Services/CephClusterOwnerUserService.ts +123 -0
- package/Server/Services/CephClusterService.ts +223 -2
- package/Server/Services/CloudResourceFeedService.ts +99 -0
- package/Server/Services/CloudResourceLabelRuleEngineService.ts +30 -0
- package/Server/Services/CloudResourceOwnerRuleEngineService.ts +33 -0
- package/Server/Services/CloudResourceOwnerTeamService.ts +129 -0
- package/Server/Services/CloudResourceOwnerUserService.ts +123 -0
- package/Server/Services/CloudResourceService.ts +227 -2
- package/Server/Services/DatabaseService.ts +265 -0
- package/Server/Services/DockerHostFeedService.ts +99 -0
- package/Server/Services/DockerHostLabelRuleEngineService.ts +29 -0
- package/Server/Services/DockerHostOwnerRuleEngineService.ts +23 -0
- package/Server/Services/DockerHostOwnerTeamService.ts +129 -0
- package/Server/Services/DockerHostOwnerUserService.ts +123 -0
- package/Server/Services/DockerHostService.ts +227 -2
- package/Server/Services/DockerSwarmClusterFeedService.ts +102 -0
- package/Server/Services/DockerSwarmClusterLabelRuleEngineService.ts +30 -0
- package/Server/Services/DockerSwarmClusterOwnerRuleEngineService.ts +24 -0
- package/Server/Services/DockerSwarmClusterOwnerTeamService.ts +133 -0
- package/Server/Services/DockerSwarmClusterOwnerUserService.ts +127 -0
- package/Server/Services/DockerSwarmClusterService.ts +229 -2
- package/Server/Services/EnterpriseLicenseService.ts +15 -7
- package/Server/Services/ExceptionAggregationService.ts +12 -2
- package/Server/Services/HostFeedService.ts +99 -0
- package/Server/Services/HostLabelRuleEngineService.ts +29 -0
- package/Server/Services/HostOwnerRuleEngineService.ts +23 -0
- package/Server/Services/HostOwnerTeamService.ts +129 -0
- package/Server/Services/HostOwnerUserService.ts +123 -0
- package/Server/Services/HostService.ts +215 -2
- package/Server/Services/IncidentService.ts +11 -0
- package/Server/Services/Index.ts +24 -0
- package/Server/Services/KubernetesClusterFeedService.ts +99 -0
- package/Server/Services/KubernetesClusterLabelRuleEngineService.ts +30 -0
- package/Server/Services/KubernetesClusterOwnerRuleEngineService.ts +24 -0
- package/Server/Services/KubernetesClusterOwnerTeamService.ts +133 -0
- package/Server/Services/KubernetesClusterOwnerUserService.ts +127 -0
- package/Server/Services/KubernetesClusterService.ts +231 -2
- package/Server/Services/LogAggregationService.ts +23 -280
- package/Server/Services/MetricAggregationService.ts +98 -1
- package/Server/Services/MonitorService.ts +177 -13
- package/Server/Services/MonitorTemplateService.ts +111 -0
- package/Server/Services/NetworkDeviceAutoImportRuleEngineService.ts +777 -86
- package/Server/Services/NetworkDeviceAutoImportRuleService.ts +199 -16
- package/Server/Services/NetworkDeviceDiscoveryScanService.ts +1055 -14
- package/Server/Services/NetworkDeviceService.ts +750 -4
- package/Server/Services/NetworkInterfaceService.ts +415 -0
- package/Server/Services/NetworkSiteService.ts +485 -52
- package/Server/Services/PodmanHostFeedService.ts +99 -0
- package/Server/Services/PodmanHostLabelRuleEngineService.ts +29 -0
- package/Server/Services/PodmanHostOwnerRuleEngineService.ts +23 -0
- package/Server/Services/PodmanHostOwnerTeamService.ts +129 -0
- package/Server/Services/PodmanHostOwnerUserService.ts +123 -0
- package/Server/Services/PodmanHostService.ts +227 -2
- package/Server/Services/ProjectService.ts +16 -10
- package/Server/Services/ProxmoxClusterFeedService.ts +99 -0
- package/Server/Services/ProxmoxClusterLabelRuleEngineService.ts +30 -0
- package/Server/Services/ProxmoxClusterOwnerRuleEngineService.ts +24 -0
- package/Server/Services/ProxmoxClusterOwnerTeamService.ts +131 -0
- package/Server/Services/ProxmoxClusterOwnerUserService.ts +124 -0
- package/Server/Services/ProxmoxClusterService.ts +225 -2
- package/Server/Services/ScheduledMaintenanceStateTimelineService.ts +61 -0
- package/Server/Services/ServiceFeedService.ts +99 -0
- package/Server/Services/ServiceLabelRuleEngineService.ts +29 -0
- package/Server/Services/ServiceOwnerRuleEngineService.ts +26 -0
- package/Server/Services/ServiceOwnerTeamService.ts +129 -0
- package/Server/Services/ServiceOwnerUserService.ts +123 -0
- package/Server/Services/ServiceService.ts +227 -3
- package/Server/Services/StatusPageSubscriberService.ts +7 -0
- package/Server/Services/TelemetryAttributeService.ts +13 -3
- package/Server/Services/TelemetrySourceMapService.ts +307 -0
- package/Server/Services/ThreatIntelFeedService.ts +222 -0
- package/Server/Services/ThreatIntelIndicatorService.ts +428 -0
- package/Server/Services/TraceAggregationService.ts +101 -11
- package/Server/Services/UserService.ts +13 -6
- package/Server/Services/UserTwoFactorBackupCodeService.ts +127 -0
- package/Server/Services/UserWebhookService.ts +11 -2
- package/Server/Static/Brand/README.md +38 -0
- package/Server/Static/Brand/favicons/apple-touch-icon.png +0 -0
- package/Server/Static/Brand/favicons/favicon-16x16.png +0 -0
- package/Server/Static/Brand/favicons/favicon-32x32.png +0 -0
- package/Server/Static/Brand/favicons/favicon.ico +0 -0
- package/Server/Static/Brand/favicons/safari-pinned-tab.svg +31 -0
- package/Server/Static/Brand/hou-wb.svg +1 -0
- package/Server/Static/Brand/oneuptime-logo.svg +1 -0
- package/Server/Static/Brand/ou-wb.svg +1 -0
- package/Server/Static/Vendor/README.md +4 -0
- package/Server/Types/AnalyticsDatabase/ModelPermission.ts +13 -3
- package/Server/Types/Database/AggregateBy.ts +83 -0
- package/Server/Types/Database/AggregateResultUtil.ts +126 -0
- package/Server/Types/Database/JSONColumnQuery.ts +18 -0
- package/Server/Types/Database/QueryHelper.ts +40 -0
- package/Server/Types/Database/QueryUtil.ts +26 -0
- package/Server/Types/Workflow/Components/API/Utils.ts +10 -1
- package/Server/Types/Workflow/Components/JavaScript.ts +8 -0
- package/Server/Utils/AI/CodeFix/CodeFixAgentCompletion.ts +9 -0
- package/Server/Utils/AI/SRE/InvestigationGrader.ts +18 -0
- package/Server/Utils/AnalyticsDatabase/AttributeFilterStatement.ts +422 -0
- package/Server/Utils/AnalyticsDatabase/StatementGenerator.ts +176 -0
- package/Server/Utils/DataSource/HttpFetch.ts +18 -0
- package/Server/Utils/Database/RelationIdUtil.ts +42 -0
- package/Server/Utils/Marketing/MarketingEventUtil.ts +38 -9
- package/Server/Utils/Monitor/Criteria/ServerMonitorCriteria.ts +34 -3
- package/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.ts +9 -1
- package/Server/Utils/Monitor/Criteria/SyntheticMonitor.ts +28 -10
- package/Server/Utils/Monitor/MonitorAlert.ts +541 -332
- package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +330 -64
- package/Server/Utils/Monitor/MonitorIncident.ts +640 -434
- package/Server/Utils/Monitor/MonitorResource.ts +226 -49
- package/Server/Utils/Monitor/NetworkDeviceWalkUtil.ts +46 -3
- package/Server/Utils/Monitor/NetworkInventoryUtil.ts +23 -102
- package/Server/Utils/Monitor/PerEntityCriteriaFanOut.ts +329 -0
- package/Server/Utils/NetworkDevice/DeviceHealthAggregation.ts +427 -0
- package/Server/Utils/NetworkSite/NetworkSiteMaintenanceSuppression.ts +310 -0
- package/Server/Utils/OnCallNotificationContext.ts +686 -0
- package/Server/Utils/PrivateNetworkWebhookConfig.ts +549 -0
- package/Server/Utils/ResourceFeed/ResourceFeedUtil.ts +139 -0
- package/Server/Utils/Response.ts +11 -1
- package/Server/Utils/SSRFProtection.ts +230 -60
- package/Server/Utils/SecurityEvent/ConnectorErrorMessage.ts +106 -0
- package/Server/Utils/SecurityEvent/DetectionRuleEvaluator.ts +84 -284
- package/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsPoller.ts +47 -20
- package/Server/Utils/SecurityEvent/SecurityEventAlerting.ts +318 -0
- package/Server/Utils/SecurityEvent/ThreatIntel/TaxiiClient.ts +199 -0
- package/Server/Utils/SecurityEvent/ThreatIntel/ThreatIntelEnricher.ts +252 -0
- package/Server/Utils/SecurityEvent/ThreatIntel/ThreatIntelFeedPoller.ts +739 -0
- package/Server/Utils/SecurityEvent/ThreatIntel/ThreatIntelMatcher.ts +533 -0
- package/Server/Utils/StartServer.ts +83 -56
- package/Server/Utils/StatusPageSubscriberWebhook.ts +3 -0
- package/Server/Utils/Telemetry/SourceMapResolver.ts +480 -0
- package/Server/Utils/TwoFactorBackupCodeNotification.ts +106 -0
- package/Server/Utils/VM/VMAPI.ts +3 -0
- package/Server/Utils/VM/VMRunner.ts +27 -1
- package/Server/Utils/VendorAssets.ts +42 -0
- package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.ts +136 -6
- package/Server/Views/AcknowledgeUserOnCallNotification.ejs +11 -9
- package/Server/Views/Partials/Head.ejs +9 -9
- package/Server/Views/Partials/OnCallNotificationDetails.ejs +48 -0
- package/Server/Views/ViewMessage.ejs +11 -9
- package/Tests/App/Accounts/LoginTwoFactorRecovery.test.tsx +972 -0
- package/Tests/App/Dashboard/AddNeighborToMonitoringModal.test.tsx +401 -0
- package/Tests/App/Dashboard/DiscoveryScanEditForm.test.tsx +707 -0
- package/Tests/App/Dashboard/DiscoveryScanWizardValidation.test.tsx +1908 -18
- package/Tests/App/Dashboard/ResourceFeed.test.tsx +230 -0
- package/Tests/App/Dashboard/ResourceFeedPageWiring.test.ts +216 -0
- package/Tests/App/Dashboard/TopologyAddToMonitoring.test.tsx +192 -0
- package/Tests/App/Dashboard/WorkspaceNotificationRuleConditions.test.tsx +439 -0
- package/Tests/Models/DatabaseModels/DateColumnDeserialization.test.ts +182 -0
- package/Tests/Models/DatabaseModels/RelationColumnModelTypeCoverage.test.ts +82 -0
- package/Tests/Models/DatabaseModels/ResourceFeedModels.test.ts +398 -0
- package/Tests/Models/DiscoveryScanNameColumn.test.ts +151 -16
- package/Tests/Models/DiscoveryScanSnmpEnabledColumn.test.ts +593 -0
- package/Tests/Models/NetworkDeviceCreateContract.test.ts +102 -0
- package/Tests/Server/API/AIGenerationProjectAIToggle.test.ts +607 -0
- package/Tests/Server/API/AIGenerationRequestBudget.test.ts +355 -0
- package/Tests/Server/API/AIKillSwitchBackstop.test.ts +602 -0
- package/Tests/Server/API/BaseAPIUpdateDateColumns.test.ts +154 -0
- package/Tests/Server/API/MicrosoftTeamsBotTestEndpoint.test.ts +335 -0
- package/Tests/Server/API/UserOnCallLogTimelineAcknowledgePage.test.ts +611 -0
- package/Tests/Server/API/UserTotpAuthAPI.test.ts +498 -4
- package/Tests/Server/API/UserWebAuthnBackupCodeMinting.test.ts +682 -0
- package/Tests/Server/Infrastructure/ExampleDockerfiles.test.ts +595 -0
- package/Tests/Server/Services/AIServiceDailyBudget.test.ts +9 -0
- package/Tests/Server/Services/AIServiceProjectAccess.test.ts +6 -0
- package/Tests/Server/Services/AutoImportScanCredentialSelect.test.ts +18 -0
- package/Tests/Server/Services/DatabaseServiceAggregateBy.test.ts +590 -0
- package/Tests/Server/Services/DatabaseServiceUpdateWriteRouting.test.ts +12 -0
- package/Tests/Server/Services/DiscoveryScanClaimHookFreeSafety.test.ts +162 -26
- package/Tests/Server/Services/EnterpriseLicenseServiceCreate.test.ts +292 -0
- package/Tests/Server/Services/FeedRetentionConsistency.test.ts +119 -12
- package/Tests/Server/Services/LogAggregationAttributeOperators.test.ts +109 -0
- package/Tests/Server/Services/MetricAggregationAttributeOperators.test.ts +170 -0
- package/Tests/Server/Services/MonitorTemplateServiceNetworkDeviceSync.test.ts +383 -0
- package/Tests/Server/Services/NetworkDeviceAutoImportRuleEngineService.test.ts +997 -3
- package/Tests/Server/Services/NetworkDeviceAutoImportRuleService.test.ts +830 -0
- package/Tests/Server/Services/NetworkDeviceAutoMonitorLifecycle.test.ts +528 -0
- package/Tests/Server/Services/NetworkDeviceDiscoveryScanService.test.ts +3141 -1
- package/Tests/Server/Services/NetworkDeviceRegisteredHostnames.test.ts +1023 -0
- package/Tests/Server/Services/NetworkDeviceSiteAssignmentRuleSkip.test.ts +728 -0
- package/Tests/Server/Services/NetworkInterfaceServiceUpsert.test.ts +795 -0
- package/Tests/Server/Services/NetworkSiteRollupPolicyAndMaintenance.test.ts +903 -0
- package/Tests/Server/Services/NetworkSiteService.test.ts +165 -24
- package/Tests/Server/Services/ProjectServiceChangePlan.test.ts +5 -3
- package/Tests/Server/Services/ProjectServiceCreateSubscriptionStarted.test.ts +5 -2
- package/Tests/Server/Services/ResourceCreationFeedWrites.test.ts +304 -0
- package/Tests/Server/Services/ResourceFeedServices.test.ts +269 -0
- package/Tests/Server/Services/ResourceOwnerFeedWrites.test.ts +245 -0
- package/Tests/Server/Services/SecurityEventLastErrorColumnWidth.test.ts +792 -0
- package/Tests/Server/Services/TelemetrySourceMapService.test.ts +483 -0
- package/Tests/Server/Services/ThreatIntelFeedService.test.ts +351 -0
- package/Tests/Server/Services/ThreatIntelIndicatorService.test.ts +366 -0
- package/Tests/Server/Services/TraceAggregationAttributeOperators.test.ts +507 -0
- package/Tests/Server/Services/UserTwoFactorBackupCodeGenerateIfNone.test.ts +705 -0
- package/Tests/Server/Services/WorkspaceNotificationRuleOnCallDutyPolicy.test.ts +306 -0
- package/Tests/Server/Types/Database/AggregateResultUtil.test.ts +386 -0
- package/Tests/Server/Types/Database/Permissions/SelectRejectionMessageContract.test.ts +424 -0
- package/Tests/Server/Types/Database/QueryHelperWildcard.test.ts +142 -0
- package/Tests/Server/Types/Workflow/Components/ApiComponentPrivateNetwork.test.ts +163 -0
- package/Tests/Server/Types/Workflow/Components/JavaScriptPrivateNetwork.test.ts +124 -0
- package/Tests/Server/Utils/AI/CodeFixAgentCompletion.test.ts +5 -0
- package/Tests/Server/Utils/AI/InvestigationGrader.test.ts +39 -1
- package/Tests/Server/Utils/AnalyticsDatabase/AttributeFilterStatement.test.ts +338 -0
- package/Tests/Server/Utils/AnalyticsDatabase/StatementGeneratorWildcard.test.ts +383 -0
- package/Tests/Server/Utils/Marketing/EmittedMarketingEvent.ts +23 -0
- package/Tests/Server/Utils/Marketing/MarketingEventUtil.test.ts +51 -0
- package/Tests/Server/Utils/Monitor/Criteria/SyntheticMonitorCriteria.test.ts +259 -0
- package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluatorPerSeriesFanout.test.ts +557 -0
- package/Tests/Server/Utils/Monitor/MonitorDependencySuppressionCreatorSkip.test.ts +12 -2
- package/Tests/Server/Utils/Monitor/NetworkDeviceWalkLogWritePath.test.ts +404 -0
- package/Tests/Server/Utils/Monitor/NetworkDeviceWalkUtil.test.ts +8 -2
- package/Tests/Server/Utils/Monitor/NetworkInventoryUtil.test.ts +125 -98
- package/Tests/Server/Utils/Monitor/PerEntityCriteriaFanOut.test.ts +444 -0
- package/Tests/Server/Utils/Monitor/PerSeriesSecondEntityAlerting.test.ts +1112 -0
- package/Tests/Server/Utils/NetworkDevice/DeviceHealthAggregation.test.ts +717 -0
- package/Tests/Server/Utils/NetworkDevice/RulePatternValidator.test.ts +78 -0
- package/Tests/Server/Utils/NetworkSite/NetworkSiteMaintenanceSuppression.test.ts +363 -0
- package/Tests/Server/Utils/OfflineAssetHygiene.test.ts +35 -0
- package/Tests/Server/Utils/OnCallNotificationContext.test.ts +908 -0
- package/Tests/Server/Utils/PrivateNetworkWebhookConfig.test.ts +423 -0
- package/Tests/Server/Utils/ResourceFeed/ResourceFeedUtil.test.ts +191 -0
- package/Tests/Server/Utils/SSRFProtectionPrivateNetwork.test.ts +597 -0
- package/Tests/Server/Utils/SecurityEvent/ConnectorErrorMessage.test.ts +819 -0
- package/Tests/Server/Utils/SecurityEvent/DetectionRuleEvaluator.test.ts +381 -0
- package/Tests/Server/Utils/SecurityEvent/GoogleSecOpsPoller.test.ts +417 -0
- package/Tests/Server/Utils/SecurityEvent/GoogleSecOpsPollerFailureTaxonomy.test.ts +819 -0
- package/Tests/Server/Utils/SecurityEvent/SecurityEventAlerting.test.ts +246 -0
- package/Tests/Server/Utils/SecurityEvent/ThreatIntel/TaxiiClient.test.ts +282 -0
- package/Tests/Server/Utils/SecurityEvent/ThreatIntel/ThreatIntelEnricher.test.ts +312 -0
- package/Tests/Server/Utils/SecurityEvent/ThreatIntel/ThreatIntelFeedPoller.test.ts +854 -0
- package/Tests/Server/Utils/SecurityEvent/ThreatIntel/ThreatIntelMatcher.test.ts +437 -0
- package/Tests/Server/Utils/StartServerErrorStatus.test.ts +225 -0
- package/Tests/Server/Utils/StatusPage/MonitorRulePatternValidator.test.ts +62 -0
- package/Tests/Server/Utils/StatusPageSubscriberWebhookPrivateNetwork.test.ts +119 -0
- package/Tests/Server/Utils/Telemetry/SourceMapResolver.test.ts +542 -0
- package/Tests/Server/Utils/TwoFactorBackupCodeNotification.test.ts +272 -0
- package/Tests/Server/Utils/VM/VMRunnerPrivateNetworkWiring.test.ts +111 -0
- package/Tests/Server/Utils/VendorAssets.test.ts +117 -0
- package/Tests/Server/Utils/Workspace/MicrosoftTeamsChannelSend.test.ts +101 -4
- package/Tests/Server/Utils/Workspace/MicrosoftTeamsInstallStateDiagnostics.test.ts +922 -0
- package/Tests/Server/Utils/Workspace/MicrosoftTeamsRosterDiagnosticMessages.test.ts +642 -0
- package/Tests/Server/Views/OnCallAcknowledgePage.test.ts +430 -0
- package/Tests/Types/API/URLQueryString.test.ts +472 -0
- package/Tests/Types/BaseDatabase/Wildcard.test.ts +163 -0
- package/Tests/Types/BaseDatabase/WildcardPattern.test.ts +149 -0
- package/Tests/Types/Database/DateColumnValue.test.ts +265 -0
- package/Tests/Types/DateToIsoStringOrNull.test.ts +67 -0
- package/Tests/Types/Log/LogQueryToFilter.test.ts +218 -43
- package/Tests/Types/Monitor/KubernetesTemplateGroupByKeys.test.ts +225 -0
- package/Tests/Types/Monitor/TemplateGroupByKeys.test.ts +296 -0
- package/Tests/Types/NetworkAutomation/RuleRunResult.test.ts +102 -0
- package/Tests/Types/NetworkAutomation/RuleRunResultDescribe.test.ts +145 -0
- package/Tests/Types/NetworkSite/SiteHealthRollupPolicy.test.ts +58 -0
- package/Tests/Types/SerializableObjectDictionaryImportCycle.test.ts +15 -0
- package/Tests/Types/Telemetry/TelemetrySearchQuery.test.ts +620 -0
- package/Tests/Types/WhatsApp/WhatsAppTemplates.test.ts +110 -0
- package/Tests/Types/Workspace/NotificationRuleConditionUtil.test.ts +76 -6
- package/Tests/Types/Workspace/NotificationRules/NotificationRuleCondition.test.ts +16 -4
- package/Tests/Types/Workspace/NotificationRules/OnCallDutyPolicyConditions.test.ts +669 -0
- package/Tests/UI/Components/DictionaryFilterOperatorWildcard.test.ts +175 -0
- package/Tests/UI/Components/IconOpticalSize.test.tsx +377 -0
- package/Tests/UI/MicrosoftTeams/MicrosoftTeamsChatsCardInstallGuidance.test.tsx +332 -0
- package/Tests/UI/MicrosoftTeams/MicrosoftTeamsInstallGuidanceContent.test.tsx +643 -0
- package/Tests/Utils/Monitor/InterfaceInventoryUtil.test.ts +824 -0
- package/Tests/Utils/Monitor/NetworkDeviceMonitorTemplateUtil.test.ts +626 -0
- package/Tests/Utils/Monitor/NetworkTopologyUtil.test.ts +718 -0
- package/Tests/Utils/NetworkDevice/DeviceHealthStateUtil.test.ts +59 -0
- package/Tests/Utils/NetworkDiscovery/DiscoveredDeviceBuilder.test.ts +287 -2
- package/Tests/Utils/NetworkDiscovery/DiscoveryImportEligibility.test.ts +73 -0
- package/Tests/Utils/NetworkDiscovery/PingMonitorBuilder.test.ts +317 -0
- package/Tests/Utils/NetworkDiscovery/RescanIntervalUtil.test.ts +262 -0
- package/Tests/Utils/NetworkDiscovery/ScanModeUtil.test.ts +474 -0
- package/Tests/Utils/NetworkDiscovery/SnmpScanConfigUtil.test.ts +2442 -0
- package/Tests/Utils/NetworkSite/SiteMaintenanceUtil.test.ts +188 -0
- package/Tests/Utils/NetworkSite/SiteStatusRollupUtil.test.ts +522 -0
- package/Tests/Utils/NetworkSite/SiteUptimeUtil.test.ts +694 -0
- package/Tests/Utils/SecurityEvent/ThreatIntel/StixPatternParser.test.ts +281 -0
- package/Tests/Utils/Telemetry/CrossSignalScope.test.ts +87 -67
- package/Types/API/URL.ts +45 -10
- package/Types/AnalyticsDatabase/AnalyticsTableName.ts +8 -0
- package/Types/BaseDatabase/NotWildcard.ts +86 -0
- package/Types/BaseDatabase/Wildcard.ts +89 -0
- package/Types/BaseDatabase/WildcardPattern.ts +176 -0
- package/Types/Database/DateColumnValue.ts +184 -0
- package/Types/Database/TableColumn.ts +40 -5
- package/Types/Date.ts +37 -0
- package/Types/Email/EmailTemplateType.ts +1 -0
- package/Types/JSON.ts +8 -0
- package/Types/Log/LogQueryToFilter.ts +167 -129
- package/Types/Monitor/DockerAlertTemplates.ts +43 -12
- package/Types/Monitor/HostAlertTemplates.ts +31 -3
- package/Types/Monitor/KubernetesAlertTemplates.ts +98 -0
- package/Types/Monitor/MonitorStep.ts +49 -0
- package/Types/Monitor/PodmanAlertTemplates.ts +39 -12
- package/Types/Monitor/SnmpMonitor/CdpNeighbor.ts +14 -0
- package/Types/Monitor/SnmpMonitor/LldpNeighbor.ts +11 -0
- package/Types/Monitor/SnmpMonitor/NetworkTopology.ts +11 -4
- package/Types/NetworkAutomation/RuleRunResult.ts +191 -2
- package/Types/NetworkSite/SiteHealthRollupPolicy.ts +96 -0
- package/Types/Permission.ts +411 -0
- package/Types/Probe/ProbeApiIngestResponse.ts +42 -0
- package/Types/SecurityEvent/ThreatIntelConstants.ts +118 -0
- package/Types/SerializableObjectDictionary.ts +8 -0
- package/Types/Telemetry/SourceMap.ts +56 -0
- package/Types/Telemetry/TelemetrySearchQuery.ts +949 -0
- package/Types/Workspace/NotificationRules/NotificationRuleCondition.ts +12 -1
- package/UI/Components/Dictionary/DictionaryFilterOperator.ts +83 -0
- package/UI/Components/Icon/Icon.tsx +28 -1
- package/UI/Components/LogsViewer/components/LogSearchBar.tsx +26 -4
- package/UI/Components/LogsViewer/components/LogSearchHelp.tsx +34 -16
- package/UI/Components/TelemetryViewer/components/TelemetrySearchBar.tsx +15 -2
- package/Utils/Metrics/MetricExplorerUrl.ts +77 -15
- package/Utils/Monitor/InterfaceInventoryUtil.ts +251 -0
- package/Utils/Monitor/NetworkDeviceMonitorTemplateUtil.ts +333 -0
- package/Utils/Monitor/NetworkTopologyUtil.ts +249 -28
- package/Utils/NetworkDevice/DeviceHealthStateUtil.ts +14 -6
- package/Utils/NetworkDiscovery/AutoImportRuleMatcher.ts +2 -0
- package/Utils/NetworkDiscovery/DiscoveredDeviceBuilder.ts +49 -18
- package/Utils/NetworkDiscovery/PingMonitorBuilder.ts +215 -0
- package/Utils/NetworkDiscovery/RescanIntervalUtil.ts +148 -0
- package/Utils/NetworkDiscovery/ScanModeUtil.ts +105 -0
- package/Utils/NetworkDiscovery/SnmpScanConfigUtil.ts +827 -0
- package/Utils/NetworkSite/SiteMaintenanceUtil.ts +110 -0
- package/Utils/NetworkSite/SiteStatusRollupUtil.ts +350 -19
- package/Utils/NetworkSite/SiteUptimeUtil.ts +422 -21
- package/Utils/SecurityEvent/ThreatIntel/StixPatternParser.ts +383 -0
- package/Utils/Telemetry/CrossSignalScope.ts +37 -39
- package/build/dist/Models/AnalyticsModels/Index.js +2 -0
- package/build/dist/Models/AnalyticsModels/Index.js.map +1 -1
- package/build/dist/Models/AnalyticsModels/ThreatIntelIndicator.js +325 -0
- package/build/dist/Models/AnalyticsModels/ThreatIntelIndicator.js.map +1 -0
- package/build/dist/Models/DatabaseModels/AlertSeverity.js +4 -1
- package/build/dist/Models/DatabaseModels/AlertSeverity.js.map +1 -1
- package/build/dist/Models/DatabaseModels/CephClusterFeed.js +648 -0
- package/build/dist/Models/DatabaseModels/CephClusterFeed.js.map +1 -0
- package/build/dist/Models/DatabaseModels/CloudResourceFeed.js +648 -0
- package/build/dist/Models/DatabaseModels/CloudResourceFeed.js.map +1 -0
- package/build/dist/Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel.js +11 -0
- package/build/dist/Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel.js.map +1 -1
- package/build/dist/Models/DatabaseModels/DetectionRule.js +9 -3
- package/build/dist/Models/DatabaseModels/DetectionRule.js.map +1 -1
- package/build/dist/Models/DatabaseModels/DockerHostFeed.js +648 -0
- package/build/dist/Models/DatabaseModels/DockerHostFeed.js.map +1 -0
- package/build/dist/Models/DatabaseModels/DockerSwarmClusterFeed.js +648 -0
- package/build/dist/Models/DatabaseModels/DockerSwarmClusterFeed.js.map +1 -0
- package/build/dist/Models/DatabaseModels/GoogleSecOpsConnection.js +9 -3
- package/build/dist/Models/DatabaseModels/GoogleSecOpsConnection.js.map +1 -1
- package/build/dist/Models/DatabaseModels/HostFeed.js +648 -0
- package/build/dist/Models/DatabaseModels/HostFeed.js.map +1 -0
- package/build/dist/Models/DatabaseModels/IncidentSeverity.js +4 -1
- package/build/dist/Models/DatabaseModels/IncidentSeverity.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Index.js +22 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/KubernetesClusterFeed.js +648 -0
- package/build/dist/Models/DatabaseModels/KubernetesClusterFeed.js.map +1 -0
- package/build/dist/Models/DatabaseModels/Monitor.js +81 -0
- package/build/dist/Models/DatabaseModels/Monitor.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkDevice.js +103 -7
- package/build/dist/Models/DatabaseModels/NetworkDevice.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkDeviceAutoImportRule.js +91 -6
- package/build/dist/Models/DatabaseModels/NetworkDeviceAutoImportRule.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js +276 -31
- package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkSite.js +124 -1
- package/build/dist/Models/DatabaseModels/NetworkSite.js.map +1 -1
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.js +1 -0
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.js.map +1 -1
- package/build/dist/Models/DatabaseModels/PodmanHostFeed.js +648 -0
- package/build/dist/Models/DatabaseModels/PodmanHostFeed.js.map +1 -0
- package/build/dist/Models/DatabaseModels/ProxmoxClusterFeed.js +648 -0
- package/build/dist/Models/DatabaseModels/ProxmoxClusterFeed.js.map +1 -0
- package/build/dist/Models/DatabaseModels/ScheduledMaintenance.js +66 -0
- package/build/dist/Models/DatabaseModels/ScheduledMaintenance.js.map +1 -1
- package/build/dist/Models/DatabaseModels/ServiceFeed.js +648 -0
- package/build/dist/Models/DatabaseModels/ServiceFeed.js.map +1 -0
- package/build/dist/Models/DatabaseModels/TelemetrySourceMap.js +496 -0
- package/build/dist/Models/DatabaseModels/TelemetrySourceMap.js.map +1 -0
- package/build/dist/Models/DatabaseModels/ThreatIntelFeed.js +800 -0
- package/build/dist/Models/DatabaseModels/ThreatIntelFeed.js.map +1 -0
- package/build/dist/Models/DatabaseModels/UserOnCallLog.js +1 -0
- package/build/dist/Models/DatabaseModels/UserOnCallLog.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserTotpAuth.js +1 -0
- package/build/dist/Models/DatabaseModels/UserTotpAuth.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserWebAuthn.js +1 -0
- package/build/dist/Models/DatabaseModels/UserWebAuthn.js.map +1 -1
- package/build/dist/Server/API/AlertAPI.js +18 -1
- package/build/dist/Server/API/AlertAPI.js.map +1 -1
- package/build/dist/Server/API/BaseAPI.js +8 -1
- package/build/dist/Server/API/BaseAPI.js.map +1 -1
- package/build/dist/Server/API/IncidentAPI.js +35 -1
- package/build/dist/Server/API/IncidentAPI.js.map +1 -1
- package/build/dist/Server/API/IncidentEpisodeAPI.js +18 -1
- package/build/dist/Server/API/IncidentEpisodeAPI.js.map +1 -1
- package/build/dist/Server/API/MicrosoftTeamsAPI.js +30 -2
- package/build/dist/Server/API/MicrosoftTeamsAPI.js.map +1 -1
- package/build/dist/Server/API/ScheduledMaintenanceAPI.js +18 -1
- package/build/dist/Server/API/ScheduledMaintenanceAPI.js.map +1 -1
- package/build/dist/Server/API/SlackAPI.js +45 -0
- package/build/dist/Server/API/SlackAPI.js.map +1 -1
- package/build/dist/Server/API/TelemetryAPI.js +100 -35
- package/build/dist/Server/API/TelemetryAPI.js.map +1 -1
- package/build/dist/Server/API/UserOnCallLogTimelineAPI.js +64 -59
- package/build/dist/Server/API/UserOnCallLogTimelineAPI.js.map +1 -1
- package/build/dist/Server/API/UserTotpAuthAPI.js +65 -1
- package/build/dist/Server/API/UserTotpAuthAPI.js.map +1 -1
- package/build/dist/Server/API/UserWebAuthnAPI.js +42 -1
- package/build/dist/Server/API/UserWebAuthnAPI.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787923136162-MigrationName.js +26 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787923136162-MigrationName.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789600000000-AddAutoProvisionedNetworkDeviceMonitors.js +22 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789600000000-AddAutoProvisionedNetworkDeviceMonitors.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789700000000-AddNetworkScaleIndexes.js +88 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789700000000-AddNetworkScaleIndexes.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789800000000-WidenSecurityEventLastErrorColumns.js +39 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789800000000-WidenSecurityEventLastErrorColumns.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789900000000-AddNetworkSiteRollupPolicyAndMaintenance.js +34 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1789900000000-AddNetworkSiteRollupPolicyAndMaintenance.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790000000000-AddTelemetrySourceMap.js +32 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790000000000-AddTelemetrySourceMap.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790000000001-AddSnmpConfigsToNetworkDeviceDiscoveryScan.js +61 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790000000001-AddSnmpConfigsToNetworkDeviceDiscoveryScan.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790003445000-AddSnmpEnabledToNetworkDeviceDiscoveryScan.js +23 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790003445000-AddSnmpEnabledToNetworkDeviceDiscoveryScan.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790100000000-AddResourceActivityFeeds.js +179 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1790100000000-AddResourceActivityFeeds.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +18 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Middleware/IdentityRateLimit.js +40 -3
- package/build/dist/Server/Middleware/IdentityRateLimit.js.map +1 -1
- package/build/dist/Server/Services/AIService.js +177 -30
- package/build/dist/Server/Services/AIService.js.map +1 -1
- package/build/dist/Server/Services/CephClusterFeedService.js +89 -0
- package/build/dist/Server/Services/CephClusterFeedService.js.map +1 -0
- package/build/dist/Server/Services/CephClusterLabelRuleEngineService.js +27 -3
- package/build/dist/Server/Services/CephClusterLabelRuleEngineService.js.map +1 -1
- package/build/dist/Server/Services/CephClusterOwnerRuleEngineService.js +21 -0
- package/build/dist/Server/Services/CephClusterOwnerRuleEngineService.js.map +1 -1
- package/build/dist/Server/Services/CephClusterOwnerTeamService.js +120 -0
- package/build/dist/Server/Services/CephClusterOwnerTeamService.js.map +1 -1
- package/build/dist/Server/Services/CephClusterOwnerUserService.js +113 -0
- package/build/dist/Server/Services/CephClusterOwnerUserService.js.map +1 -1
- package/build/dist/Server/Services/CephClusterService.js +175 -1
- package/build/dist/Server/Services/CephClusterService.js.map +1 -1
- package/build/dist/Server/Services/CloudResourceFeedService.js +89 -0
- package/build/dist/Server/Services/CloudResourceFeedService.js.map +1 -0
- package/build/dist/Server/Services/CloudResourceLabelRuleEngineService.js +27 -3
- package/build/dist/Server/Services/CloudResourceLabelRuleEngineService.js.map +1 -1
- package/build/dist/Server/Services/CloudResourceOwnerRuleEngineService.js +28 -3
- package/build/dist/Server/Services/CloudResourceOwnerRuleEngineService.js.map +1 -1
- package/build/dist/Server/Services/CloudResourceOwnerTeamService.js +120 -0
- package/build/dist/Server/Services/CloudResourceOwnerTeamService.js.map +1 -1
- package/build/dist/Server/Services/CloudResourceOwnerUserService.js +113 -0
- package/build/dist/Server/Services/CloudResourceOwnerUserService.js.map +1 -1
- package/build/dist/Server/Services/CloudResourceService.js +177 -1
- package/build/dist/Server/Services/CloudResourceService.js.map +1 -1
- package/build/dist/Server/Services/DatabaseService.js +201 -0
- package/build/dist/Server/Services/DatabaseService.js.map +1 -1
- package/build/dist/Server/Services/DockerHostFeedService.js +89 -0
- package/build/dist/Server/Services/DockerHostFeedService.js.map +1 -0
- package/build/dist/Server/Services/DockerHostLabelRuleEngineService.js +27 -3
- package/build/dist/Server/Services/DockerHostLabelRuleEngineService.js.map +1 -1
- package/build/dist/Server/Services/DockerHostOwnerRuleEngineService.js +21 -0
- package/build/dist/Server/Services/DockerHostOwnerRuleEngineService.js.map +1 -1
- package/build/dist/Server/Services/DockerHostOwnerTeamService.js +120 -0
- package/build/dist/Server/Services/DockerHostOwnerTeamService.js.map +1 -1
- package/build/dist/Server/Services/DockerHostOwnerUserService.js +113 -0
- package/build/dist/Server/Services/DockerHostOwnerUserService.js.map +1 -1
- package/build/dist/Server/Services/DockerHostService.js +177 -1
- package/build/dist/Server/Services/DockerHostService.js.map +1 -1
- package/build/dist/Server/Services/DockerSwarmClusterFeedService.js +90 -0
- package/build/dist/Server/Services/DockerSwarmClusterFeedService.js.map +1 -0
- package/build/dist/Server/Services/DockerSwarmClusterLabelRuleEngineService.js +27 -3
- package/build/dist/Server/Services/DockerSwarmClusterLabelRuleEngineService.js.map +1 -1
- package/build/dist/Server/Services/DockerSwarmClusterOwnerRuleEngineService.js +21 -0
- package/build/dist/Server/Services/DockerSwarmClusterOwnerRuleEngineService.js.map +1 -1
- package/build/dist/Server/Services/DockerSwarmClusterOwnerTeamService.js +120 -0
- package/build/dist/Server/Services/DockerSwarmClusterOwnerTeamService.js.map +1 -1
- package/build/dist/Server/Services/DockerSwarmClusterOwnerUserService.js +113 -0
- package/build/dist/Server/Services/DockerSwarmClusterOwnerUserService.js.map +1 -1
- package/build/dist/Server/Services/DockerSwarmClusterService.js +175 -1
- package/build/dist/Server/Services/DockerSwarmClusterService.js.map +1 -1
- package/build/dist/Server/Services/EnterpriseLicenseService.js +40 -30
- package/build/dist/Server/Services/EnterpriseLicenseService.js.map +1 -1
- package/build/dist/Server/Services/ExceptionAggregationService.js +8 -2
- package/build/dist/Server/Services/ExceptionAggregationService.js.map +1 -1
- package/build/dist/Server/Services/HostFeedService.js +89 -0
- package/build/dist/Server/Services/HostFeedService.js.map +1 -0
- package/build/dist/Server/Services/HostLabelRuleEngineService.js +27 -3
- package/build/dist/Server/Services/HostLabelRuleEngineService.js.map +1 -1
- package/build/dist/Server/Services/HostOwnerRuleEngineService.js +21 -0
- package/build/dist/Server/Services/HostOwnerRuleEngineService.js.map +1 -1
- package/build/dist/Server/Services/HostOwnerTeamService.js +120 -0
- package/build/dist/Server/Services/HostOwnerTeamService.js.map +1 -1
- package/build/dist/Server/Services/HostOwnerUserService.js +113 -0
- package/build/dist/Server/Services/HostOwnerUserService.js.map +1 -1
- package/build/dist/Server/Services/HostService.js +175 -1
- package/build/dist/Server/Services/HostService.js.map +1 -1
- package/build/dist/Server/Services/IncidentService.js +10 -0
- package/build/dist/Server/Services/IncidentService.js.map +1 -1
- package/build/dist/Server/Services/Index.js +24 -0
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/KubernetesClusterFeedService.js +89 -0
- package/build/dist/Server/Services/KubernetesClusterFeedService.js.map +1 -0
- package/build/dist/Server/Services/KubernetesClusterLabelRuleEngineService.js +27 -3
- package/build/dist/Server/Services/KubernetesClusterLabelRuleEngineService.js.map +1 -1
- package/build/dist/Server/Services/KubernetesClusterOwnerRuleEngineService.js +21 -0
- package/build/dist/Server/Services/KubernetesClusterOwnerRuleEngineService.js.map +1 -1
- package/build/dist/Server/Services/KubernetesClusterOwnerTeamService.js +120 -0
- package/build/dist/Server/Services/KubernetesClusterOwnerTeamService.js.map +1 -1
- package/build/dist/Server/Services/KubernetesClusterOwnerUserService.js +113 -0
- package/build/dist/Server/Services/KubernetesClusterOwnerUserService.js.map +1 -1
- package/build/dist/Server/Services/KubernetesClusterService.js +177 -1
- package/build/dist/Server/Services/KubernetesClusterService.js.map +1 -1
- package/build/dist/Server/Services/LogAggregationService.js +19 -196
- package/build/dist/Server/Services/LogAggregationService.js.map +1 -1
- package/build/dist/Server/Services/MetricAggregationService.js +59 -0
- package/build/dist/Server/Services/MetricAggregationService.js.map +1 -1
- package/build/dist/Server/Services/MonitorService.js +115 -13
- package/build/dist/Server/Services/MonitorService.js.map +1 -1
- package/build/dist/Server/Services/MonitorTemplateService.js +86 -0
- package/build/dist/Server/Services/MonitorTemplateService.js.map +1 -1
- package/build/dist/Server/Services/NetworkDeviceAutoImportRuleEngineService.js +561 -67
- package/build/dist/Server/Services/NetworkDeviceAutoImportRuleEngineService.js.map +1 -1
- package/build/dist/Server/Services/NetworkDeviceAutoImportRuleService.js +130 -16
- package/build/dist/Server/Services/NetworkDeviceAutoImportRuleService.js.map +1 -1
- package/build/dist/Server/Services/NetworkDeviceDiscoveryScanService.js +850 -8
- package/build/dist/Server/Services/NetworkDeviceDiscoveryScanService.js.map +1 -1
- package/build/dist/Server/Services/NetworkDeviceService.js +594 -5
- package/build/dist/Server/Services/NetworkDeviceService.js.map +1 -1
- package/build/dist/Server/Services/NetworkInterfaceService.js +306 -0
- package/build/dist/Server/Services/NetworkInterfaceService.js.map +1 -1
- package/build/dist/Server/Services/NetworkSiteService.js +408 -47
- package/build/dist/Server/Services/NetworkSiteService.js.map +1 -1
- package/build/dist/Server/Services/PodmanHostFeedService.js +89 -0
- package/build/dist/Server/Services/PodmanHostFeedService.js.map +1 -0
- package/build/dist/Server/Services/PodmanHostLabelRuleEngineService.js +27 -3
- package/build/dist/Server/Services/PodmanHostLabelRuleEngineService.js.map +1 -1
- package/build/dist/Server/Services/PodmanHostOwnerRuleEngineService.js +21 -0
- package/build/dist/Server/Services/PodmanHostOwnerRuleEngineService.js.map +1 -1
- package/build/dist/Server/Services/PodmanHostOwnerTeamService.js +120 -0
- package/build/dist/Server/Services/PodmanHostOwnerTeamService.js.map +1 -1
- package/build/dist/Server/Services/PodmanHostOwnerUserService.js +113 -0
- package/build/dist/Server/Services/PodmanHostOwnerUserService.js.map +1 -1
- package/build/dist/Server/Services/PodmanHostService.js +177 -1
- package/build/dist/Server/Services/PodmanHostService.js.map +1 -1
- package/build/dist/Server/Services/ProjectService.js +40 -30
- package/build/dist/Server/Services/ProjectService.js.map +1 -1
- package/build/dist/Server/Services/ProxmoxClusterFeedService.js +89 -0
- package/build/dist/Server/Services/ProxmoxClusterFeedService.js.map +1 -0
- package/build/dist/Server/Services/ProxmoxClusterLabelRuleEngineService.js +27 -3
- package/build/dist/Server/Services/ProxmoxClusterLabelRuleEngineService.js.map +1 -1
- package/build/dist/Server/Services/ProxmoxClusterOwnerRuleEngineService.js +21 -0
- package/build/dist/Server/Services/ProxmoxClusterOwnerRuleEngineService.js.map +1 -1
- package/build/dist/Server/Services/ProxmoxClusterOwnerTeamService.js +120 -0
- package/build/dist/Server/Services/ProxmoxClusterOwnerTeamService.js.map +1 -1
- package/build/dist/Server/Services/ProxmoxClusterOwnerUserService.js +113 -0
- package/build/dist/Server/Services/ProxmoxClusterOwnerUserService.js.map +1 -1
- package/build/dist/Server/Services/ProxmoxClusterService.js +175 -1
- package/build/dist/Server/Services/ProxmoxClusterService.js.map +1 -1
- package/build/dist/Server/Services/ScheduledMaintenanceStateTimelineService.js +56 -0
- package/build/dist/Server/Services/ScheduledMaintenanceStateTimelineService.js.map +1 -1
- package/build/dist/Server/Services/ServiceFeedService.js +89 -0
- package/build/dist/Server/Services/ServiceFeedService.js.map +1 -0
- package/build/dist/Server/Services/ServiceLabelRuleEngineService.js +27 -3
- package/build/dist/Server/Services/ServiceLabelRuleEngineService.js.map +1 -1
- package/build/dist/Server/Services/ServiceOwnerRuleEngineService.js +24 -0
- package/build/dist/Server/Services/ServiceOwnerRuleEngineService.js.map +1 -1
- package/build/dist/Server/Services/ServiceOwnerTeamService.js +120 -0
- package/build/dist/Server/Services/ServiceOwnerTeamService.js.map +1 -1
- package/build/dist/Server/Services/ServiceOwnerUserService.js +113 -0
- package/build/dist/Server/Services/ServiceOwnerUserService.js.map +1 -1
- package/build/dist/Server/Services/ServiceService.js +173 -2
- package/build/dist/Server/Services/ServiceService.js.map +1 -1
- package/build/dist/Server/Services/StatusPageSubscriberService.js +7 -0
- package/build/dist/Server/Services/StatusPageSubscriberService.js.map +1 -1
- package/build/dist/Server/Services/TelemetryAttributeService.js +9 -3
- package/build/dist/Server/Services/TelemetryAttributeService.js.map +1 -1
- package/build/dist/Server/Services/TelemetrySourceMapService.js +265 -0
- package/build/dist/Server/Services/TelemetrySourceMapService.js.map +1 -0
- package/build/dist/Server/Services/ThreatIntelFeedService.js +157 -0
- package/build/dist/Server/Services/ThreatIntelFeedService.js.map +1 -0
- package/build/dist/Server/Services/ThreatIntelIndicatorService.js +276 -0
- package/build/dist/Server/Services/ThreatIntelIndicatorService.js.map +1 -0
- package/build/dist/Server/Services/TraceAggregationService.js +62 -6
- package/build/dist/Server/Services/TraceAggregationService.js.map +1 -1
- package/build/dist/Server/Services/UserService.js +22 -13
- package/build/dist/Server/Services/UserService.js.map +1 -1
- package/build/dist/Server/Services/UserTwoFactorBackupCodeService.js +120 -0
- package/build/dist/Server/Services/UserTwoFactorBackupCodeService.js.map +1 -1
- package/build/dist/Server/Services/UserWebhookService.js +11 -2
- package/build/dist/Server/Services/UserWebhookService.js.map +1 -1
- package/build/dist/Server/Types/AnalyticsDatabase/ModelPermission.js +12 -1
- package/build/dist/Server/Types/AnalyticsDatabase/ModelPermission.js.map +1 -1
- package/build/dist/Server/Types/Database/AggregateBy.js +2 -0
- package/build/dist/Server/Types/Database/AggregateBy.js.map +1 -0
- package/build/dist/Server/Types/Database/AggregateResultUtil.js +90 -0
- package/build/dist/Server/Types/Database/AggregateResultUtil.js.map +1 -0
- package/build/dist/Server/Types/Database/JSONColumnQuery.js +14 -0
- package/build/dist/Server/Types/Database/JSONColumnQuery.js.map +1 -1
- package/build/dist/Server/Types/Database/QueryHelper.js +42 -0
- package/build/dist/Server/Types/Database/QueryHelper.js.map +1 -1
- package/build/dist/Server/Types/Database/QueryUtil.js +18 -0
- package/build/dist/Server/Types/Database/QueryUtil.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Utils.js +10 -1
- package/build/dist/Server/Types/Workflow/Components/API/Utils.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/JavaScript.js +8 -0
- package/build/dist/Server/Types/Workflow/Components/JavaScript.js.map +1 -1
- package/build/dist/Server/Utils/AI/CodeFix/CodeFixAgentCompletion.js +8 -0
- package/build/dist/Server/Utils/AI/CodeFix/CodeFixAgentCompletion.js.map +1 -1
- package/build/dist/Server/Utils/AI/SRE/InvestigationGrader.js +15 -0
- package/build/dist/Server/Utils/AI/SRE/InvestigationGrader.js.map +1 -1
- package/build/dist/Server/Utils/AnalyticsDatabase/AttributeFilterStatement.js +266 -0
- package/build/dist/Server/Utils/AnalyticsDatabase/AttributeFilterStatement.js.map +1 -0
- package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js +134 -0
- package/build/dist/Server/Utils/AnalyticsDatabase/StatementGenerator.js.map +1 -1
- package/build/dist/Server/Utils/DataSource/HttpFetch.js +8 -0
- package/build/dist/Server/Utils/DataSource/HttpFetch.js.map +1 -1
- package/build/dist/Server/Utils/Database/RelationIdUtil.js +31 -0
- package/build/dist/Server/Utils/Database/RelationIdUtil.js.map +1 -1
- package/build/dist/Server/Utils/Marketing/MarketingEventUtil.js +26 -8
- package/build/dist/Server/Utils/Marketing/MarketingEventUtil.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/Criteria/ServerMonitorCriteria.js +42 -17
- package/build/dist/Server/Utils/Monitor/Criteria/ServerMonitorCriteria.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.js +9 -1
- package/build/dist/Server/Utils/Monitor/Criteria/SnmpMonitorCriteria.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/Criteria/SyntheticMonitor.js +15 -2
- package/build/dist/Server/Utils/Monitor/Criteria/SyntheticMonitor.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorAlert.js +386 -271
- package/build/dist/Server/Utils/Monitor/MonitorAlert.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +278 -64
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorIncident.js +469 -350
- package/build/dist/Server/Utils/Monitor/MonitorIncident.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorResource.js +183 -44
- package/build/dist/Server/Utils/Monitor/MonitorResource.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/NetworkDeviceWalkUtil.js +46 -3
- package/build/dist/Server/Utils/Monitor/NetworkDeviceWalkUtil.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/NetworkInventoryUtil.js +18 -91
- package/build/dist/Server/Utils/Monitor/NetworkInventoryUtil.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/PerEntityCriteriaFanOut.js +194 -0
- package/build/dist/Server/Utils/Monitor/PerEntityCriteriaFanOut.js.map +1 -0
- package/build/dist/Server/Utils/NetworkDevice/DeviceHealthAggregation.js +332 -0
- package/build/dist/Server/Utils/NetworkDevice/DeviceHealthAggregation.js.map +1 -0
- package/build/dist/Server/Utils/NetworkSite/NetworkSiteMaintenanceSuppression.js +279 -0
- package/build/dist/Server/Utils/NetworkSite/NetworkSiteMaintenanceSuppression.js.map +1 -0
- package/build/dist/Server/Utils/OnCallNotificationContext.js +415 -0
- package/build/dist/Server/Utils/OnCallNotificationContext.js.map +1 -0
- package/build/dist/Server/Utils/PrivateNetworkWebhookConfig.js +424 -0
- package/build/dist/Server/Utils/PrivateNetworkWebhookConfig.js.map +1 -0
- package/build/dist/Server/Utils/ResourceFeed/ResourceFeedUtil.js +108 -0
- package/build/dist/Server/Utils/ResourceFeed/ResourceFeedUtil.js.map +1 -0
- package/build/dist/Server/Utils/Response.js +12 -1
- package/build/dist/Server/Utils/Response.js.map +1 -1
- package/build/dist/Server/Utils/SSRFProtection.js +160 -58
- package/build/dist/Server/Utils/SSRFProtection.js.map +1 -1
- package/build/dist/Server/Utils/SecurityEvent/ConnectorErrorMessage.js +89 -0
- package/build/dist/Server/Utils/SecurityEvent/ConnectorErrorMessage.js.map +1 -0
- package/build/dist/Server/Utils/SecurityEvent/DetectionRuleEvaluator.js +75 -234
- package/build/dist/Server/Utils/SecurityEvent/DetectionRuleEvaluator.js.map +1 -1
- package/build/dist/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsPoller.js +41 -16
- package/build/dist/Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsPoller.js.map +1 -1
- package/build/dist/Server/Utils/SecurityEvent/SecurityEventAlerting.js +217 -0
- package/build/dist/Server/Utils/SecurityEvent/SecurityEventAlerting.js.map +1 -0
- package/build/dist/Server/Utils/SecurityEvent/ThreatIntel/TaxiiClient.js +103 -0
- package/build/dist/Server/Utils/SecurityEvent/ThreatIntel/TaxiiClient.js.map +1 -0
- package/build/dist/Server/Utils/SecurityEvent/ThreatIntel/ThreatIntelEnricher.js +168 -0
- package/build/dist/Server/Utils/SecurityEvent/ThreatIntel/ThreatIntelEnricher.js.map +1 -0
- package/build/dist/Server/Utils/SecurityEvent/ThreatIntel/ThreatIntelFeedPoller.js +527 -0
- package/build/dist/Server/Utils/SecurityEvent/ThreatIntel/ThreatIntelFeedPoller.js.map +1 -0
- package/build/dist/Server/Utils/SecurityEvent/ThreatIntel/ThreatIntelMatcher.js +376 -0
- package/build/dist/Server/Utils/SecurityEvent/ThreatIntel/ThreatIntelMatcher.js.map +1 -0
- package/build/dist/Server/Utils/StartServer.js +70 -44
- package/build/dist/Server/Utils/StartServer.js.map +1 -1
- package/build/dist/Server/Utils/StatusPageSubscriberWebhook.js +3 -0
- package/build/dist/Server/Utils/StatusPageSubscriberWebhook.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/SourceMapResolver.js +327 -0
- package/build/dist/Server/Utils/Telemetry/SourceMapResolver.js.map +1 -0
- package/build/dist/Server/Utils/TwoFactorBackupCodeNotification.js +84 -0
- package/build/dist/Server/Utils/TwoFactorBackupCodeNotification.js.map +1 -0
- package/build/dist/Server/Utils/VM/VMAPI.js.map +1 -1
- package/build/dist/Server/Utils/VM/VMRunner.js +10 -1
- package/build/dist/Server/Utils/VM/VMRunner.js.map +1 -1
- package/build/dist/Server/Utils/VendorAssets.js +29 -0
- package/build/dist/Server/Utils/VendorAssets.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js +121 -6
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js.map +1 -1
- package/build/dist/Types/API/URL.js +40 -10
- package/build/dist/Types/API/URL.js.map +1 -1
- package/build/dist/Types/AnalyticsDatabase/AnalyticsTableName.js +8 -0
- package/build/dist/Types/AnalyticsDatabase/AnalyticsTableName.js.map +1 -1
- package/build/dist/Types/BaseDatabase/NotWildcard.js +72 -0
- package/build/dist/Types/BaseDatabase/NotWildcard.js.map +1 -0
- package/build/dist/Types/BaseDatabase/Wildcard.js +75 -0
- package/build/dist/Types/BaseDatabase/Wildcard.js.map +1 -0
- package/build/dist/Types/BaseDatabase/WildcardPattern.js +137 -0
- package/build/dist/Types/BaseDatabase/WildcardPattern.js.map +1 -0
- package/build/dist/Types/Database/DateColumnValue.js +125 -0
- package/build/dist/Types/Database/DateColumnValue.js.map +1 -0
- package/build/dist/Types/Database/TableColumn.js +18 -2
- package/build/dist/Types/Database/TableColumn.js.map +1 -1
- package/build/dist/Types/Date.js +31 -0
- package/build/dist/Types/Date.js.map +1 -1
- package/build/dist/Types/Email/EmailTemplateType.js +1 -0
- package/build/dist/Types/Email/EmailTemplateType.js.map +1 -1
- package/build/dist/Types/JSON.js +2 -0
- package/build/dist/Types/JSON.js.map +1 -1
- package/build/dist/Types/Log/LogQueryToFilter.js +111 -108
- package/build/dist/Types/Log/LogQueryToFilter.js.map +1 -1
- package/build/dist/Types/Monitor/DockerAlertTemplates.js +40 -16
- package/build/dist/Types/Monitor/DockerAlertTemplates.js.map +1 -1
- package/build/dist/Types/Monitor/HostAlertTemplates.js +29 -7
- package/build/dist/Types/Monitor/HostAlertTemplates.js.map +1 -1
- package/build/dist/Types/Monitor/KubernetesAlertTemplates.js +98 -4
- package/build/dist/Types/Monitor/KubernetesAlertTemplates.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorStep.js +40 -0
- package/build/dist/Types/Monitor/MonitorStep.js.map +1 -1
- package/build/dist/Types/Monitor/PodmanAlertTemplates.js +36 -16
- package/build/dist/Types/Monitor/PodmanAlertTemplates.js.map +1 -1
- package/build/dist/Types/NetworkAutomation/RuleRunResult.js +90 -0
- package/build/dist/Types/NetworkAutomation/RuleRunResult.js.map +1 -1
- package/build/dist/Types/NetworkSite/SiteHealthRollupPolicy.js +84 -0
- package/build/dist/Types/NetworkSite/SiteHealthRollupPolicy.js.map +1 -0
- package/build/dist/Types/Permission.js +354 -0
- package/build/dist/Types/Permission.js.map +1 -1
- package/build/dist/Types/SecurityEvent/ThreatIntelConstants.js +100 -0
- package/build/dist/Types/SecurityEvent/ThreatIntelConstants.js.map +1 -0
- package/build/dist/Types/SerializableObjectDictionary.js +8 -0
- package/build/dist/Types/SerializableObjectDictionary.js.map +1 -1
- package/build/dist/Types/Telemetry/SourceMap.js +9 -0
- package/build/dist/Types/Telemetry/SourceMap.js.map +1 -0
- package/build/dist/Types/Telemetry/TelemetrySearchQuery.js +661 -0
- package/build/dist/Types/Telemetry/TelemetrySearchQuery.js.map +1 -0
- package/build/dist/Types/Workspace/NotificationRules/NotificationRuleCondition.js +12 -1
- package/build/dist/Types/Workspace/NotificationRules/NotificationRuleCondition.js.map +1 -1
- package/build/dist/UI/Components/Dictionary/DictionaryFilterOperator.js +67 -0
- package/build/dist/UI/Components/Dictionary/DictionaryFilterOperator.js.map +1 -1
- package/build/dist/UI/Components/Icon/Icon.js +28 -1
- package/build/dist/UI/Components/Icon/Icon.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogSearchBar.js +25 -4
- package/build/dist/UI/Components/LogsViewer/components/LogSearchBar.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogSearchHelp.js +36 -16
- package/build/dist/UI/Components/LogsViewer/components/LogSearchHelp.js.map +1 -1
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetrySearchBar.js +14 -2
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetrySearchBar.js.map +1 -1
- package/build/dist/Utils/Metrics/MetricExplorerUrl.js +54 -9
- package/build/dist/Utils/Metrics/MetricExplorerUrl.js.map +1 -1
- package/build/dist/Utils/Monitor/InterfaceInventoryUtil.js +128 -0
- package/build/dist/Utils/Monitor/InterfaceInventoryUtil.js.map +1 -0
- package/build/dist/Utils/Monitor/NetworkDeviceMonitorTemplateUtil.js +190 -0
- package/build/dist/Utils/Monitor/NetworkDeviceMonitorTemplateUtil.js.map +1 -0
- package/build/dist/Utils/Monitor/NetworkTopologyUtil.js +206 -28
- package/build/dist/Utils/Monitor/NetworkTopologyUtil.js.map +1 -1
- package/build/dist/Utils/NetworkDevice/DeviceHealthStateUtil.js +14 -7
- package/build/dist/Utils/NetworkDevice/DeviceHealthStateUtil.js.map +1 -1
- package/build/dist/Utils/NetworkDiscovery/AutoImportRuleMatcher.js.map +1 -1
- package/build/dist/Utils/NetworkDiscovery/DiscoveredDeviceBuilder.js +34 -18
- package/build/dist/Utils/NetworkDiscovery/DiscoveredDeviceBuilder.js.map +1 -1
- package/build/dist/Utils/NetworkDiscovery/PingMonitorBuilder.js +163 -0
- package/build/dist/Utils/NetworkDiscovery/PingMonitorBuilder.js.map +1 -0
- package/build/dist/Utils/NetworkDiscovery/RescanIntervalUtil.js +99 -0
- package/build/dist/Utils/NetworkDiscovery/RescanIntervalUtil.js.map +1 -0
- package/build/dist/Utils/NetworkDiscovery/ScanModeUtil.js +85 -0
- package/build/dist/Utils/NetworkDiscovery/ScanModeUtil.js.map +1 -0
- package/build/dist/Utils/NetworkDiscovery/SnmpScanConfigUtil.js +560 -0
- package/build/dist/Utils/NetworkDiscovery/SnmpScanConfigUtil.js.map +1 -0
- package/build/dist/Utils/NetworkSite/SiteMaintenanceUtil.js +56 -0
- package/build/dist/Utils/NetworkSite/SiteMaintenanceUtil.js.map +1 -0
- package/build/dist/Utils/NetworkSite/SiteStatusRollupUtil.js +185 -10
- package/build/dist/Utils/NetworkSite/SiteStatusRollupUtil.js.map +1 -1
- package/build/dist/Utils/NetworkSite/SiteUptimeUtil.js +248 -21
- package/build/dist/Utils/NetworkSite/SiteUptimeUtil.js.map +1 -1
- package/build/dist/Utils/SecurityEvent/ThreatIntel/StixPatternParser.js +255 -0
- package/build/dist/Utils/SecurityEvent/ThreatIntel/StixPatternParser.js.map +1 -0
- package/build/dist/Utils/Telemetry/CrossSignalScope.js +27 -30
- package/build/dist/Utils/Telemetry/CrossSignalScope.js.map +1 -1
- package/package.json +2 -1
- package/Tests/Types/Log/LogQueryParser.test.ts +0 -186
- package/Types/Log/LogQueryParser.ts +0 -252
- package/build/dist/Types/Log/LogQueryParser.js +0 -200
- package/build/dist/Types/Log/LogQueryParser.js.map +0 -1
|
@@ -0,0 +1,792 @@
|
|
|
1
|
+
import { generateKeyPairSync } from "crypto";
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
import path from "path";
|
|
4
|
+
import DatabaseBaseModel from "../../../Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel";
|
|
5
|
+
import DetectionRule from "../../../Models/DatabaseModels/DetectionRule";
|
|
6
|
+
import GoogleSecOpsConnection from "../../../Models/DatabaseModels/GoogleSecOpsConnection";
|
|
7
|
+
import { AddDetectionRuleAndGoogleSecOpsConnection1788000000000 } from "../../../Server/Infrastructure/Postgres/SchemaMigrations/1788000000000-AddDetectionRuleAndGoogleSecOpsConnection";
|
|
8
|
+
import { WidenSecurityEventLastErrorColumns1789800000000 } from "../../../Server/Infrastructure/Postgres/SchemaMigrations/1789800000000-WidenSecurityEventLastErrorColumns";
|
|
9
|
+
import SchemaMigrations from "../../../Server/Infrastructure/Postgres/SchemaMigrations/Index";
|
|
10
|
+
import DetectionRuleService from "../../../Server/Services/DetectionRuleService";
|
|
11
|
+
import GoogleSecOpsConnectionService from "../../../Server/Services/GoogleSecOpsConnectionService";
|
|
12
|
+
import ConnectorErrorMessage, {
|
|
13
|
+
MAX_CONNECTOR_ERROR_MESSAGE_LENGTH,
|
|
14
|
+
} from "../../../Server/Utils/SecurityEvent/ConnectorErrorMessage";
|
|
15
|
+
import GoogleSecOpsClient, {
|
|
16
|
+
FetchLike,
|
|
17
|
+
FetchResponseLike,
|
|
18
|
+
} from "../../../Server/Utils/SecurityEvent/GoogleSecOps/GoogleSecOpsClient";
|
|
19
|
+
import ColumnLength, {
|
|
20
|
+
getMaxLengthFromTableColumnType,
|
|
21
|
+
} from "../../../Types/Database/ColumnLength";
|
|
22
|
+
import ColumnType from "../../../Types/Database/ColumnType";
|
|
23
|
+
import { TableColumnMetadata } from "../../../Types/Database/TableColumn";
|
|
24
|
+
import TableColumnType from "../../../Types/Database/TableColumnType";
|
|
25
|
+
import { QueryRunner, getMetadataArgsStorage } from "typeorm";
|
|
26
|
+
import type { ColumnMetadataArgs } from "typeorm/metadata-args/ColumnMetadataArgs";
|
|
27
|
+
import { beforeAll, describe, expect, test } from "@jest/globals";
|
|
28
|
+
|
|
29
|
+
/*
|
|
30
|
+
* GoogleSecOpsConnection.lastError and DetectionRule.lastError must stay
|
|
31
|
+
* unbounded text. This file exists because narrowing either of them back
|
|
32
|
+
* is not a cosmetic regression — it silently stops the connector polling
|
|
33
|
+
* loops altogether.
|
|
34
|
+
*
|
|
35
|
+
* What happened: both columns were declared TableColumnType.LongText, i.e.
|
|
36
|
+
* varchar(500), and DatabaseService.checkMaxLengthOfFields rejects any
|
|
37
|
+
* string longer than a column's declared max with a BadDataException. The
|
|
38
|
+
* poller's catch block writes { lastPolledAt, lastError } to record a
|
|
39
|
+
* failed poll, and a Google SecOps client error is a ~46 character prefix
|
|
40
|
+
* plus up to 500 characters of echoed response body — 546, past the bound.
|
|
41
|
+
* So the write that was recording the failure became a second failure,
|
|
42
|
+
* threw out of the catch block, and took pollAllDueConnections down with
|
|
43
|
+
* it: nothing stamped, every remaining connection in that tick skipped,
|
|
44
|
+
* repeated every minute forever. The customer's row read lastPolledAt =
|
|
45
|
+
* null AND lastError = null, because the two columns meant to explain the
|
|
46
|
+
* outage were exactly the ones the outage prevented from being written.
|
|
47
|
+
* DetectionRuleEvaluator had the identical pattern on DetectionRule
|
|
48
|
+
* .lastError, where ClickHouse errors echo the whole compiled query.
|
|
49
|
+
*
|
|
50
|
+
* Four things have to line up, and a regression in any one of them brings
|
|
51
|
+
* the silent outage back:
|
|
52
|
+
* 1. both entities declare VeryLongText / `text` with no length, so
|
|
53
|
+
* getMaxLengthFromTableColumnType returns undefined and the length
|
|
54
|
+
* check cannot reject a stored error at all,
|
|
55
|
+
* 2. the widest message the producers can actually emit really is
|
|
56
|
+
* accepted — pinned end to end, from the client's own error
|
|
57
|
+
* templates through ConnectorErrorMessage.toMessage to the real
|
|
58
|
+
* DatabaseService length check,
|
|
59
|
+
* 3. the migration widens the live Postgres columns with ALTER COLUMN
|
|
60
|
+
* ... TYPE text rather than DROP + ADD, which would discard every
|
|
61
|
+
* error already stored, and
|
|
62
|
+
* 4. the migration is registered in SchemaMigrations/Index.ts — an
|
|
63
|
+
* unregistered migration never runs, so production would stay on
|
|
64
|
+
* varchar(500) while every entity-level assertion here still passed.
|
|
65
|
+
* That combination is precisely how this failure comes back.
|
|
66
|
+
*
|
|
67
|
+
* Pure metadata, source text, mocked query runners and an injected fetch —
|
|
68
|
+
* no Postgres and no network anywhere.
|
|
69
|
+
*/
|
|
70
|
+
|
|
71
|
+
const SCHEMA_MIGRATIONS_DIRECTORY: string = path.join(
|
|
72
|
+
__dirname,
|
|
73
|
+
"..",
|
|
74
|
+
"..",
|
|
75
|
+
"..",
|
|
76
|
+
"Server",
|
|
77
|
+
"Infrastructure",
|
|
78
|
+
"Postgres",
|
|
79
|
+
"SchemaMigrations",
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
const MIGRATION_SOURCE: string = fs.readFileSync(
|
|
83
|
+
path.join(
|
|
84
|
+
SCHEMA_MIGRATIONS_DIRECTORY,
|
|
85
|
+
"1789800000000-WidenSecurityEventLastErrorColumns.ts",
|
|
86
|
+
),
|
|
87
|
+
"utf8",
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
const MIGRATIONS_INDEX_SOURCE: string = fs.readFileSync(
|
|
91
|
+
path.join(SCHEMA_MIGRATIONS_DIRECTORY, "Index.ts"),
|
|
92
|
+
"utf8",
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
const GOOGLE_SECOPS_CLIENT_SOURCE: string = fs.readFileSync(
|
|
96
|
+
path.join(
|
|
97
|
+
__dirname,
|
|
98
|
+
"..",
|
|
99
|
+
"..",
|
|
100
|
+
"..",
|
|
101
|
+
"Server",
|
|
102
|
+
"Utils",
|
|
103
|
+
"SecurityEvent",
|
|
104
|
+
"GoogleSecOps",
|
|
105
|
+
"GoogleSecOpsClient.ts",
|
|
106
|
+
),
|
|
107
|
+
"utf8",
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
/*
|
|
111
|
+
* How many characters of the Chronicle response body each client error
|
|
112
|
+
* template echoes, read out of the client itself rather than restated
|
|
113
|
+
* here. Restating it would let the client widen its echo without a single
|
|
114
|
+
* test noticing that the stored value grew with it.
|
|
115
|
+
*/
|
|
116
|
+
function responseBodyEchoLimits(): Array<number> {
|
|
117
|
+
const pattern: RegExp = /responseText\.slice\(0,\s*(\d+)\)/g;
|
|
118
|
+
const limits: Array<number> = [];
|
|
119
|
+
|
|
120
|
+
let match: RegExpExecArray | null = pattern.exec(GOOGLE_SECOPS_CLIENT_SOURCE);
|
|
121
|
+
while (match) {
|
|
122
|
+
limits.push(Number(match[1]));
|
|
123
|
+
match = pattern.exec(GOOGLE_SECOPS_CLIENT_SOURCE);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return limits;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function responseBodyEchoLimit(): number {
|
|
130
|
+
const limits: Array<number> = responseBodyEchoLimits();
|
|
131
|
+
|
|
132
|
+
if (limits.length === 0) {
|
|
133
|
+
throw new Error(
|
|
134
|
+
"GoogleSecOpsClient no longer echoes the response body with responseText.slice(0, N) — this file's premise needs revisiting",
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
return Math.max(...limits);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const { privateKey } = generateKeyPairSync("rsa", {
|
|
142
|
+
modulusLength: 2048,
|
|
143
|
+
privateKeyEncoding: { type: "pkcs8", format: "pem" },
|
|
144
|
+
publicKeyEncoding: { type: "spki", format: "pem" },
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
const SERVICE_ACCOUNT_JSON: string = JSON.stringify({
|
|
148
|
+
client_email: "poller@example.iam.gserviceaccount.com",
|
|
149
|
+
private_key: privateKey,
|
|
150
|
+
token_uri: "https://oauth2.example.com/token",
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
const INSTANCE: string =
|
|
154
|
+
"projects/my-project/locations/us/instances/3f0a-instance";
|
|
155
|
+
|
|
156
|
+
/*
|
|
157
|
+
* Comfortably longer than anything the client will keep, so both templates
|
|
158
|
+
* echo a full-width body and the resulting message is the widest possible.
|
|
159
|
+
*/
|
|
160
|
+
const OVERSIZED_RESPONSE_BODY: string = "x".repeat(responseBodyEchoLimit() * 4);
|
|
161
|
+
|
|
162
|
+
function makeFetch(
|
|
163
|
+
responses: Array<{ status: number; body: string }>,
|
|
164
|
+
): FetchLike {
|
|
165
|
+
let callIndex: number = 0;
|
|
166
|
+
|
|
167
|
+
return (): Promise<FetchResponseLike> => {
|
|
168
|
+
const response: { status: number; body: string } =
|
|
169
|
+
responses[Math.min(callIndex, responses.length - 1)]!;
|
|
170
|
+
callIndex++;
|
|
171
|
+
|
|
172
|
+
return Promise.resolve({
|
|
173
|
+
ok: response.status >= 200 && response.status < 300,
|
|
174
|
+
status: response.status,
|
|
175
|
+
text: (): Promise<string> => {
|
|
176
|
+
return Promise.resolve(response.body);
|
|
177
|
+
},
|
|
178
|
+
});
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
function successfulTokenResponse(): { status: number; body: string } {
|
|
183
|
+
return {
|
|
184
|
+
status: 200,
|
|
185
|
+
body: JSON.stringify({ access_token: "test-token", expires_in: 3600 }),
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/*
|
|
190
|
+
* Drives the REAL client so the error under test is the one the poller
|
|
191
|
+
* would actually catch, not a hand-written approximation of it.
|
|
192
|
+
*/
|
|
193
|
+
async function thrownClientError(
|
|
194
|
+
responses: Array<{ status: number; body: string }>,
|
|
195
|
+
): Promise<Error> {
|
|
196
|
+
const client: GoogleSecOpsClient = new GoogleSecOpsClient({
|
|
197
|
+
region: "us",
|
|
198
|
+
instanceResourceName: INSTANCE,
|
|
199
|
+
serviceAccountJson: SERVICE_ACCOUNT_JSON,
|
|
200
|
+
fetchImplementation: makeFetch(responses),
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
try {
|
|
204
|
+
await client.fetchDetectionAlerts({
|
|
205
|
+
startTime: new Date("2026-08-21T09:00:00.000Z"),
|
|
206
|
+
endTime: new Date("2026-08-21T10:00:00.000Z"),
|
|
207
|
+
});
|
|
208
|
+
} catch (error) {
|
|
209
|
+
return error as Error;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
throw new Error("Expected GoogleSecOpsClient to throw, but it did not");
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
interface LastErrorColumn {
|
|
216
|
+
label: string;
|
|
217
|
+
table: string;
|
|
218
|
+
target: unknown;
|
|
219
|
+
propertyName: string;
|
|
220
|
+
newInstance: () => DatabaseBaseModel;
|
|
221
|
+
/*
|
|
222
|
+
* Runs the real DatabaseService length check over a row whose lastError
|
|
223
|
+
* is `value`. This is the exact call the poller's recovery write makes
|
|
224
|
+
* on its way to the database.
|
|
225
|
+
*/
|
|
226
|
+
checkLastError: (value: string) => void;
|
|
227
|
+
/*
|
|
228
|
+
* A sibling column on the same model that is still declared LongText —
|
|
229
|
+
* the shape lastError used to have. Used to prove the length check
|
|
230
|
+
* really does reject at 500, so the tests above are falsifiable.
|
|
231
|
+
*/
|
|
232
|
+
longTextSibling: string;
|
|
233
|
+
checkLongTextSibling: (value: string) => void;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
const LAST_ERROR_COLUMNS: Array<LastErrorColumn> = [
|
|
237
|
+
{
|
|
238
|
+
label: "GoogleSecOpsConnection.lastError",
|
|
239
|
+
table: "GoogleSecOpsConnection",
|
|
240
|
+
target: GoogleSecOpsConnection,
|
|
241
|
+
propertyName: "lastError",
|
|
242
|
+
newInstance: (): DatabaseBaseModel => {
|
|
243
|
+
return new GoogleSecOpsConnection();
|
|
244
|
+
},
|
|
245
|
+
checkLastError: (value: string): void => {
|
|
246
|
+
const connection: GoogleSecOpsConnection = new GoogleSecOpsConnection();
|
|
247
|
+
connection.lastError = value;
|
|
248
|
+
GoogleSecOpsConnectionService["checkMaxLengthOfFields"](connection);
|
|
249
|
+
},
|
|
250
|
+
longTextSibling: "cursor",
|
|
251
|
+
checkLongTextSibling: (value: string): void => {
|
|
252
|
+
const connection: GoogleSecOpsConnection = new GoogleSecOpsConnection();
|
|
253
|
+
connection.cursor = value;
|
|
254
|
+
GoogleSecOpsConnectionService["checkMaxLengthOfFields"](connection);
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
label: "DetectionRule.lastError",
|
|
259
|
+
table: "DetectionRule",
|
|
260
|
+
target: DetectionRule,
|
|
261
|
+
propertyName: "lastError",
|
|
262
|
+
newInstance: (): DatabaseBaseModel => {
|
|
263
|
+
return new DetectionRule();
|
|
264
|
+
},
|
|
265
|
+
checkLastError: (value: string): void => {
|
|
266
|
+
const rule: DetectionRule = new DetectionRule();
|
|
267
|
+
rule.lastError = value;
|
|
268
|
+
DetectionRuleService["checkMaxLengthOfFields"](rule);
|
|
269
|
+
},
|
|
270
|
+
longTextSibling: "description",
|
|
271
|
+
checkLongTextSibling: (value: string): void => {
|
|
272
|
+
const rule: DetectionRule = new DetectionRule();
|
|
273
|
+
rule.description = value;
|
|
274
|
+
DetectionRuleService["checkMaxLengthOfFields"](rule);
|
|
275
|
+
},
|
|
276
|
+
},
|
|
277
|
+
];
|
|
278
|
+
|
|
279
|
+
function columnArgs(column: LastErrorColumn): ColumnMetadataArgs {
|
|
280
|
+
const args: ColumnMetadataArgs | undefined = getMetadataArgsStorage()
|
|
281
|
+
.columns.filter((candidate: ColumnMetadataArgs) => {
|
|
282
|
+
return candidate.target === column.target;
|
|
283
|
+
})
|
|
284
|
+
.find((candidate: ColumnMetadataArgs) => {
|
|
285
|
+
return candidate.propertyName === column.propertyName;
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
if (!args) {
|
|
289
|
+
throw new Error(`${column.label} has no TypeORM @Column metadata`);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
return args;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
function metadataFor(column: LastErrorColumn): TableColumnMetadata {
|
|
296
|
+
return column.newInstance().getTableColumnMetadata(column.propertyName);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
function makeQueryRunner(): { runner: QueryRunner; query: jest.Mock } {
|
|
300
|
+
const query: jest.Mock = jest.fn().mockResolvedValue(undefined);
|
|
301
|
+
return { runner: { query } as unknown as QueryRunner, query };
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
function executedSql(query: jest.Mock): Array<string> {
|
|
305
|
+
return query.mock.calls.map((call: Array<unknown>) => {
|
|
306
|
+
return String(call[0]);
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
describe("security-event lastError entity declarations", () => {
|
|
311
|
+
test.each(LAST_ERROR_COLUMNS)(
|
|
312
|
+
"$label is a text column, not a bounded varchar",
|
|
313
|
+
(column: LastErrorColumn) => {
|
|
314
|
+
// ColumnType.VeryLongText is what makes TypeORM emit Postgres `text`.
|
|
315
|
+
expect(columnArgs(column).options.type).toBe(ColumnType.VeryLongText);
|
|
316
|
+
expect(ColumnType.VeryLongText).toBe("text");
|
|
317
|
+
},
|
|
318
|
+
);
|
|
319
|
+
|
|
320
|
+
test.each(LAST_ERROR_COLUMNS)(
|
|
321
|
+
"$label declares no length — a length on a text column is what regenerates drift",
|
|
322
|
+
(column: LastErrorColumn) => {
|
|
323
|
+
expect(columnArgs(column).options.length).toBeUndefined();
|
|
324
|
+
},
|
|
325
|
+
);
|
|
326
|
+
|
|
327
|
+
test.each(LAST_ERROR_COLUMNS)(
|
|
328
|
+
"$label stays nullable, so a connector that has never failed stores nothing",
|
|
329
|
+
(column: LastErrorColumn) => {
|
|
330
|
+
expect(columnArgs(column).options.nullable).toBe(true);
|
|
331
|
+
},
|
|
332
|
+
);
|
|
333
|
+
|
|
334
|
+
test.each(LAST_ERROR_COLUMNS)(
|
|
335
|
+
"$label reports TableColumnType.VeryLongText",
|
|
336
|
+
(column: LastErrorColumn) => {
|
|
337
|
+
expect(metadataFor(column).type).toBe(TableColumnType.VeryLongText);
|
|
338
|
+
},
|
|
339
|
+
);
|
|
340
|
+
|
|
341
|
+
test.each(LAST_ERROR_COLUMNS)(
|
|
342
|
+
"$label has no max length, so checkMaxLengthOfFields cannot reject a value written to it",
|
|
343
|
+
(column: LastErrorColumn) => {
|
|
344
|
+
/*
|
|
345
|
+
* The invariant the outage turned on. checkMaxLengthOfFields only
|
|
346
|
+
* validates a column when getMaxLengthFromTableColumnType returns a
|
|
347
|
+
* number; undefined means the guard is skipped entirely, so the
|
|
348
|
+
* poller's own error-recording write can never be the thing that
|
|
349
|
+
* throws. Back when this was LongText it returned 500, the write
|
|
350
|
+
* threw, and the poll loop died with it.
|
|
351
|
+
*/
|
|
352
|
+
expect(
|
|
353
|
+
getMaxLengthFromTableColumnType(metadataFor(column).type),
|
|
354
|
+
).toBeUndefined();
|
|
355
|
+
},
|
|
356
|
+
);
|
|
357
|
+
|
|
358
|
+
test.each(LAST_ERROR_COLUMNS)(
|
|
359
|
+
"$label stays readable on relation queries and optional",
|
|
360
|
+
(column: LastErrorColumn) => {
|
|
361
|
+
const metadata: TableColumnMetadata = metadataFor(column);
|
|
362
|
+
expect(metadata.canReadOnRelationQuery).toBe(true);
|
|
363
|
+
expect(metadata.required).toBeFalsy();
|
|
364
|
+
},
|
|
365
|
+
);
|
|
366
|
+
|
|
367
|
+
test("the old LongText declaration really was the 500-character bound", () => {
|
|
368
|
+
/*
|
|
369
|
+
* Guards the premise of the whole fix. If LongText ever stopped
|
|
370
|
+
* meaning 500, every "this used to overflow" claim below would be
|
|
371
|
+
* describing a bound that no longer exists.
|
|
372
|
+
*/
|
|
373
|
+
expect(getMaxLengthFromTableColumnType(TableColumnType.LongText)).toBe(
|
|
374
|
+
ColumnLength.LongText,
|
|
375
|
+
);
|
|
376
|
+
expect(ColumnLength.LongText).toBe(500);
|
|
377
|
+
});
|
|
378
|
+
});
|
|
379
|
+
|
|
380
|
+
describe("the widest error the producers can emit is storable", () => {
|
|
381
|
+
let tokenExchangeError: Error;
|
|
382
|
+
let alertsFetchError: Error;
|
|
383
|
+
let widestClientError: Error;
|
|
384
|
+
|
|
385
|
+
beforeAll(async () => {
|
|
386
|
+
// Fails at the JWT-bearer token exchange: the first template.
|
|
387
|
+
tokenExchangeError = await thrownClientError([
|
|
388
|
+
{ status: 503, body: OVERSIZED_RESPONSE_BODY },
|
|
389
|
+
]);
|
|
390
|
+
|
|
391
|
+
// Token succeeds, the alerts call fails: the second template.
|
|
392
|
+
alertsFetchError = await thrownClientError([
|
|
393
|
+
successfulTokenResponse(),
|
|
394
|
+
{ status: 500, body: OVERSIZED_RESPONSE_BODY },
|
|
395
|
+
]);
|
|
396
|
+
|
|
397
|
+
widestClientError =
|
|
398
|
+
alertsFetchError.message.length >= tokenExchangeError.message.length
|
|
399
|
+
? alertsFetchError
|
|
400
|
+
: tokenExchangeError;
|
|
401
|
+
});
|
|
402
|
+
|
|
403
|
+
test("the client has exactly two error templates and both echo the body under the same cap", () => {
|
|
404
|
+
const limits: Array<number> = responseBodyEchoLimits();
|
|
405
|
+
|
|
406
|
+
expect(limits).toHaveLength(2);
|
|
407
|
+
for (const limit of limits) {
|
|
408
|
+
expect(limit).toBe(responseBodyEchoLimit());
|
|
409
|
+
}
|
|
410
|
+
});
|
|
411
|
+
|
|
412
|
+
test("each template is a fixed prefix plus a full-width echo of the response body", () => {
|
|
413
|
+
const echoLimit: number = responseBodyEchoLimit();
|
|
414
|
+
|
|
415
|
+
for (const error of [tokenExchangeError, alertsFetchError]) {
|
|
416
|
+
// The tail is the echoed body, clipped to the client's own cap.
|
|
417
|
+
expect(error.message.endsWith("x".repeat(echoLimit))).toBe(true);
|
|
418
|
+
expect(error.message.endsWith("x".repeat(echoLimit + 1))).toBe(false);
|
|
419
|
+
|
|
420
|
+
// ...and ahead of it, a non-empty prefix naming the HTTP status.
|
|
421
|
+
const prefix: string = error.message.slice(
|
|
422
|
+
0,
|
|
423
|
+
error.message.length - echoLimit,
|
|
424
|
+
);
|
|
425
|
+
expect(prefix.length).toBeGreaterThan(0);
|
|
426
|
+
expect(prefix).toContain("HTTP");
|
|
427
|
+
}
|
|
428
|
+
});
|
|
429
|
+
|
|
430
|
+
test("the widest client error overflows the bound lastError used to carry", () => {
|
|
431
|
+
/*
|
|
432
|
+
* This is the string that killed the poller. Prefix + echoed body is
|
|
433
|
+
* larger than varchar(500), so writing it back onto the row raised
|
|
434
|
+
* BadDataException from inside the catch block.
|
|
435
|
+
*/
|
|
436
|
+
const oldMaxLength: number = getMaxLengthFromTableColumnType(
|
|
437
|
+
TableColumnType.LongText,
|
|
438
|
+
)!;
|
|
439
|
+
|
|
440
|
+
expect(widestClientError.message.length).toBeGreaterThan(oldMaxLength);
|
|
441
|
+
|
|
442
|
+
// The overflow is not marginal: the echoed body alone fills the old column.
|
|
443
|
+
expect(responseBodyEchoLimit()).toBe(oldMaxLength);
|
|
444
|
+
});
|
|
445
|
+
|
|
446
|
+
test("toMessage keeps the widest client error intact and under the connector cap", () => {
|
|
447
|
+
const stored: string = ConnectorErrorMessage.toMessage(widestClientError);
|
|
448
|
+
|
|
449
|
+
// Prefix + 500 still fits in 1000, so nothing is lost from an API error.
|
|
450
|
+
expect(stored).toBe(widestClientError.message);
|
|
451
|
+
expect(stored.length).toBeLessThanOrEqual(
|
|
452
|
+
MAX_CONNECTOR_ERROR_MESSAGE_LENGTH,
|
|
453
|
+
);
|
|
454
|
+
});
|
|
455
|
+
|
|
456
|
+
test.each(LAST_ERROR_COLUMNS)(
|
|
457
|
+
"$label accepts the widest client error — the real length check does not reject it",
|
|
458
|
+
(column: LastErrorColumn) => {
|
|
459
|
+
/*
|
|
460
|
+
* The end-to-end guard: the same value the poller would store, run
|
|
461
|
+
* through the same DatabaseService validation that used to throw.
|
|
462
|
+
* Pre-fix (LongText/varchar(500)) this raised BadDataException, the
|
|
463
|
+
* throw escaped pollAllDueConnections, and the tick died.
|
|
464
|
+
*/
|
|
465
|
+
const stored: string = ConnectorErrorMessage.toMessage(widestClientError);
|
|
466
|
+
|
|
467
|
+
expect(() => {
|
|
468
|
+
return column.checkLastError(stored);
|
|
469
|
+
}).not.toThrow();
|
|
470
|
+
},
|
|
471
|
+
);
|
|
472
|
+
|
|
473
|
+
test.each(LAST_ERROR_COLUMNS)(
|
|
474
|
+
"$longTextSibling on the same model still rejects that very string, so the check is real",
|
|
475
|
+
(column: LastErrorColumn) => {
|
|
476
|
+
/*
|
|
477
|
+
* Falsifies the test above. checkMaxLengthOfFields is not a no-op:
|
|
478
|
+
* hand the identical string to a sibling column that is still
|
|
479
|
+
* LongText and it throws exactly as lastError used to. The only
|
|
480
|
+
* thing that changed is the declared column type.
|
|
481
|
+
*/
|
|
482
|
+
const stored: string = ConnectorErrorMessage.toMessage(widestClientError);
|
|
483
|
+
|
|
484
|
+
expect(
|
|
485
|
+
getMaxLengthFromTableColumnType(
|
|
486
|
+
column.newInstance().getTableColumnMetadata(column.longTextSibling)
|
|
487
|
+
.type,
|
|
488
|
+
),
|
|
489
|
+
).toBe(ColumnLength.LongText);
|
|
490
|
+
|
|
491
|
+
expect(() => {
|
|
492
|
+
return column.checkLongTextSibling(stored);
|
|
493
|
+
}).toThrow(`${column.longTextSibling} length cannot be more than`);
|
|
494
|
+
},
|
|
495
|
+
);
|
|
496
|
+
|
|
497
|
+
test.each(LAST_ERROR_COLUMNS)(
|
|
498
|
+
"$label accepts a clamped ClickHouse-sized error too",
|
|
499
|
+
(column: LastErrorColumn) => {
|
|
500
|
+
/*
|
|
501
|
+
* The evaluator's side: a ClickHouse error echoes the whole
|
|
502
|
+
* compiled query, so it has no natural bound. toMessage clamps it
|
|
503
|
+
* to exactly MAX_CONNECTOR_ERROR_MESSAGE_LENGTH — still double the
|
|
504
|
+
* old varchar(500), so widening the column is what makes even the
|
|
505
|
+
* clamped value storable.
|
|
506
|
+
*/
|
|
507
|
+
const clickhouseError: Error = new Error(
|
|
508
|
+
`Code: 47. DB::Exception: Missing columns while processing query: ${"SELECT ".repeat(
|
|
509
|
+
MAX_CONNECTOR_ERROR_MESSAGE_LENGTH,
|
|
510
|
+
)}`,
|
|
511
|
+
);
|
|
512
|
+
|
|
513
|
+
const stored: string = ConnectorErrorMessage.toMessage(clickhouseError);
|
|
514
|
+
|
|
515
|
+
expect(stored.length).toBe(MAX_CONNECTOR_ERROR_MESSAGE_LENGTH);
|
|
516
|
+
expect(stored.length).toBeGreaterThan(
|
|
517
|
+
getMaxLengthFromTableColumnType(TableColumnType.LongText)!,
|
|
518
|
+
);
|
|
519
|
+
expect(() => {
|
|
520
|
+
return column.checkLastError(stored);
|
|
521
|
+
}).not.toThrow();
|
|
522
|
+
},
|
|
523
|
+
);
|
|
524
|
+
|
|
525
|
+
test("the connector cap is the ceiling on anything that reaches these columns", () => {
|
|
526
|
+
/*
|
|
527
|
+
* Ties the clamp to the column: whatever the producers throw, what is
|
|
528
|
+
* actually written is at most MAX_CONNECTOR_ERROR_MESSAGE_LENGTH, and
|
|
529
|
+
* a text column has no bound to compare that against.
|
|
530
|
+
*/
|
|
531
|
+
for (const error of [
|
|
532
|
+
tokenExchangeError,
|
|
533
|
+
alertsFetchError,
|
|
534
|
+
new Error("y".repeat(MAX_CONNECTOR_ERROR_MESSAGE_LENGTH * 10)),
|
|
535
|
+
]) {
|
|
536
|
+
expect(ConnectorErrorMessage.toMessage(error).length).toBeLessThanOrEqual(
|
|
537
|
+
MAX_CONNECTOR_ERROR_MESSAGE_LENGTH,
|
|
538
|
+
);
|
|
539
|
+
}
|
|
540
|
+
});
|
|
541
|
+
});
|
|
542
|
+
|
|
543
|
+
describe("WidenSecurityEventLastErrorColumns1789800000000 SQL contract", () => {
|
|
544
|
+
const migration: WidenSecurityEventLastErrorColumns1789800000000 =
|
|
545
|
+
new WidenSecurityEventLastErrorColumns1789800000000();
|
|
546
|
+
|
|
547
|
+
test("up() widens both tables' lastError to text", async () => {
|
|
548
|
+
const { runner, query } = makeQueryRunner();
|
|
549
|
+
await migration.up(runner);
|
|
550
|
+
|
|
551
|
+
const statements: Array<string> = executedSql(query);
|
|
552
|
+
expect(statements).toHaveLength(LAST_ERROR_COLUMNS.length);
|
|
553
|
+
|
|
554
|
+
for (const column of LAST_ERROR_COLUMNS) {
|
|
555
|
+
expect(statements).toContain(
|
|
556
|
+
`ALTER TABLE "${column.table}" ALTER COLUMN "${column.propertyName}" TYPE text`,
|
|
557
|
+
);
|
|
558
|
+
}
|
|
559
|
+
});
|
|
560
|
+
|
|
561
|
+
test("up() alters in place and never drops the column", async () => {
|
|
562
|
+
/*
|
|
563
|
+
* The DDL TypeORM generates for varchar -> text is DROP COLUMN +
|
|
564
|
+
* ADD COLUMN, which would throw away every error already stored on
|
|
565
|
+
* upgrade — including the ones a customer is mid-investigation on.
|
|
566
|
+
* varchar -> text is binary-coercible, so ALTER ... TYPE is enough.
|
|
567
|
+
*/
|
|
568
|
+
const { runner, query } = makeQueryRunner();
|
|
569
|
+
await migration.up(runner);
|
|
570
|
+
|
|
571
|
+
for (const sql of executedSql(query)) {
|
|
572
|
+
expect(sql).toContain("ALTER COLUMN");
|
|
573
|
+
expect(sql).toContain("TYPE text");
|
|
574
|
+
expect(sql).not.toContain("DROP");
|
|
575
|
+
expect(sql).not.toContain("DELETE");
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
expect(MIGRATION_SOURCE).not.toContain("DROP COLUMN");
|
|
579
|
+
});
|
|
580
|
+
|
|
581
|
+
test("up() touches no column other than the two lastError columns", async () => {
|
|
582
|
+
const { runner, query } = makeQueryRunner();
|
|
583
|
+
await migration.up(runner);
|
|
584
|
+
|
|
585
|
+
const altered: Array<string> = executedSql(query)
|
|
586
|
+
.map((sql: string) => {
|
|
587
|
+
const match: RegExpMatchArray | null = sql.match(
|
|
588
|
+
/ALTER TABLE "(\w+)" ALTER COLUMN "(\w+)"/,
|
|
589
|
+
);
|
|
590
|
+
return match ? `${match[1]}.${match[2]}` : sql;
|
|
591
|
+
})
|
|
592
|
+
.sort();
|
|
593
|
+
|
|
594
|
+
expect(altered).toEqual(
|
|
595
|
+
LAST_ERROR_COLUMNS.map((column: LastErrorColumn) => {
|
|
596
|
+
return `${column.table}.${column.propertyName}`;
|
|
597
|
+
}).sort(),
|
|
598
|
+
);
|
|
599
|
+
});
|
|
600
|
+
|
|
601
|
+
test("the migration widens exactly the columns the entities declare as text", async () => {
|
|
602
|
+
/*
|
|
603
|
+
* Catches the half-applied fix: widening the entity but not the
|
|
604
|
+
* migration (or vice versa) leaves Postgres rejecting values the
|
|
605
|
+
* model claims fit.
|
|
606
|
+
*/
|
|
607
|
+
const { runner, query } = makeQueryRunner();
|
|
608
|
+
await migration.up(runner);
|
|
609
|
+
const statements: Array<string> = executedSql(query);
|
|
610
|
+
|
|
611
|
+
for (const column of LAST_ERROR_COLUMNS) {
|
|
612
|
+
expect(columnArgs(column).options.type).toBe(ColumnType.VeryLongText);
|
|
613
|
+
expect(statements).toContain(
|
|
614
|
+
`ALTER TABLE "${column.table}" ALTER COLUMN "${column.propertyName}" TYPE ${ColumnType.VeryLongText}`,
|
|
615
|
+
);
|
|
616
|
+
}
|
|
617
|
+
});
|
|
618
|
+
|
|
619
|
+
test("down() truncates oversized rows BEFORE narrowing, so the revert cannot fail", async () => {
|
|
620
|
+
const { runner, query } = makeQueryRunner();
|
|
621
|
+
await migration.down(runner);
|
|
622
|
+
|
|
623
|
+
const statements: Array<string> = executedSql(query);
|
|
624
|
+
|
|
625
|
+
/*
|
|
626
|
+
* Per table, not globally: down() finishes one table before starting
|
|
627
|
+
* the next, so what matters is that each table's clipping UPDATE
|
|
628
|
+
* lands ahead of that same table's narrowing ALTER.
|
|
629
|
+
*/
|
|
630
|
+
for (const column of LAST_ERROR_COLUMNS) {
|
|
631
|
+
const clipIndex: number = statements.findIndex((sql: string) => {
|
|
632
|
+
return (
|
|
633
|
+
sql.startsWith(`UPDATE "${column.table}"`) &&
|
|
634
|
+
sql.includes(`SET "${column.propertyName}" = LEFT(`) &&
|
|
635
|
+
sql.includes(String(ColumnLength.LongText))
|
|
636
|
+
);
|
|
637
|
+
});
|
|
638
|
+
const narrowIndex: number = statements.indexOf(
|
|
639
|
+
`ALTER TABLE "${column.table}" ALTER COLUMN "${column.propertyName}" TYPE character varying(${ColumnLength.LongText})`,
|
|
640
|
+
);
|
|
641
|
+
|
|
642
|
+
expect(clipIndex).toBeGreaterThanOrEqual(0);
|
|
643
|
+
expect(narrowIndex).toBeGreaterThanOrEqual(0);
|
|
644
|
+
expect(clipIndex).toBeLessThan(narrowIndex);
|
|
645
|
+
}
|
|
646
|
+
});
|
|
647
|
+
|
|
648
|
+
test("down() restores exactly the width the creating migration used", async () => {
|
|
649
|
+
const createTables: AddDetectionRuleAndGoogleSecOpsConnection1788000000000 =
|
|
650
|
+
new AddDetectionRuleAndGoogleSecOpsConnection1788000000000();
|
|
651
|
+
const { runner: createRunner, query: createQuery } = makeQueryRunner();
|
|
652
|
+
await createTables.up(createRunner);
|
|
653
|
+
|
|
654
|
+
const { runner: downRunner, query: downQuery } = makeQueryRunner();
|
|
655
|
+
await migration.down(downRunner);
|
|
656
|
+
|
|
657
|
+
const createStatements: Array<string> = executedSql(createQuery);
|
|
658
|
+
const downStatements: Array<string> = executedSql(downQuery);
|
|
659
|
+
|
|
660
|
+
for (const column of LAST_ERROR_COLUMNS) {
|
|
661
|
+
/*
|
|
662
|
+
* Scope the search to the statement that creates THIS table — a
|
|
663
|
+
* bare substring match would be satisfied by any of the other
|
|
664
|
+
* varchar(500) columns in the same migration.
|
|
665
|
+
*/
|
|
666
|
+
const declaringStatement: string | undefined = createStatements.find(
|
|
667
|
+
(sql: string) => {
|
|
668
|
+
return (
|
|
669
|
+
sql.startsWith(`CREATE TABLE "${column.table}" (`) &&
|
|
670
|
+
sql.includes(
|
|
671
|
+
`"${column.propertyName}" character varying(${ColumnLength.LongText})`,
|
|
672
|
+
)
|
|
673
|
+
);
|
|
674
|
+
},
|
|
675
|
+
);
|
|
676
|
+
|
|
677
|
+
// Production really is on varchar(500) until this migration runs.
|
|
678
|
+
expect(declaringStatement).toBeDefined();
|
|
679
|
+
|
|
680
|
+
expect(downStatements).toContain(
|
|
681
|
+
`ALTER TABLE "${column.table}" ALTER COLUMN "${column.propertyName}" TYPE character varying(${ColumnLength.LongText})`,
|
|
682
|
+
);
|
|
683
|
+
}
|
|
684
|
+
});
|
|
685
|
+
|
|
686
|
+
test("the class name carries its own timestamp, matching the file name", () => {
|
|
687
|
+
expect(migration.name).toBe(
|
|
688
|
+
"WidenSecurityEventLastErrorColumns1789800000000",
|
|
689
|
+
);
|
|
690
|
+
});
|
|
691
|
+
});
|
|
692
|
+
|
|
693
|
+
describe("WidenSecurityEventLastErrorColumns1789800000000 registration", () => {
|
|
694
|
+
/*
|
|
695
|
+
* The nastiest way this bug comes back: everything above passes on an
|
|
696
|
+
* unregistered migration, because entity metadata does not care whether
|
|
697
|
+
* the DDL ever ran. Postgres would stay at varchar(500), the poller's
|
|
698
|
+
* recovery write would keep throwing, and the loop would keep dying —
|
|
699
|
+
* with a green test suite.
|
|
700
|
+
*/
|
|
701
|
+
test("is imported in SchemaMigrations/Index.ts", () => {
|
|
702
|
+
expect(MIGRATIONS_INDEX_SOURCE).toContain(
|
|
703
|
+
`import { WidenSecurityEventLastErrorColumns1789800000000 } from "./1789800000000-WidenSecurityEventLastErrorColumns";`,
|
|
704
|
+
);
|
|
705
|
+
});
|
|
706
|
+
|
|
707
|
+
test("is listed in the exported migration array", () => {
|
|
708
|
+
expect(SchemaMigrations).toContain(
|
|
709
|
+
WidenSecurityEventLastErrorColumns1789800000000,
|
|
710
|
+
);
|
|
711
|
+
expect(MIGRATIONS_INDEX_SOURCE).toContain(
|
|
712
|
+
" WidenSecurityEventLastErrorColumns1789800000000,",
|
|
713
|
+
);
|
|
714
|
+
});
|
|
715
|
+
|
|
716
|
+
test("is registered exactly once", () => {
|
|
717
|
+
const occurrences: number = SchemaMigrations.filter(
|
|
718
|
+
(migration: unknown) => {
|
|
719
|
+
return migration === WidenSecurityEventLastErrorColumns1789800000000;
|
|
720
|
+
},
|
|
721
|
+
).length;
|
|
722
|
+
expect(occurrences).toBe(1);
|
|
723
|
+
});
|
|
724
|
+
|
|
725
|
+
/*
|
|
726
|
+
* Ordering is by TIMESTAMP, not by position in the array. TypeORM's
|
|
727
|
+
* MigrationExecutor.getMigrations() parses the trailing 13 digits off
|
|
728
|
+
* each class name and sorts by that, ignoring the order the classes were
|
|
729
|
+
* registered in — and this repo's array genuinely does deviate from
|
|
730
|
+
* timestamp order in places, so array position is not even accidentally
|
|
731
|
+
* the same thing. Asserting on indexOf would therefore pass for a
|
|
732
|
+
* migration appended to the end of the array with a timestamp that sorts
|
|
733
|
+
* it BEFORE the table it alters, which is exactly the mistake worth
|
|
734
|
+
* catching: widening a column on a table that does not exist yet fails
|
|
735
|
+
* outright, and the generator stamps new migrations with Date.now(),
|
|
736
|
+
* which is behind the hand-picked timestamps already in this directory.
|
|
737
|
+
*/
|
|
738
|
+
function migrationTimestamp(migration: unknown): number {
|
|
739
|
+
/*
|
|
740
|
+
* Resolve the name the way MigrationExecutor does: it instantiates each
|
|
741
|
+
* registered class and reads `instance.name || instance.constructor.name`.
|
|
742
|
+
* That distinction is load-bearing here — InitialMigration's class name
|
|
743
|
+
* carries no timestamp at all and only its instance `name` property does,
|
|
744
|
+
* so reading the constructor's own `.name` would parse NaN for it.
|
|
745
|
+
*/
|
|
746
|
+
const Migration: new () => { name?: string } = migration as new () => {
|
|
747
|
+
name?: string;
|
|
748
|
+
};
|
|
749
|
+
const instance: { name?: string } = new Migration();
|
|
750
|
+
const className: string = instance.name || Migration.name;
|
|
751
|
+
|
|
752
|
+
return Number(className.slice(-13));
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
test("sorts after the migration that created both tables", () => {
|
|
756
|
+
const createTimestamp: number = migrationTimestamp(
|
|
757
|
+
AddDetectionRuleAndGoogleSecOpsConnection1788000000000,
|
|
758
|
+
);
|
|
759
|
+
const widenTimestamp: number = migrationTimestamp(
|
|
760
|
+
WidenSecurityEventLastErrorColumns1789800000000,
|
|
761
|
+
);
|
|
762
|
+
|
|
763
|
+
// NaN would silently satisfy neither comparison below; rule it out first.
|
|
764
|
+
expect(Number.isFinite(createTimestamp)).toBe(true);
|
|
765
|
+
expect(Number.isFinite(widenTimestamp)).toBe(true);
|
|
766
|
+
|
|
767
|
+
expect(widenTimestamp).toBeGreaterThan(createTimestamp);
|
|
768
|
+
});
|
|
769
|
+
|
|
770
|
+
/*
|
|
771
|
+
* And nothing registered anywhere sorts between the two by accident
|
|
772
|
+
* while claiming the same timestamp — a duplicate would make the
|
|
773
|
+
* relative order of those two migrations depend on Array.prototype.sort
|
|
774
|
+
* stability rather than on anything intentional.
|
|
775
|
+
*/
|
|
776
|
+
test("does not collide with another registered migration's timestamp", () => {
|
|
777
|
+
const widenTimestamp: number = migrationTimestamp(
|
|
778
|
+
WidenSecurityEventLastErrorColumns1789800000000,
|
|
779
|
+
);
|
|
780
|
+
|
|
781
|
+
const collisions: Array<unknown> = SchemaMigrations.filter(
|
|
782
|
+
(migration: unknown) => {
|
|
783
|
+
return (
|
|
784
|
+
migration !== WidenSecurityEventLastErrorColumns1789800000000 &&
|
|
785
|
+
migrationTimestamp(migration) === widenTimestamp
|
|
786
|
+
);
|
|
787
|
+
},
|
|
788
|
+
);
|
|
789
|
+
|
|
790
|
+
expect(collisions).toHaveLength(0);
|
|
791
|
+
});
|
|
792
|
+
});
|