@oneuptime/common 12.0.24 → 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/Span.ts +101 -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 -27
- 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 -2
- 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/Middleware/SlackAuthorization.ts +96 -18
- 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/LlmMetricSpend.ts +56 -5
- package/Server/Utils/Telemetry/LlmSpan.ts +46 -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/Utils/Workspace/Slack/Actions/Auth.ts +0 -12
- 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/LlmCallsTableIdentity.test.tsx +322 -0
- package/Tests/App/Dashboard/LlmOverview.test.tsx +335 -0
- package/Tests/App/Dashboard/LlmSpanDisplay.test.ts +391 -0
- package/Tests/App/Dashboard/LlmUsageBreakdown.test.tsx +1007 -0
- 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/BaseAPI.test.ts +41 -0
- package/Tests/Server/API/BaseAPIUpdateDateColumns.test.ts +154 -0
- package/Tests/Server/API/BaseAPIUpdatePayloadValidation.test.ts +9 -16
- 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/Middleware/SlackAuthorization.test.ts +262 -5
- 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/LlmCostBudgetEvaluator.test.ts +37 -18
- package/Tests/Server/Utils/Telemetry/LlmMetricSpend.test.ts +143 -2
- package/Tests/Server/Utils/Telemetry/LlmSpan.test.ts +804 -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/LlmMetricConventions.test.ts +391 -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/Tests/Utils/Telemetry/LlmMetricQuery.test.ts +298 -0
- 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/LlmConventions.ts +255 -0
- package/Types/Telemetry/LlmMetricConventions.ts +212 -7
- 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/Utils/Telemetry/LlmMetricQuery.ts +83 -0
- package/build/dist/Models/AnalyticsModels/Index.js +2 -0
- package/build/dist/Models/AnalyticsModels/Index.js.map +1 -1
- package/build/dist/Models/AnalyticsModels/Span.js +89 -0
- package/build/dist/Models/AnalyticsModels/Span.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 +11 -20
- 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 -2
- 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/Middleware/SlackAuthorization.js +58 -7
- package/build/dist/Server/Middleware/SlackAuthorization.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/LlmMetricSpend.js +52 -3
- package/build/dist/Server/Utils/Telemetry/LlmMetricSpend.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/LlmSpan.js +24 -1
- package/build/dist/Server/Utils/Telemetry/LlmSpan.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/Server/Utils/Workspace/Slack/Actions/Auth.js +0 -10
- package/build/dist/Server/Utils/Workspace/Slack/Actions/Auth.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/LlmConventions.js +236 -0
- package/build/dist/Types/Telemetry/LlmConventions.js.map +1 -1
- package/build/dist/Types/Telemetry/LlmMetricConventions.js +197 -5
- package/build/dist/Types/Telemetry/LlmMetricConventions.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/build/dist/Utils/Telemetry/LlmMetricQuery.js +57 -1
- package/build/dist/Utils/Telemetry/LlmMetricQuery.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
|
@@ -3,9 +3,13 @@ import NetworkDeviceAutoImportRule from "../../Models/DatabaseModels/NetworkDevi
|
|
|
3
3
|
import NetworkDeviceDiscoveryScan, {
|
|
4
4
|
DiscoveredNetworkDevice,
|
|
5
5
|
} from "../../Models/DatabaseModels/NetworkDeviceDiscoveryScan";
|
|
6
|
+
import Monitor from "../../Models/DatabaseModels/Monitor";
|
|
7
|
+
import MonitorTemplate from "../../Models/DatabaseModels/MonitorTemplate";
|
|
6
8
|
import NetworkDeviceAutoImportRuleService from "./NetworkDeviceAutoImportRuleService";
|
|
7
9
|
import NetworkDeviceDiscoveryScanService from "./NetworkDeviceDiscoveryScanService";
|
|
8
10
|
import NetworkDeviceService from "./NetworkDeviceService";
|
|
11
|
+
import MonitorService from "./MonitorService";
|
|
12
|
+
import MonitorTemplateService from "./MonitorTemplateService";
|
|
9
13
|
import BadDataException from "../../Types/Exception/BadDataException";
|
|
10
14
|
import { JSONObject } from "../../Types/JSON";
|
|
11
15
|
import LIMIT_MAX from "../../Types/Database/LimitMax";
|
|
@@ -13,19 +17,28 @@ import ObjectID from "../../Types/ObjectID";
|
|
|
13
17
|
import OneUptimeDate from "../../Types/Date";
|
|
14
18
|
import QueryDeepPartialEntity from "../../Types/Database/PartialEntity";
|
|
15
19
|
import SortOrder from "../../Types/BaseDatabase/SortOrder";
|
|
20
|
+
import MonitorType from "../../Types/Monitor/MonitorType";
|
|
16
21
|
import {
|
|
17
22
|
AutoImportRuleRunResult,
|
|
18
23
|
MAX_MATCHED_IP_SAMPLE,
|
|
19
24
|
} from "../../Types/NetworkAutomation/RuleRunResult";
|
|
20
25
|
import AutoImportRuleMatcher, {
|
|
21
26
|
AutoImportHostEvaluation,
|
|
27
|
+
AutoImportRuleCandidate,
|
|
22
28
|
} from "../../Utils/NetworkDiscovery/AutoImportRuleMatcher";
|
|
23
29
|
import {
|
|
24
30
|
buildFallbackDeviceName,
|
|
25
31
|
buildNetworkDeviceFromDiscoveredHost,
|
|
26
32
|
} from "../../Utils/NetworkDiscovery/DiscoveredDeviceBuilder";
|
|
27
33
|
import { normalizeDiscoveredHosts } from "../../Utils/NetworkDiscovery/DiscoveredHostUtil";
|
|
34
|
+
import { monitoringMethodForDiscoveredHost } from "../../Utils/NetworkDiscovery/DiscoveryImportEligibility";
|
|
35
|
+
import NetworkDeviceMonitoringMethod, {
|
|
36
|
+
NetworkDeviceMonitoringMethodUtil,
|
|
37
|
+
} from "../../Types/NetworkDevice/NetworkDeviceMonitoringMethod";
|
|
38
|
+
import NetworkDeviceMonitorTemplateUtil from "../../Utils/Monitor/NetworkDeviceMonitorTemplateUtil";
|
|
28
39
|
import Semaphore, { SemaphoreMutex } from "../Infrastructure/Semaphore";
|
|
40
|
+
import QueryHelper from "../Types/Database/QueryHelper";
|
|
41
|
+
import NetworkDeviceHydrationUtil from "../Utils/Monitor/NetworkDeviceHydrationUtil";
|
|
29
42
|
import CaptureSpan from "../Utils/Telemetry/CaptureSpan";
|
|
30
43
|
import logger, { LogAttributes } from "../Utils/Logger";
|
|
31
44
|
|
|
@@ -48,8 +61,9 @@ import logger, { LogAttributes } from "../Utils/Logger";
|
|
|
48
61
|
*
|
|
49
62
|
* Everything here is idempotent by construction: a device exists per
|
|
50
63
|
* (project, address), recurring scans re-report the same hosts every
|
|
51
|
-
* interval, and both paths
|
|
52
|
-
*
|
|
64
|
+
* interval, and both paths reuse hosts whose address is already registered.
|
|
65
|
+
* Existing devices are still reconciled for a selected template monitor,
|
|
66
|
+
* while provenance keys prevent the same monitor from being created twice.
|
|
53
67
|
*/
|
|
54
68
|
|
|
55
69
|
/*
|
|
@@ -63,6 +77,13 @@ export const AUTO_IMPORT_SCAN_CREDENTIAL_SELECT: {
|
|
|
63
77
|
[key: string]: boolean;
|
|
64
78
|
} = {
|
|
65
79
|
probeId: true,
|
|
80
|
+
/*
|
|
81
|
+
* The ordered credential list, so an imported device is built with the
|
|
82
|
+
* config that ACTUALLY answered its address rather than with the scan's
|
|
83
|
+
* first one. The flattened columns below are what a scan written out of
|
|
84
|
+
* band carries, and are the fallback SnmpScanConfigUtil resolves to.
|
|
85
|
+
*/
|
|
86
|
+
snmpConfigs: true,
|
|
66
87
|
snmpVersion: true,
|
|
67
88
|
snmpCommunityString: true,
|
|
68
89
|
snmpPort: true,
|
|
@@ -85,6 +106,16 @@ export const AUTO_IMPORT_SCAN_CREDENTIAL_SELECT: {
|
|
|
85
106
|
*/
|
|
86
107
|
export const MAX_DEVICES_PER_AUTO_IMPORT_RUN: number = 500;
|
|
87
108
|
|
|
109
|
+
/*
|
|
110
|
+
* Monitor creates run an even broader service pipeline than device creates:
|
|
111
|
+
* plan limits, operational status, labels, owners, SLOs and status pages all
|
|
112
|
+
* participate. Keep a separate cap so reconciling an existing /16 cannot
|
|
113
|
+
* bypass the device cap merely because all devices are already registered.
|
|
114
|
+
* A truncated automatic pass leaves its marker NULL whenever it made
|
|
115
|
+
* progress, and the next sweep resumes from the queryable provenance keys.
|
|
116
|
+
*/
|
|
117
|
+
export const MAX_MONITORS_PER_AUTO_IMPORT_RUN: number = 500;
|
|
118
|
+
|
|
88
119
|
// Scans one manual "Run Now" will read, oldest results last.
|
|
89
120
|
export const MAX_SCANS_PER_AUTO_IMPORT_RULE_RUN: number = 100;
|
|
90
121
|
|
|
@@ -122,7 +153,21 @@ export const AUTO_IMPORT_SWEEP_LOCK_TIMEOUT_MS: number = 11 * 60 * 1000;
|
|
|
122
153
|
* read as registered when scan B reports the same address seconds later —
|
|
123
154
|
* before any re-read of the device table would show it.
|
|
124
155
|
*/
|
|
125
|
-
export type ExistingHostnamesByProjectId = Map<
|
|
156
|
+
export type ExistingHostnamesByProjectId = Map<
|
|
157
|
+
string,
|
|
158
|
+
Map<string, NetworkDevice>
|
|
159
|
+
>;
|
|
160
|
+
|
|
161
|
+
export interface ExistingMonitorProvisioningState {
|
|
162
|
+
autoProvisionedKeys: Set<string>;
|
|
163
|
+
manuallyMonitoredDeviceIds: Set<string>;
|
|
164
|
+
attemptedProvisioningKeys: Set<string>;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export type ExistingMonitorsByProjectId = Map<
|
|
168
|
+
string,
|
|
169
|
+
ExistingMonitorProvisioningState
|
|
170
|
+
>;
|
|
126
171
|
|
|
127
172
|
/*
|
|
128
173
|
* How many imports one run has attempted, shared across every scan the run
|
|
@@ -131,10 +176,13 @@ export type ExistingHostnamesByProjectId = Map<string, Set<string>>;
|
|
|
131
176
|
* cap as the real run it predicts, instead of walking unbounded work inside
|
|
132
177
|
* an API request.
|
|
133
178
|
*/
|
|
134
|
-
interface ImportAttemptBudget {
|
|
135
|
-
|
|
179
|
+
export interface ImportAttemptBudget {
|
|
180
|
+
deviceCount: number;
|
|
181
|
+
monitorCount: number;
|
|
136
182
|
}
|
|
137
183
|
|
|
184
|
+
export type ImportAttemptBudgetsByProjectId = Map<string, ImportAttemptBudget>;
|
|
185
|
+
|
|
138
186
|
class NetworkDeviceAutoImportRuleEngineServiceClass {
|
|
139
187
|
/**
|
|
140
188
|
* The automatic path: apply the project's enabled rules to one Completed
|
|
@@ -161,6 +209,8 @@ class NetworkDeviceAutoImportRuleEngineServiceClass {
|
|
|
161
209
|
public async processCompletedScan(data: {
|
|
162
210
|
scanId: ObjectID;
|
|
163
211
|
existingHostnamesByProjectId: ExistingHostnamesByProjectId;
|
|
212
|
+
existingMonitorsByProjectId?: ExistingMonitorsByProjectId;
|
|
213
|
+
attemptBudgetsByProjectId?: ImportAttemptBudgetsByProjectId;
|
|
164
214
|
}): Promise<AutoImportRuleRunResult | null> {
|
|
165
215
|
const scan: NetworkDeviceDiscoveryScan | null =
|
|
166
216
|
await NetworkDeviceDiscoveryScanService.findOneBy({
|
|
@@ -218,18 +268,58 @@ class NetworkDeviceAutoImportRuleEngineServiceClass {
|
|
|
218
268
|
return null;
|
|
219
269
|
}
|
|
220
270
|
|
|
221
|
-
const
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
271
|
+
const existingDevices: Map<string, NetworkDevice> = this.getExistingDevices(
|
|
272
|
+
{
|
|
273
|
+
projectId: projectId,
|
|
274
|
+
cache: data.existingHostnamesByProjectId,
|
|
275
|
+
},
|
|
276
|
+
);
|
|
277
|
+
|
|
278
|
+
const hasMonitorProvisioningRules: boolean = rules.some(
|
|
279
|
+
(rule: NetworkDeviceAutoImportRule): boolean => {
|
|
280
|
+
return !rule.isExclusion && Boolean(rule.monitorTemplateId);
|
|
281
|
+
},
|
|
282
|
+
);
|
|
283
|
+
|
|
284
|
+
const existingMonitors: ExistingMonitorProvisioningState =
|
|
285
|
+
hasMonitorProvisioningRules
|
|
286
|
+
? await this.getExistingMonitors({
|
|
287
|
+
projectId: projectId,
|
|
288
|
+
cache: data.existingMonitorsByProjectId || new Map(),
|
|
289
|
+
})
|
|
290
|
+
: this.emptyExistingMonitorProvisioningState();
|
|
291
|
+
|
|
292
|
+
const monitorTemplates: Map<string, MonitorTemplate> =
|
|
293
|
+
hasMonitorProvisioningRules
|
|
294
|
+
? await this.loadMonitorTemplates({ projectId, rules })
|
|
295
|
+
: new Map();
|
|
225
296
|
|
|
226
297
|
const result: AutoImportRuleRunResult = this.emptyResult(false);
|
|
227
|
-
const
|
|
298
|
+
const projectBudgetKey: string = projectId.toString();
|
|
299
|
+
const attempts: ImportAttemptBudget = data.attemptBudgetsByProjectId
|
|
300
|
+
? data.attemptBudgetsByProjectId.get(projectBudgetKey) || {
|
|
301
|
+
deviceCount: 0,
|
|
302
|
+
monitorCount: 0,
|
|
303
|
+
}
|
|
304
|
+
: { deviceCount: 0, monitorCount: 0 };
|
|
305
|
+
|
|
306
|
+
/*
|
|
307
|
+
* A project budget is shared across every scan in one worker sweep. Keep
|
|
308
|
+
* the starting values so a scan reached after an earlier scan consumed
|
|
309
|
+
* the budget can be distinguished from a scan whose own create attempts
|
|
310
|
+
* all failed. The former must remain unprocessed for the next sweep; the
|
|
311
|
+
* latter is deliberately retired to avoid an infinite retry loop.
|
|
312
|
+
*/
|
|
313
|
+
const attemptsAtStart: ImportAttemptBudget = { ...attempts };
|
|
314
|
+
|
|
315
|
+
data.attemptBudgetsByProjectId?.set(projectBudgetKey, attempts);
|
|
228
316
|
|
|
229
317
|
const createdIpAddresses: Array<string> = await this.importHostsFromScan({
|
|
230
318
|
scan: scan,
|
|
231
319
|
rules: rules,
|
|
232
|
-
|
|
320
|
+
existingDevices: existingDevices,
|
|
321
|
+
existingMonitors: existingMonitors,
|
|
322
|
+
monitorTemplates: monitorTemplates,
|
|
233
323
|
result: result,
|
|
234
324
|
attempts: attempts,
|
|
235
325
|
isDryRun: false,
|
|
@@ -244,12 +334,24 @@ class NetworkDeviceAutoImportRuleEngineServiceClass {
|
|
|
244
334
|
* pass, so stamping keeps the two consistent. Run Now remains the
|
|
245
335
|
* deliberate way back into a stamped scan.
|
|
246
336
|
*/
|
|
247
|
-
const
|
|
248
|
-
result.isTruncated &&
|
|
337
|
+
const inheritedBudget: boolean =
|
|
338
|
+
result.isTruncated &&
|
|
339
|
+
(attemptsAtStart.deviceCount > 0 || attemptsAtStart.monitorCount > 0);
|
|
249
340
|
|
|
250
|
-
|
|
341
|
+
const shouldResume: boolean =
|
|
342
|
+
result.isTruncated &&
|
|
343
|
+
(result.devicesCreated > 0 ||
|
|
344
|
+
result.monitorsCreated > 0 ||
|
|
345
|
+
inheritedBudget);
|
|
346
|
+
|
|
347
|
+
if (
|
|
348
|
+
result.isTruncated &&
|
|
349
|
+
result.devicesCreated === 0 &&
|
|
350
|
+
result.monitorsCreated === 0 &&
|
|
351
|
+
!inheritedBudget
|
|
352
|
+
) {
|
|
251
353
|
logger.error(
|
|
252
|
-
`Auto-import: scan ${scan.id?.toString()} hit
|
|
354
|
+
`Auto-import: scan ${scan.id?.toString()} hit a per-pass cap without making progress (${result.devicesFailed} device failure(s), ${result.monitorsFailed} monitor failure(s)); stamping it processed so the sweep does not retry it forever. Inspect the failures and use the rule's Run Now to retry deliberately.`,
|
|
253
355
|
{ projectId: projectId.toString() } as LogAttributes,
|
|
254
356
|
);
|
|
255
357
|
}
|
|
@@ -278,6 +380,7 @@ class NetworkDeviceAutoImportRuleEngineServiceClass {
|
|
|
278
380
|
ruleId: ObjectID;
|
|
279
381
|
projectId: ObjectID;
|
|
280
382
|
isDryRun: boolean;
|
|
383
|
+
expectedMonitorTemplateId?: ObjectID | null;
|
|
281
384
|
}): Promise<AutoImportRuleRunResult> {
|
|
282
385
|
const rule: NetworkDeviceAutoImportRule | null =
|
|
283
386
|
await NetworkDeviceAutoImportRuleService.findOneBy({
|
|
@@ -295,6 +398,7 @@ class NetworkDeviceAutoImportRuleEngineServiceClass {
|
|
|
295
398
|
sysDescrPattern: true,
|
|
296
399
|
sysObjectIdPattern: true,
|
|
297
400
|
includePingOnlyHosts: true,
|
|
401
|
+
monitorTemplateId: true,
|
|
298
402
|
},
|
|
299
403
|
props: { isRoot: true },
|
|
300
404
|
});
|
|
@@ -303,6 +407,19 @@ class NetworkDeviceAutoImportRuleEngineServiceClass {
|
|
|
303
407
|
throw new BadDataException("Auto-import rule not found.");
|
|
304
408
|
}
|
|
305
409
|
|
|
410
|
+
if (data.expectedMonitorTemplateId !== undefined) {
|
|
411
|
+
const expectedTemplateId: string =
|
|
412
|
+
data.expectedMonitorTemplateId?.toString() || "";
|
|
413
|
+
const currentTemplateId: string =
|
|
414
|
+
rule.monitorTemplateId?.toString() || "";
|
|
415
|
+
|
|
416
|
+
if (expectedTemplateId !== currentTemplateId) {
|
|
417
|
+
throw new BadDataException(
|
|
418
|
+
"This auto-import rule changed while the run was being authorized. Review it and run it again.",
|
|
419
|
+
);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
|
|
306
423
|
/*
|
|
307
424
|
* A DISABLED rule can still be dry-run — that is the point of the dry
|
|
308
425
|
* run: answer "what would this rule import" BEFORE enabling it against
|
|
@@ -384,12 +501,31 @@ class NetworkDeviceAutoImportRuleEngineServiceClass {
|
|
|
384
501
|
...exclusionRules,
|
|
385
502
|
];
|
|
386
503
|
|
|
387
|
-
|
|
388
|
-
|
|
504
|
+
/*
|
|
505
|
+
* Starts empty and is primed per scan from the addresses that scan found.
|
|
506
|
+
* See getExistingDevices.
|
|
507
|
+
*/
|
|
508
|
+
const existingDevices: Map<string, NetworkDevice> = new Map<
|
|
509
|
+
string,
|
|
510
|
+
NetworkDevice
|
|
511
|
+
>();
|
|
512
|
+
const hasMonitorProvisioningRule: boolean = Boolean(
|
|
513
|
+
data.rule.monitorTemplateId,
|
|
389
514
|
);
|
|
515
|
+
const existingMonitors: ExistingMonitorProvisioningState =
|
|
516
|
+
hasMonitorProvisioningRule
|
|
517
|
+
? await this.loadExistingMonitors(data.projectId)
|
|
518
|
+
: this.emptyExistingMonitorProvisioningState();
|
|
519
|
+
const monitorTemplates: Map<string, MonitorTemplate> =
|
|
520
|
+
hasMonitorProvisioningRule
|
|
521
|
+
? await this.loadMonitorTemplates({
|
|
522
|
+
projectId: data.projectId,
|
|
523
|
+
rules: rules,
|
|
524
|
+
})
|
|
525
|
+
: new Map();
|
|
390
526
|
|
|
391
527
|
const result: AutoImportRuleRunResult = this.emptyResult(data.isDryRun);
|
|
392
|
-
const attempts: ImportAttemptBudget = {
|
|
528
|
+
const attempts: ImportAttemptBudget = { deviceCount: 0, monitorCount: 0 };
|
|
393
529
|
|
|
394
530
|
/*
|
|
395
531
|
* Newest results first: a manual run is "bring the estate up to date",
|
|
@@ -451,7 +587,9 @@ class NetworkDeviceAutoImportRuleEngineServiceClass {
|
|
|
451
587
|
const createdIpAddresses: Array<string> = await this.importHostsFromScan({
|
|
452
588
|
scan: scan,
|
|
453
589
|
rules: rules,
|
|
454
|
-
|
|
590
|
+
existingDevices: existingDevices,
|
|
591
|
+
existingMonitors: existingMonitors,
|
|
592
|
+
monitorTemplates: monitorTemplates,
|
|
455
593
|
result: result,
|
|
456
594
|
attempts: attempts,
|
|
457
595
|
isDryRun: data.isDryRun,
|
|
@@ -506,6 +644,11 @@ class NetworkDeviceAutoImportRuleEngineServiceClass {
|
|
|
506
644
|
hostsSkippedAlreadyRegistered: 0,
|
|
507
645
|
devicesCreated: 0,
|
|
508
646
|
devicesFailed: 0,
|
|
647
|
+
monitorsWouldCreate: 0,
|
|
648
|
+
monitorsCreated: 0,
|
|
649
|
+
monitorsSkippedAlreadyExisting: 0,
|
|
650
|
+
monitorsSkippedUnsupportedHost: 0,
|
|
651
|
+
monitorsFailed: 0,
|
|
509
652
|
isTruncated: false,
|
|
510
653
|
hasMoreScans: false,
|
|
511
654
|
isDryRun: isDryRun,
|
|
@@ -513,6 +656,14 @@ class NetworkDeviceAutoImportRuleEngineServiceClass {
|
|
|
513
656
|
};
|
|
514
657
|
}
|
|
515
658
|
|
|
659
|
+
private emptyExistingMonitorProvisioningState(): ExistingMonitorProvisioningState {
|
|
660
|
+
return {
|
|
661
|
+
autoProvisionedKeys: new Set(),
|
|
662
|
+
manuallyMonitoredDeviceIds: new Set(),
|
|
663
|
+
attemptedProvisioningKeys: new Set(),
|
|
664
|
+
};
|
|
665
|
+
}
|
|
666
|
+
|
|
516
667
|
/*
|
|
517
668
|
* ALL enabled rules of the project, paged to completeness — never a capped
|
|
518
669
|
* subset. The label/owner engines cap their fetch at 100 and a dropped
|
|
@@ -543,6 +694,7 @@ class NetworkDeviceAutoImportRuleEngineServiceClass {
|
|
|
543
694
|
sysDescrPattern: true,
|
|
544
695
|
sysObjectIdPattern: true,
|
|
545
696
|
includePingOnlyHosts: true,
|
|
697
|
+
monitorTemplateId: true,
|
|
546
698
|
},
|
|
547
699
|
sort: {
|
|
548
700
|
createdAt: SortOrder.Ascending,
|
|
@@ -573,24 +725,55 @@ class NetworkDeviceAutoImportRuleEngineServiceClass {
|
|
|
573
725
|
);
|
|
574
726
|
}
|
|
575
727
|
|
|
576
|
-
|
|
728
|
+
/*
|
|
729
|
+
* The project's running map of "this address already has a device", shared
|
|
730
|
+
* across every scan in one sweep.
|
|
731
|
+
*
|
|
732
|
+
* It starts EMPTY and is filled per scan by `primeExistingDevices`, from the
|
|
733
|
+
* addresses that scan actually found. It used to start full — every device
|
|
734
|
+
* in the project, paged out of the database — which was both a full-table
|
|
735
|
+
* read per sweep and, on a fleet whose devices share one `createdAt` (what a
|
|
736
|
+
* bulk import produces), an unstable page walk that SKIPPED hostnames and
|
|
737
|
+
* let this engine create duplicates. See loadExistingDevices.
|
|
738
|
+
*/
|
|
739
|
+
private getExistingDevices(data: {
|
|
577
740
|
projectId: ObjectID;
|
|
578
741
|
cache: ExistingHostnamesByProjectId;
|
|
579
|
-
}):
|
|
742
|
+
}): Map<string, NetworkDevice> {
|
|
580
743
|
const key: string = data.projectId.toString();
|
|
581
744
|
|
|
582
|
-
const cached:
|
|
745
|
+
const cached: Map<string, NetworkDevice> | undefined = data.cache.get(key);
|
|
583
746
|
|
|
584
747
|
if (cached) {
|
|
585
748
|
return cached;
|
|
586
749
|
}
|
|
587
750
|
|
|
588
|
-
const
|
|
751
|
+
const fresh: Map<string, NetworkDevice> = new Map<string, NetworkDevice>();
|
|
752
|
+
data.cache.set(key, fresh);
|
|
753
|
+
|
|
754
|
+
return fresh;
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
/*
|
|
758
|
+
* Fills the running map with whatever of THESE addresses already has a
|
|
759
|
+
* device. Only what is found is recorded, so an address that is not
|
|
760
|
+
* registered is looked up again if a later scan in the same sweep carries it
|
|
761
|
+
* — one indexed lookup, and recording absence would go stale the moment this
|
|
762
|
+
* run creates the device.
|
|
763
|
+
*/
|
|
764
|
+
private async primeExistingDevices(data: {
|
|
765
|
+
projectId: ObjectID;
|
|
766
|
+
hostnames: Array<string>;
|
|
767
|
+
into: Map<string, NetworkDevice>;
|
|
768
|
+
}): Promise<void> {
|
|
769
|
+
const found: Map<string, NetworkDevice> = await this.loadExistingDevices(
|
|
589
770
|
data.projectId,
|
|
771
|
+
data.hostnames,
|
|
590
772
|
);
|
|
591
|
-
data.cache.set(key, loaded);
|
|
592
773
|
|
|
593
|
-
|
|
774
|
+
for (const [hostname, device] of found) {
|
|
775
|
+
data.into.set(hostname, device);
|
|
776
|
+
}
|
|
594
777
|
}
|
|
595
778
|
|
|
596
779
|
/*
|
|
@@ -599,55 +782,268 @@ class NetworkDeviceAutoImportRuleEngineServiceClass {
|
|
|
599
782
|
* a truncated answer produces duplicate devices, which is worse than a
|
|
600
783
|
* slow answer. Sorted for stable paging.
|
|
601
784
|
*/
|
|
602
|
-
|
|
785
|
+
/*
|
|
786
|
+
* The devices already at these addresses, keyed by hostname.
|
|
787
|
+
*
|
|
788
|
+
* This used to load EVERY device in the project, paging `ORDER BY
|
|
789
|
+
* createdAt` — and a bulk discovery import stamps every device it creates
|
|
790
|
+
* with the same `createdAt`, so on a large fleet the sort key is
|
|
791
|
+
* single-valued and `LIMIT/OFFSET` over it returns an arbitrary,
|
|
792
|
+
* non-deterministic slice per call. Pages overlapped and skipped, and a
|
|
793
|
+
* skipped hostname reads as "not registered", which CREATES A DUPLICATE
|
|
794
|
+
* DEVICE — the exact failure the paging was added to prevent. It also cost
|
|
795
|
+
* a full table scan per page.
|
|
796
|
+
*
|
|
797
|
+
* Asking about the addresses the scans actually carry is both correct and
|
|
798
|
+
* an indexed lookup. See NetworkDeviceService.getDevicesByHostnames.
|
|
799
|
+
*/
|
|
800
|
+
private async loadExistingDevices(
|
|
801
|
+
projectId: ObjectID,
|
|
802
|
+
hostnames: Array<string>,
|
|
803
|
+
): Promise<Map<string, NetworkDevice>> {
|
|
804
|
+
return NetworkDeviceService.getDevicesByHostnames({
|
|
805
|
+
projectId: projectId,
|
|
806
|
+
hostnames: hostnames,
|
|
807
|
+
select: {
|
|
808
|
+
_id: true,
|
|
809
|
+
projectId: true,
|
|
810
|
+
name: true,
|
|
811
|
+
hostname: true,
|
|
812
|
+
monitoringMethod: true,
|
|
813
|
+
},
|
|
814
|
+
props: {
|
|
815
|
+
isRoot: true,
|
|
816
|
+
},
|
|
817
|
+
});
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
private static monitorProvisioningKey(
|
|
821
|
+
networkDeviceId: ObjectID | string,
|
|
822
|
+
monitorTemplateId: ObjectID | string,
|
|
823
|
+
): string {
|
|
824
|
+
return `${networkDeviceId.toString()}:${monitorTemplateId.toString()}`;
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
private async getExistingMonitors(data: {
|
|
828
|
+
projectId: ObjectID;
|
|
829
|
+
cache: ExistingMonitorsByProjectId;
|
|
830
|
+
}): Promise<ExistingMonitorProvisioningState> {
|
|
831
|
+
const key: string = data.projectId.toString();
|
|
832
|
+
const cached: ExistingMonitorProvisioningState | undefined =
|
|
833
|
+
data.cache.get(key);
|
|
834
|
+
|
|
835
|
+
if (cached) {
|
|
836
|
+
return cached;
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
const loaded: ExistingMonitorProvisioningState =
|
|
840
|
+
await this.loadExistingMonitors(data.projectId);
|
|
841
|
+
data.cache.set(key, loaded);
|
|
842
|
+
return loaded;
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
/*
|
|
846
|
+
* Queryable provenance is the concurrency/idempotency key for monitors
|
|
847
|
+
* created by this engine. Existing manually-created Network Device
|
|
848
|
+
* monitors are parsed once and suppress automatic duplicates: an operator
|
|
849
|
+
* who already chose how to monitor a device must not receive a second,
|
|
850
|
+
* potentially billable monitor merely because an import rule was edited.
|
|
851
|
+
*/
|
|
852
|
+
private async loadExistingMonitors(
|
|
603
853
|
projectId: ObjectID,
|
|
604
|
-
): Promise<
|
|
605
|
-
const
|
|
854
|
+
): Promise<ExistingMonitorProvisioningState> {
|
|
855
|
+
const state: ExistingMonitorProvisioningState =
|
|
856
|
+
this.emptyExistingMonitorProvisioningState();
|
|
606
857
|
|
|
607
858
|
for (let skip: number = 0; ; skip += LIMIT_MAX) {
|
|
608
|
-
const
|
|
859
|
+
const monitors: Array<Monitor> = await MonitorService.findBy({
|
|
609
860
|
query: {
|
|
610
861
|
projectId: projectId,
|
|
862
|
+
monitorType: MonitorType.NetworkDevice,
|
|
611
863
|
},
|
|
612
864
|
select: {
|
|
613
|
-
|
|
865
|
+
_id: true,
|
|
866
|
+
monitorType: true,
|
|
867
|
+
monitorSteps: true,
|
|
868
|
+
monitorTemplateId: true,
|
|
869
|
+
autoProvisionedNetworkDeviceId: true,
|
|
614
870
|
},
|
|
615
871
|
sort: {
|
|
616
872
|
createdAt: SortOrder.Ascending,
|
|
617
873
|
},
|
|
618
874
|
limit: LIMIT_MAX,
|
|
619
875
|
skip: skip,
|
|
620
|
-
props: {
|
|
621
|
-
|
|
876
|
+
props: { isRoot: true },
|
|
877
|
+
});
|
|
878
|
+
|
|
879
|
+
for (const monitor of monitors) {
|
|
880
|
+
this.recordExistingMonitor(state, monitor);
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
if (monitors.length < LIMIT_MAX) {
|
|
884
|
+
break;
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
return state;
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
/*
|
|
892
|
+
* Classify one stored monitor from both its queryable provenance and its
|
|
893
|
+
* actual step binding. Provenance is trusted only while the monitor still
|
|
894
|
+
* watches the device it was provisioned for. An orphaned template link or
|
|
895
|
+
* any legacy drift is treated as an operator-managed monitor on its actual
|
|
896
|
+
* device(s), which is the conservative no-duplicate behavior.
|
|
897
|
+
*/
|
|
898
|
+
private recordExistingMonitor(
|
|
899
|
+
state: ExistingMonitorProvisioningState,
|
|
900
|
+
monitor: Monitor,
|
|
901
|
+
): void {
|
|
902
|
+
const referencedDeviceIds: Set<string> = new Set(
|
|
903
|
+
NetworkDeviceHydrationUtil.getReferencedNetworkDeviceIds([monitor]),
|
|
904
|
+
);
|
|
905
|
+
const provenanceDeviceId: string =
|
|
906
|
+
monitor.autoProvisionedNetworkDeviceId?.toString() || "";
|
|
907
|
+
|
|
908
|
+
if (
|
|
909
|
+
provenanceDeviceId &&
|
|
910
|
+
monitor.monitorTemplateId &&
|
|
911
|
+
referencedDeviceIds.size === 1 &&
|
|
912
|
+
referencedDeviceIds.has(provenanceDeviceId)
|
|
913
|
+
) {
|
|
914
|
+
state.autoProvisionedKeys.add(
|
|
915
|
+
NetworkDeviceAutoImportRuleEngineServiceClass.monitorProvisioningKey(
|
|
916
|
+
provenanceDeviceId,
|
|
917
|
+
monitor.monitorTemplateId,
|
|
918
|
+
),
|
|
919
|
+
);
|
|
920
|
+
return;
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
for (const networkDeviceId of referencedDeviceIds) {
|
|
924
|
+
state.manuallyMonitoredDeviceIds.add(networkDeviceId);
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
/*
|
|
929
|
+
* Close the practical manual-create race left by the project-wide snapshot:
|
|
930
|
+
* immediately before provisioning a device, search the JSON step payload
|
|
931
|
+
* for its UUID and classify exact bindings. The automatic (device,template)
|
|
932
|
+
* partial unique index remains the final concurrent-auto backstop; this
|
|
933
|
+
* narrow read prevents a monitor a human just created from being ignored by
|
|
934
|
+
* a long-running sweep.
|
|
935
|
+
*/
|
|
936
|
+
private async refreshExistingMonitorsForDevice(data: {
|
|
937
|
+
projectId: ObjectID;
|
|
938
|
+
networkDeviceId: ObjectID;
|
|
939
|
+
state: ExistingMonitorProvisioningState;
|
|
940
|
+
}): Promise<void> {
|
|
941
|
+
for (let skip: number = 0; ; skip += LIMIT_MAX) {
|
|
942
|
+
const monitors: Array<Monitor> = await MonitorService.findBy({
|
|
943
|
+
query: {
|
|
944
|
+
projectId: data.projectId,
|
|
945
|
+
monitorType: MonitorType.NetworkDevice,
|
|
946
|
+
monitorSteps: QueryHelper.search(data.networkDeviceId.toString()),
|
|
622
947
|
},
|
|
948
|
+
select: {
|
|
949
|
+
_id: true,
|
|
950
|
+
monitorType: true,
|
|
951
|
+
monitorSteps: true,
|
|
952
|
+
monitorTemplateId: true,
|
|
953
|
+
autoProvisionedNetworkDeviceId: true,
|
|
954
|
+
},
|
|
955
|
+
sort: { createdAt: SortOrder.Ascending },
|
|
956
|
+
limit: LIMIT_MAX,
|
|
957
|
+
skip: skip,
|
|
958
|
+
props: { isRoot: true },
|
|
623
959
|
});
|
|
624
960
|
|
|
625
|
-
for (const
|
|
626
|
-
|
|
627
|
-
|
|
961
|
+
for (const monitor of monitors) {
|
|
962
|
+
this.recordExistingMonitor(data.state, monitor);
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
if (monitors.length < LIMIT_MAX) {
|
|
966
|
+
break;
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
private async loadMonitorTemplates(data: {
|
|
972
|
+
projectId: ObjectID;
|
|
973
|
+
rules: Array<NetworkDeviceAutoImportRule>;
|
|
974
|
+
}): Promise<Map<string, MonitorTemplate>> {
|
|
975
|
+
const ids: Array<ObjectID | string> = Array.from(
|
|
976
|
+
new Map<string, ObjectID | string>(
|
|
977
|
+
data.rules
|
|
978
|
+
.filter((rule: NetworkDeviceAutoImportRule): boolean => {
|
|
979
|
+
return Boolean(rule.monitorTemplateId);
|
|
980
|
+
})
|
|
981
|
+
.map((rule: NetworkDeviceAutoImportRule) => {
|
|
982
|
+
const id: ObjectID | string = rule.monitorTemplateId!;
|
|
983
|
+
return [id.toString(), id];
|
|
984
|
+
}),
|
|
985
|
+
).values(),
|
|
986
|
+
);
|
|
987
|
+
|
|
988
|
+
const templatesById: Map<string, MonitorTemplate> = new Map();
|
|
989
|
+
if (ids.length === 0) {
|
|
990
|
+
return templatesById;
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
for (let skip: number = 0; ; skip += LIMIT_MAX) {
|
|
994
|
+
const templates: Array<MonitorTemplate> =
|
|
995
|
+
await MonitorTemplateService.findBy({
|
|
996
|
+
query: {
|
|
997
|
+
_id: QueryHelper.any(ids),
|
|
998
|
+
projectId: data.projectId,
|
|
999
|
+
monitorType: MonitorType.NetworkDevice,
|
|
1000
|
+
},
|
|
1001
|
+
select: {
|
|
1002
|
+
_id: true,
|
|
1003
|
+
projectId: true,
|
|
1004
|
+
monitorName: true,
|
|
1005
|
+
monitorDescription: true,
|
|
1006
|
+
monitorType: true,
|
|
1007
|
+
monitorSteps: true,
|
|
1008
|
+
monitoringInterval: true,
|
|
1009
|
+
minimumProbeAgreement: true,
|
|
1010
|
+
customFields: true,
|
|
1011
|
+
labels: { _id: true },
|
|
1012
|
+
},
|
|
1013
|
+
sort: { createdAt: SortOrder.Ascending },
|
|
1014
|
+
limit: LIMIT_MAX,
|
|
1015
|
+
skip: skip,
|
|
1016
|
+
props: { isRoot: true },
|
|
1017
|
+
});
|
|
1018
|
+
|
|
1019
|
+
for (const template of templates) {
|
|
1020
|
+
if (template.id) {
|
|
1021
|
+
templatesById.set(template.id.toString(), template);
|
|
628
1022
|
}
|
|
629
1023
|
}
|
|
630
1024
|
|
|
631
|
-
if (
|
|
1025
|
+
if (templates.length < LIMIT_MAX) {
|
|
632
1026
|
break;
|
|
633
1027
|
}
|
|
634
1028
|
}
|
|
635
1029
|
|
|
636
|
-
return
|
|
1030
|
+
return templatesById;
|
|
637
1031
|
}
|
|
638
1032
|
|
|
639
1033
|
/*
|
|
640
1034
|
* The core loop: evaluate every discovered host of one scan against the
|
|
641
|
-
* rule set, create what should import,
|
|
642
|
-
* shared result. Returns the addresses
|
|
643
|
-
* write-back). Mutates `
|
|
644
|
-
* makes duplicate rows, overlapping scans in one
|
|
645
|
-
* idempotent.
|
|
1035
|
+
* rule set, create what should import, reconcile selected template monitors,
|
|
1036
|
+
* and account for every host in the shared result. Returns the addresses
|
|
1037
|
+
* actually created (for the jsonb write-back). Mutates `existingDevices` as
|
|
1038
|
+
* it creates, which is what makes duplicate rows, overlapping scans in one
|
|
1039
|
+
* sweep, and repeat runs idempotent.
|
|
646
1040
|
*/
|
|
647
1041
|
private async importHostsFromScan(data: {
|
|
648
1042
|
scan: NetworkDeviceDiscoveryScan;
|
|
649
1043
|
rules: Array<NetworkDeviceAutoImportRule>;
|
|
650
|
-
|
|
1044
|
+
existingDevices: Map<string, NetworkDevice>;
|
|
1045
|
+
existingMonitors: ExistingMonitorProvisioningState;
|
|
1046
|
+
monitorTemplates: Map<string, MonitorTemplate>;
|
|
651
1047
|
result: AutoImportRuleRunResult;
|
|
652
1048
|
attempts: ImportAttemptBudget;
|
|
653
1049
|
isDryRun: boolean;
|
|
@@ -668,6 +1064,18 @@ class NetworkDeviceAutoImportRuleEngineServiceClass {
|
|
|
668
1064
|
(scan.discoveredDevices as Array<DiscoveredNetworkDevice>) || [],
|
|
669
1065
|
);
|
|
670
1066
|
|
|
1067
|
+
/*
|
|
1068
|
+
* Ask the database about THESE addresses, once, before the loop — rather
|
|
1069
|
+
* than having loaded every device in the project up front.
|
|
1070
|
+
*/
|
|
1071
|
+
await this.primeExistingDevices({
|
|
1072
|
+
projectId: scan.projectId,
|
|
1073
|
+
hostnames: hosts.map((host: DiscoveredNetworkDevice): string => {
|
|
1074
|
+
return host.ipAddress || "";
|
|
1075
|
+
}),
|
|
1076
|
+
into: data.existingDevices,
|
|
1077
|
+
});
|
|
1078
|
+
|
|
671
1079
|
const createdIpAddresses: Array<string> = [];
|
|
672
1080
|
|
|
673
1081
|
for (const host of hosts) {
|
|
@@ -699,59 +1107,332 @@ class NetworkDeviceAutoImportRuleEngineServiceClass {
|
|
|
699
1107
|
|
|
700
1108
|
result.hostsMatched++;
|
|
701
1109
|
|
|
1110
|
+
const templateIds: Array<string> = Array.from(
|
|
1111
|
+
new Set(
|
|
1112
|
+
evaluation.matchedRules
|
|
1113
|
+
.map((matchedRule: AutoImportRuleCandidate): string => {
|
|
1114
|
+
return matchedRule.monitorTemplateId?.toString() || "";
|
|
1115
|
+
})
|
|
1116
|
+
.filter((id: string): boolean => {
|
|
1117
|
+
return Boolean(id);
|
|
1118
|
+
}),
|
|
1119
|
+
),
|
|
1120
|
+
);
|
|
1121
|
+
|
|
1122
|
+
let networkDevice: NetworkDevice | undefined = data.existingDevices.get(
|
|
1123
|
+
host.ipAddress,
|
|
1124
|
+
);
|
|
1125
|
+
let deviceWasCreated: boolean = false;
|
|
1126
|
+
|
|
702
1127
|
/*
|
|
703
1128
|
* The frozen isAlreadyRegistered flag AND the live set: the flag is a
|
|
704
1129
|
* point-in-time answer from the last upload, the set covers devices
|
|
705
1130
|
* created since — including by this very run, which is what collapses
|
|
706
1131
|
* duplicate rows and overlapping scans into one device.
|
|
707
1132
|
*/
|
|
708
|
-
if (
|
|
709
|
-
host.isAlreadyRegistered ||
|
|
710
|
-
data.existingHostnames.has(host.ipAddress)
|
|
711
|
-
) {
|
|
1133
|
+
if (host.isAlreadyRegistered || networkDevice) {
|
|
712
1134
|
result.hostsSkippedAlreadyRegistered++;
|
|
1135
|
+
|
|
1136
|
+
/*
|
|
1137
|
+
* A stale scan can claim a deleted device is still registered. With
|
|
1138
|
+
* no live row there is neither a safe binding nor enough intent to
|
|
1139
|
+
* recreate it from old data, so preserve the established skip.
|
|
1140
|
+
*/
|
|
1141
|
+
if (!networkDevice) {
|
|
1142
|
+
continue;
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1146
|
+
if (result.matchedIpAddressSample.length < MAX_MATCHED_IP_SAMPLE) {
|
|
1147
|
+
if (!result.matchedIpAddressSample.includes(host.ipAddress)) {
|
|
1148
|
+
result.matchedIpAddressSample.push(host.ipAddress);
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
if (!networkDevice) {
|
|
1153
|
+
if (data.attempts.deviceCount >= MAX_DEVICES_PER_AUTO_IMPORT_RUN) {
|
|
1154
|
+
result.isTruncated = true;
|
|
1155
|
+
break;
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
if (data.isDryRun) {
|
|
1159
|
+
/*
|
|
1160
|
+
* Add a fully-shaped in-memory device to simulate the create. Its
|
|
1161
|
+
* generated id never leaves this process; it merely lets monitor
|
|
1162
|
+
* reconciliation deduplicate the same host across duplicate rows
|
|
1163
|
+
* and overlapping scans exactly as a real run would.
|
|
1164
|
+
*/
|
|
1165
|
+
data.attempts.deviceCount++;
|
|
1166
|
+
networkDevice = buildNetworkDeviceFromDiscoveredHost({
|
|
1167
|
+
projectId: scan.projectId,
|
|
1168
|
+
host: host,
|
|
1169
|
+
scan: scan,
|
|
1170
|
+
autoApplyVendorHealthTemplate: true,
|
|
1171
|
+
});
|
|
1172
|
+
networkDevice.id = ObjectID.generate();
|
|
1173
|
+
data.existingDevices.set(host.ipAddress, networkDevice);
|
|
1174
|
+
} else {
|
|
1175
|
+
const createResult: {
|
|
1176
|
+
device: NetworkDevice | null;
|
|
1177
|
+
wasCreated: boolean;
|
|
1178
|
+
} = await this.createDeviceForHost({
|
|
1179
|
+
projectId: scan.projectId,
|
|
1180
|
+
scan: scan,
|
|
1181
|
+
host: host,
|
|
1182
|
+
existingDevices: data.existingDevices,
|
|
1183
|
+
result: result,
|
|
1184
|
+
attempts: data.attempts,
|
|
1185
|
+
});
|
|
1186
|
+
|
|
1187
|
+
networkDevice = createResult.device || undefined;
|
|
1188
|
+
deviceWasCreated = createResult.wasCreated;
|
|
1189
|
+
|
|
1190
|
+
if (!networkDevice) {
|
|
1191
|
+
continue;
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1196
|
+
if (deviceWasCreated) {
|
|
1197
|
+
createdIpAddresses.push(host.ipAddress);
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
if (templateIds.length === 0) {
|
|
713
1201
|
continue;
|
|
714
1202
|
}
|
|
715
1203
|
|
|
716
|
-
|
|
1204
|
+
const monitorsWereTruncated: boolean = await this.ensureMonitorsForDevice(
|
|
1205
|
+
{
|
|
1206
|
+
projectId: scan.projectId,
|
|
1207
|
+
host: host,
|
|
1208
|
+
networkDevice: networkDevice,
|
|
1209
|
+
templateIds: templateIds,
|
|
1210
|
+
monitorTemplates: data.monitorTemplates,
|
|
1211
|
+
existingMonitors: data.existingMonitors,
|
|
1212
|
+
result: result,
|
|
1213
|
+
attempts: data.attempts,
|
|
1214
|
+
isDryRun: data.isDryRun,
|
|
1215
|
+
},
|
|
1216
|
+
);
|
|
1217
|
+
|
|
1218
|
+
if (monitorsWereTruncated) {
|
|
717
1219
|
result.isTruncated = true;
|
|
718
1220
|
break;
|
|
719
1221
|
}
|
|
1222
|
+
}
|
|
720
1223
|
|
|
721
|
-
|
|
722
|
-
|
|
1224
|
+
return createdIpAddresses;
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
private async ensureMonitorsForDevice(data: {
|
|
1228
|
+
projectId: ObjectID;
|
|
1229
|
+
host: DiscoveredNetworkDevice;
|
|
1230
|
+
networkDevice: NetworkDevice;
|
|
1231
|
+
templateIds: Array<string>;
|
|
1232
|
+
monitorTemplates: Map<string, MonitorTemplate>;
|
|
1233
|
+
existingMonitors: ExistingMonitorProvisioningState;
|
|
1234
|
+
result: AutoImportRuleRunResult;
|
|
1235
|
+
attempts: ImportAttemptBudget;
|
|
1236
|
+
isDryRun: boolean;
|
|
1237
|
+
}): Promise<boolean> {
|
|
1238
|
+
/*
|
|
1239
|
+
* A Network Device monitor is evaluated from SNMP walks. A ping-only
|
|
1240
|
+
* import intentionally has polling disabled and can never supply those
|
|
1241
|
+
* results. Rule validation prevents this combination, while this guard
|
|
1242
|
+
* keeps legacy or directly-written rows from creating inert monitors.
|
|
1243
|
+
*/
|
|
1244
|
+
if (
|
|
1245
|
+
monitoringMethodForDiscoveredHost(data.host) ===
|
|
1246
|
+
NetworkDeviceMonitoringMethod.Monitor ||
|
|
1247
|
+
NetworkDeviceMonitoringMethodUtil.isMonitorBacked(
|
|
1248
|
+
data.networkDevice.monitoringMethod,
|
|
1249
|
+
)
|
|
1250
|
+
) {
|
|
1251
|
+
data.result.monitorsSkippedUnsupportedHost += data.templateIds.length;
|
|
1252
|
+
return false;
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1255
|
+
if (!data.networkDevice.id) {
|
|
1256
|
+
data.result.monitorsFailed += data.templateIds.length;
|
|
1257
|
+
logger.error(
|
|
1258
|
+
`Auto-import: cannot provision monitor(s) for ${data.host.ipAddress} because the Network Device has no id.`,
|
|
1259
|
+
{ projectId: data.projectId.toString() } as LogAttributes,
|
|
1260
|
+
);
|
|
1261
|
+
return false;
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
const networkDeviceId: ObjectID = data.networkDevice.id;
|
|
1265
|
+
const networkDeviceIdString: string = networkDeviceId.toString();
|
|
1266
|
+
const pendingTemplateIds: Array<string> = [];
|
|
1267
|
+
|
|
1268
|
+
/*
|
|
1269
|
+
* The project-wide snapshot is complete and indexed. Settle everything
|
|
1270
|
+
* it already covers before issuing the narrow JSON race-check query; an
|
|
1271
|
+
* established fleet whose monitors are already reconciled must not do one
|
|
1272
|
+
* full monitor-table search per discovered device on every scan.
|
|
1273
|
+
*/
|
|
1274
|
+
for (const templateId of data.templateIds) {
|
|
1275
|
+
const key: string =
|
|
1276
|
+
NetworkDeviceAutoImportRuleEngineServiceClass.monitorProvisioningKey(
|
|
1277
|
+
networkDeviceId,
|
|
1278
|
+
templateId,
|
|
1279
|
+
);
|
|
1280
|
+
|
|
1281
|
+
if (data.existingMonitors.autoProvisionedKeys.has(key)) {
|
|
1282
|
+
data.result.monitorsSkippedAlreadyExisting++;
|
|
1283
|
+
continue;
|
|
723
1284
|
}
|
|
724
1285
|
|
|
725
|
-
if (data.
|
|
726
|
-
/*
|
|
727
|
-
* A dry run reports the device as "created" in no counter at all —
|
|
728
|
-
* hostsMatched minus hostsSkippedAlreadyRegistered is exactly what a
|
|
729
|
-
* real run would attempt, and the sample above says which hosts.
|
|
730
|
-
* The address still joins the set, simulating the create's dedupe:
|
|
731
|
-
* without this, a host on duplicate rows (or in two overlapping
|
|
732
|
-
* scans) would be counted as importable once per appearance, and
|
|
733
|
-
* the dry run would promise more than the real run does.
|
|
734
|
-
*/
|
|
735
|
-
data.attempts.count++;
|
|
736
|
-
data.existingHostnames.add(host.ipAddress);
|
|
1286
|
+
if (data.existingMonitors.attemptedProvisioningKeys.has(key)) {
|
|
737
1287
|
continue;
|
|
738
1288
|
}
|
|
739
1289
|
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
1290
|
+
pendingTemplateIds.push(templateId);
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1293
|
+
if (pendingTemplateIds.length === 0) {
|
|
1294
|
+
return false;
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
if (
|
|
1298
|
+
data.existingMonitors.manuallyMonitoredDeviceIds.has(
|
|
1299
|
+
networkDeviceIdString,
|
|
1300
|
+
)
|
|
1301
|
+
) {
|
|
1302
|
+
data.result.monitorsSkippedAlreadyExisting += pendingTemplateIds.length;
|
|
1303
|
+
return false;
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
/*
|
|
1307
|
+
* Do not run the unindexed JSON race-check after this run's monitor-work
|
|
1308
|
+
* budget is already exhausted. The device remains unreconciled and the
|
|
1309
|
+
* truncated marker protocol brings it back on the next bounded pass.
|
|
1310
|
+
*/
|
|
1311
|
+
if (data.attempts.monitorCount >= MAX_MONITORS_PER_AUTO_IMPORT_RUN) {
|
|
1312
|
+
return true;
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1315
|
+
if (!data.isDryRun) {
|
|
1316
|
+
await this.refreshExistingMonitorsForDevice({
|
|
1317
|
+
projectId: data.projectId,
|
|
1318
|
+
networkDeviceId: networkDeviceId,
|
|
1319
|
+
state: data.existingMonitors,
|
|
747
1320
|
});
|
|
1321
|
+
}
|
|
748
1322
|
|
|
749
|
-
|
|
750
|
-
|
|
1323
|
+
if (
|
|
1324
|
+
data.existingMonitors.manuallyMonitoredDeviceIds.has(
|
|
1325
|
+
networkDeviceIdString,
|
|
1326
|
+
)
|
|
1327
|
+
) {
|
|
1328
|
+
data.result.monitorsSkippedAlreadyExisting += pendingTemplateIds.length;
|
|
1329
|
+
return false;
|
|
1330
|
+
}
|
|
1331
|
+
|
|
1332
|
+
for (const templateId of pendingTemplateIds) {
|
|
1333
|
+
const key: string =
|
|
1334
|
+
NetworkDeviceAutoImportRuleEngineServiceClass.monitorProvisioningKey(
|
|
1335
|
+
networkDeviceId,
|
|
1336
|
+
templateId,
|
|
1337
|
+
);
|
|
1338
|
+
|
|
1339
|
+
/* The race-check may have found this key after the initial snapshot. */
|
|
1340
|
+
if (data.existingMonitors.autoProvisionedKeys.has(key)) {
|
|
1341
|
+
data.result.monitorsSkippedAlreadyExisting++;
|
|
1342
|
+
continue;
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
if (data.attempts.monitorCount >= MAX_MONITORS_PER_AUTO_IMPORT_RUN) {
|
|
1346
|
+
return true;
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1349
|
+
data.attempts.monitorCount++;
|
|
1350
|
+
data.existingMonitors.attemptedProvisioningKeys.add(key);
|
|
1351
|
+
|
|
1352
|
+
/*
|
|
1353
|
+
* Invalid or concurrently deleted templates are failed attempts too.
|
|
1354
|
+
* Count them inside the same cap before looking up the cached template;
|
|
1355
|
+
* otherwise one stale rule could walk and log an unbounded estate in a
|
|
1356
|
+
* single API request or worker tick.
|
|
1357
|
+
*/
|
|
1358
|
+
const template: MonitorTemplate | undefined =
|
|
1359
|
+
data.monitorTemplates.get(templateId);
|
|
1360
|
+
|
|
1361
|
+
if (!template) {
|
|
1362
|
+
data.result.monitorsFailed++;
|
|
1363
|
+
logger.error(
|
|
1364
|
+
`Auto-import: Network Device monitor template ${templateId} is missing, deleted, or not valid for project ${data.projectId.toString()}.`,
|
|
1365
|
+
{ projectId: data.projectId.toString() } as LogAttributes,
|
|
1366
|
+
);
|
|
1367
|
+
continue;
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
if (data.isDryRun) {
|
|
1371
|
+
data.result.monitorsWouldCreate++;
|
|
1372
|
+
data.existingMonitors.autoProvisionedKeys.add(key);
|
|
1373
|
+
continue;
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
try {
|
|
1377
|
+
const monitor: Monitor = NetworkDeviceMonitorTemplateUtil.buildMonitor({
|
|
1378
|
+
template: template,
|
|
1379
|
+
networkDevice: data.networkDevice,
|
|
1380
|
+
});
|
|
1381
|
+
|
|
1382
|
+
await MonitorService.create({
|
|
1383
|
+
data: monitor,
|
|
1384
|
+
props: {
|
|
1385
|
+
isRoot: true,
|
|
1386
|
+
tenantId: data.projectId,
|
|
1387
|
+
},
|
|
1388
|
+
});
|
|
1389
|
+
|
|
1390
|
+
data.existingMonitors.autoProvisionedKeys.add(key);
|
|
1391
|
+
data.result.monitorsCreated++;
|
|
1392
|
+
} catch (error) {
|
|
1393
|
+
/*
|
|
1394
|
+
* The partial unique index is the final race backstop. If another
|
|
1395
|
+
* writer won between our cache read and create, classify that as an
|
|
1396
|
+
* idempotent skip; otherwise expose a real provisioning failure and
|
|
1397
|
+
* leave the key absent so a later scan or Run Now can retry it.
|
|
1398
|
+
*/
|
|
1399
|
+
const createdMeanwhile: Monitor | null = await MonitorService.findOneBy(
|
|
1400
|
+
{
|
|
1401
|
+
query: {
|
|
1402
|
+
projectId: data.projectId,
|
|
1403
|
+
monitorType: MonitorType.NetworkDevice,
|
|
1404
|
+
monitorTemplateId: new ObjectID(templateId),
|
|
1405
|
+
autoProvisionedNetworkDeviceId: networkDeviceId,
|
|
1406
|
+
},
|
|
1407
|
+
select: {
|
|
1408
|
+
_id: true,
|
|
1409
|
+
monitorType: true,
|
|
1410
|
+
monitorSteps: true,
|
|
1411
|
+
monitorTemplateId: true,
|
|
1412
|
+
autoProvisionedNetworkDeviceId: true,
|
|
1413
|
+
},
|
|
1414
|
+
props: { isRoot: true },
|
|
1415
|
+
},
|
|
1416
|
+
);
|
|
1417
|
+
|
|
1418
|
+
if (createdMeanwhile) {
|
|
1419
|
+
this.recordExistingMonitor(data.existingMonitors, createdMeanwhile);
|
|
1420
|
+
|
|
1421
|
+
if (data.existingMonitors.autoProvisionedKeys.has(key)) {
|
|
1422
|
+
data.result.monitorsSkippedAlreadyExisting++;
|
|
1423
|
+
continue;
|
|
1424
|
+
}
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1427
|
+
data.result.monitorsFailed++;
|
|
1428
|
+
logger.error(
|
|
1429
|
+
`Auto-import: could not create monitor from template ${templateId} for Network Device ${networkDeviceId.toString()} (${data.host.ipAddress}): ${error}`,
|
|
1430
|
+
{ projectId: data.projectId.toString() } as LogAttributes,
|
|
1431
|
+
);
|
|
751
1432
|
}
|
|
752
1433
|
}
|
|
753
1434
|
|
|
754
|
-
return
|
|
1435
|
+
return false;
|
|
755
1436
|
}
|
|
756
1437
|
|
|
757
1438
|
/*
|
|
@@ -769,15 +1450,15 @@ class NetworkDeviceAutoImportRuleEngineServiceClass {
|
|
|
769
1450
|
projectId: ObjectID;
|
|
770
1451
|
scan: NetworkDeviceDiscoveryScan;
|
|
771
1452
|
host: DiscoveredNetworkDevice;
|
|
772
|
-
|
|
1453
|
+
existingDevices: Map<string, NetworkDevice>;
|
|
773
1454
|
result: AutoImportRuleRunResult;
|
|
774
1455
|
attempts: ImportAttemptBudget;
|
|
775
|
-
}): Promise<boolean> {
|
|
776
|
-
data.attempts.
|
|
1456
|
+
}): Promise<{ device: NetworkDevice | null; wasCreated: boolean }> {
|
|
1457
|
+
data.attempts.deviceCount++;
|
|
777
1458
|
|
|
778
|
-
const attemptCreate: (name?: string) => Promise<
|
|
1459
|
+
const attemptCreate: (name?: string) => Promise<NetworkDevice> = async (
|
|
779
1460
|
name?: string,
|
|
780
|
-
): Promise<
|
|
1461
|
+
): Promise<NetworkDevice> => {
|
|
781
1462
|
const device: NetworkDevice = buildNetworkDeviceFromDiscoveredHost({
|
|
782
1463
|
projectId: data.projectId,
|
|
783
1464
|
host: data.host,
|
|
@@ -792,16 +1473,20 @@ class NetworkDeviceAutoImportRuleEngineServiceClass {
|
|
|
792
1473
|
autoApplyVendorHealthTemplate: true,
|
|
793
1474
|
});
|
|
794
1475
|
|
|
795
|
-
await NetworkDeviceService.create({
|
|
1476
|
+
const created: NetworkDevice = await NetworkDeviceService.create({
|
|
796
1477
|
data: device,
|
|
797
1478
|
props: {
|
|
798
1479
|
isRoot: true,
|
|
799
1480
|
},
|
|
800
1481
|
});
|
|
1482
|
+
|
|
1483
|
+
return created || device;
|
|
801
1484
|
};
|
|
802
1485
|
|
|
1486
|
+
let createdDevice: NetworkDevice;
|
|
1487
|
+
|
|
803
1488
|
try {
|
|
804
|
-
await attemptCreate();
|
|
1489
|
+
createdDevice = await attemptCreate();
|
|
805
1490
|
} catch (firstError) {
|
|
806
1491
|
const registeredMeanwhile: NetworkDevice | null =
|
|
807
1492
|
await NetworkDeviceService.findOneBy({
|
|
@@ -809,33 +1494,39 @@ class NetworkDeviceAutoImportRuleEngineServiceClass {
|
|
|
809
1494
|
projectId: data.projectId,
|
|
810
1495
|
hostname: data.host.ipAddress,
|
|
811
1496
|
},
|
|
812
|
-
select: {
|
|
1497
|
+
select: {
|
|
1498
|
+
_id: true,
|
|
1499
|
+
projectId: true,
|
|
1500
|
+
name: true,
|
|
1501
|
+
hostname: true,
|
|
1502
|
+
monitoringMethod: true,
|
|
1503
|
+
},
|
|
813
1504
|
props: { isRoot: true },
|
|
814
1505
|
});
|
|
815
1506
|
|
|
816
1507
|
if (registeredMeanwhile) {
|
|
817
1508
|
// Skipped is a sub-bucket of matched, same as the other run results.
|
|
818
1509
|
data.result.hostsSkippedAlreadyRegistered++;
|
|
819
|
-
data.
|
|
820
|
-
return false;
|
|
1510
|
+
data.existingDevices.set(data.host.ipAddress, registeredMeanwhile);
|
|
1511
|
+
return { device: registeredMeanwhile, wasCreated: false };
|
|
821
1512
|
}
|
|
822
1513
|
|
|
823
1514
|
try {
|
|
824
|
-
await attemptCreate(buildFallbackDeviceName(data.host));
|
|
1515
|
+
createdDevice = await attemptCreate(buildFallbackDeviceName(data.host));
|
|
825
1516
|
} catch (secondError) {
|
|
826
1517
|
data.result.devicesFailed++;
|
|
827
1518
|
logger.error(
|
|
828
1519
|
`Auto-import: could not create a device for ${data.host.ipAddress} (scan ${data.scan.id?.toString()}): ${firstError} / retry: ${secondError}`,
|
|
829
1520
|
{ projectId: data.projectId.toString() } as LogAttributes,
|
|
830
1521
|
);
|
|
831
|
-
return false;
|
|
1522
|
+
return { device: null, wasCreated: false };
|
|
832
1523
|
}
|
|
833
1524
|
}
|
|
834
1525
|
|
|
835
1526
|
data.result.devicesCreated++;
|
|
836
|
-
data.
|
|
1527
|
+
data.existingDevices.set(data.host.ipAddress, createdDevice);
|
|
837
1528
|
|
|
838
|
-
return true;
|
|
1529
|
+
return { device: createdDevice, wasCreated: true };
|
|
839
1530
|
}
|
|
840
1531
|
|
|
841
1532
|
/*
|