@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
|
@@ -0,0 +1,827 @@
|
|
|
1
|
+
import ColumnLength from "../../Types/Database/ColumnLength";
|
|
2
|
+
import ObjectID from "../../Types/ObjectID";
|
|
3
|
+
import SnmpAuthProtocol, {
|
|
4
|
+
SnmpAuthProtocolUtil,
|
|
5
|
+
} from "../../Types/Monitor/SnmpMonitor/SnmpAuthProtocol";
|
|
6
|
+
import SnmpPrivProtocol, {
|
|
7
|
+
SnmpPrivProtocolUtil,
|
|
8
|
+
} from "../../Types/Monitor/SnmpMonitor/SnmpPrivProtocol";
|
|
9
|
+
import SnmpSecurityLevel, {
|
|
10
|
+
SnmpSecurityLevelUtil,
|
|
11
|
+
} from "../../Types/Monitor/SnmpMonitor/SnmpSecurityLevel";
|
|
12
|
+
import SnmpVersion, {
|
|
13
|
+
SnmpVersionUtil,
|
|
14
|
+
} from "../../Types/Monitor/SnmpMonitor/SnmpVersion";
|
|
15
|
+
|
|
16
|
+
/*
|
|
17
|
+
* The ordered list of SNMP credential sets a discovery scan tries.
|
|
18
|
+
*
|
|
19
|
+
* WHY IT EXISTS
|
|
20
|
+
*
|
|
21
|
+
* A scan used to carry exactly one credential set, in the flattened
|
|
22
|
+
* snmpVersion / snmpCommunityString / snmpPort / snmpV3* columns on
|
|
23
|
+
* NetworkDeviceDiscoveryScan, and the probe built one SNMP session config from
|
|
24
|
+
* it and reused it for every address in the sweep. Real subnets are not shaped
|
|
25
|
+
* that way: access switches on v2c with one community, the core on v3, a
|
|
26
|
+
* vendor block on a community of its own, printers on the factory default.
|
|
27
|
+
* Scanning such a segment took one scan per credential — separate schedules,
|
|
28
|
+
* separate result sets, the same ping-only hosts offered for import in each of
|
|
29
|
+
* them — or one scan that silently missed every device speaking a version it
|
|
30
|
+
* was not configured for (OneUptime issue #3458).
|
|
31
|
+
*
|
|
32
|
+
* That last failure mode is the expensive one, because it is invisible: a
|
|
33
|
+
* device that rejects the scan's community answers with an authentication
|
|
34
|
+
* error, which the sweep counts but which still lands in the operator's lap as
|
|
35
|
+
* "0 discovered".
|
|
36
|
+
*
|
|
37
|
+
* WHY IT LIVES IN Common
|
|
38
|
+
*
|
|
39
|
+
* Four layers need the same answer to "what credentials does this scan try,
|
|
40
|
+
* and in what order?":
|
|
41
|
+
*
|
|
42
|
+
* - the Dashboard create/edit form, which collects them,
|
|
43
|
+
* - the server write hooks, which validate and normalize them,
|
|
44
|
+
* - the probe, which sweeps with them,
|
|
45
|
+
* - the import path (manual review and the auto-import rule engine), which
|
|
46
|
+
* has to build each device with THE credential set that actually answered
|
|
47
|
+
* for that host.
|
|
48
|
+
*
|
|
49
|
+
* Answering it in one module is what keeps the form's error message identical
|
|
50
|
+
* to the server's, and what makes it impossible for a host found with config
|
|
51
|
+
* #4 to be imported carrying config #1's community string. Same reason
|
|
52
|
+
* ScanTargetUtil and ScanNameUtil sit next door.
|
|
53
|
+
*/
|
|
54
|
+
|
|
55
|
+
/*
|
|
56
|
+
* One credential set.
|
|
57
|
+
*
|
|
58
|
+
* The credential fields are named EXACTLY like the flattened columns they
|
|
59
|
+
* generalize, so a legacy scan row satisfies this interface structurally and
|
|
60
|
+
* `resolve()` below can hand back either shape without a translation table.
|
|
61
|
+
* Common/Tests/Utils/NetworkDiscovery/SnmpScanConfigUtil.test.ts pins that
|
|
62
|
+
* correspondence.
|
|
63
|
+
*/
|
|
64
|
+
export interface DiscoveryScanSnmpConfig {
|
|
65
|
+
/*
|
|
66
|
+
* Stable identity for this credential set within its scan, so a discovered
|
|
67
|
+
* host can record WHICH config answered it (DiscoveredNetworkDevice
|
|
68
|
+
* .snmpConfigId) and the import path can look the credentials back up.
|
|
69
|
+
*
|
|
70
|
+
* Not the array index: the operator can add, delete and reorder entries, and
|
|
71
|
+
* an index would silently re-point a stored result at a different
|
|
72
|
+
* credential. Minted by the form when a card is added and, for anything that
|
|
73
|
+
* writes the column out of band (a direct API call), by the service's write
|
|
74
|
+
* hooks — so a stored config always has one.
|
|
75
|
+
*/
|
|
76
|
+
id?: string | undefined;
|
|
77
|
+
/*
|
|
78
|
+
* Optional operator label ("Core switches", "Printers - factory default").
|
|
79
|
+
* A list of five credential sets is unreadable without one, and it is the
|
|
80
|
+
* only thing that can be shown beside a discovered host to say how it was
|
|
81
|
+
* found — the credentials themselves obviously cannot be.
|
|
82
|
+
*/
|
|
83
|
+
name?: string | undefined;
|
|
84
|
+
snmpVersion?: string | undefined;
|
|
85
|
+
snmpCommunityString?: string | undefined;
|
|
86
|
+
snmpPort?: number | undefined;
|
|
87
|
+
snmpV3SecurityLevel?: string | undefined;
|
|
88
|
+
snmpV3Username?: string | undefined;
|
|
89
|
+
snmpV3AuthProtocol?: string | undefined;
|
|
90
|
+
snmpV3AuthKey?: string | undefined;
|
|
91
|
+
snmpV3PrivProtocol?: string | undefined;
|
|
92
|
+
snmpV3PrivKey?: string | undefined;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/*
|
|
96
|
+
* The parts of a scan row `resolve()` reads. Structural rather than the model
|
|
97
|
+
* type, so a partially-selected row satisfies it — and so this module stays
|
|
98
|
+
* importable from the Probe without dragging a database model behind it.
|
|
99
|
+
*/
|
|
100
|
+
export interface SnmpScanConfigSource {
|
|
101
|
+
snmpConfigs?: Array<DiscoveryScanSnmpConfig> | null | undefined;
|
|
102
|
+
snmpVersion?: string | null | undefined;
|
|
103
|
+
snmpCommunityString?: string | null | undefined;
|
|
104
|
+
snmpPort?: number | null | undefined;
|
|
105
|
+
snmpV3SecurityLevel?: string | null | undefined;
|
|
106
|
+
snmpV3Username?: string | null | undefined;
|
|
107
|
+
snmpV3AuthProtocol?: string | null | undefined;
|
|
108
|
+
snmpV3AuthKey?: string | null | undefined;
|
|
109
|
+
snmpV3PrivProtocol?: string | null | undefined;
|
|
110
|
+
snmpV3PrivKey?: string | null | undefined;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/*
|
|
114
|
+
* The id given to the single config synthesized from a scan's flattened
|
|
115
|
+
* columns — every scan created before `snmpConfigs` existed, and every scan
|
|
116
|
+
* written by an API caller that only knows the old fields.
|
|
117
|
+
*
|
|
118
|
+
* A literal rather than a minted ObjectID because it has to be STABLE across
|
|
119
|
+
* calls: the probe stamps it onto each discovered host, and the import path
|
|
120
|
+
* looks it up again in a separately resolved list, in a different process,
|
|
121
|
+
* possibly days later.
|
|
122
|
+
*/
|
|
123
|
+
export const LEGACY_SNMP_CONFIG_ID: string = "legacy";
|
|
124
|
+
|
|
125
|
+
/*
|
|
126
|
+
* How many credential sets one scan may carry.
|
|
127
|
+
*
|
|
128
|
+
* WHAT AN EXTRA SET COSTS
|
|
129
|
+
*
|
|
130
|
+
* The sweep tries sets in order and stops at the first that answers, so a host
|
|
131
|
+
* that ANSWERS costs what it always did. A host that answers nothing costs one
|
|
132
|
+
* full SNMP timeout per set, and the arithmetic for a whole range is
|
|
133
|
+
*
|
|
134
|
+
* hosts x sets x 2s timeout / 32 concurrent probes
|
|
135
|
+
*
|
|
136
|
+
* WHICH DOES NOT FIT THE MAXIMUM TARGET, AND DID NOT BEFORE THIS EXISTED
|
|
137
|
+
*
|
|
138
|
+
* ScanTargetUtil.MAX_SCAN_HOSTS is 32,768, so a full-range sweep costs ~34
|
|
139
|
+
* minutes per set: about 34 minutes at one set, 68 at two, and past the
|
|
140
|
+
* probe's PROBE_DISCOVERY_SCAN_TIMEOUT_IN_MS deadline (90 minutes) at three.
|
|
141
|
+
* Ten sets would be some 5.7 hours. This ceiling therefore CANNOT be chosen to
|
|
142
|
+
* make the worst case fit — a single-credential scan of a maximum target
|
|
143
|
+
* already sits inside a factor of three of the deadline, and always has.
|
|
144
|
+
*
|
|
145
|
+
* WHAT ACTUALLY BOUNDS IT
|
|
146
|
+
*
|
|
147
|
+
* The ICMP pre-sweep. Only hosts that answered ping are SNMP-probed, so the
|
|
148
|
+
* realistic cost is proportional to LIVE hosts, not to the size of the range —
|
|
149
|
+
* and a 32,768-address range with a few hundred live hosts costs seconds per
|
|
150
|
+
* set. Exactly two paths pay the full-range price: a probe that cannot send
|
|
151
|
+
* ICMP at all (no ping binary, no NET_RAW), and the phase-3 fallback, which
|
|
152
|
+
* re-probes every ICMP-silent address when NO set answered anything. Both are
|
|
153
|
+
* already unusual, and the second is itself the "your credentials are wrong"
|
|
154
|
+
* case this feature exists to fix.
|
|
155
|
+
*
|
|
156
|
+
* When a sweep does cross the deadline the probe abandons it and reports the
|
|
157
|
+
* scan Failed with a sentence telling the operator to narrow the target — so
|
|
158
|
+
* the failure is loud and actionable rather than silent. This ceiling is the
|
|
159
|
+
* cheaper guard in front of that: ten is far more than any real segment needs
|
|
160
|
+
* (three or four is the shape of a mixed subnet), and the validation message
|
|
161
|
+
* below says what to do instead of a longer list.
|
|
162
|
+
*/
|
|
163
|
+
export const MAX_SNMP_CONFIGS_PER_SCAN: number = 10;
|
|
164
|
+
|
|
165
|
+
/*
|
|
166
|
+
* Matches NetworkDeviceDiscoveryScan.name, which is a ShortText column, for
|
|
167
|
+
* the same reason ScanNameUtil bounds that one: these names are rendered on a
|
|
168
|
+
* single line in a card header and inlined into the probe's log messages. The
|
|
169
|
+
* value itself lives inside a jsonb column with no length of its own, so
|
|
170
|
+
* nothing downstream would reject an essay — which is exactly why it is
|
|
171
|
+
* bounded here.
|
|
172
|
+
*/
|
|
173
|
+
export const MAX_SNMP_CONFIG_NAME_LENGTH: number = ColumnLength.ShortText;
|
|
174
|
+
|
|
175
|
+
/*
|
|
176
|
+
* The credential fields are bounded to the columns they are MIRRORED INTO, not
|
|
177
|
+
* to the jsonb column they live in.
|
|
178
|
+
*
|
|
179
|
+
* A jsonb value has no length of its own, so nothing downstream would reject a
|
|
180
|
+
* novel typed into a community string — but the first config of every list is
|
|
181
|
+
* copied onto the flattened columns for probes that predate the list
|
|
182
|
+
* (getMirroredLegacyColumns), and those are a varchar(100) and a varchar(500).
|
|
183
|
+
* Postgres does not truncate an over-long value there, it throws, so without
|
|
184
|
+
* this the save failed on the WRITE with an error naming `snmpCommunityString`
|
|
185
|
+
* — a column that no longer appears on the form — and only when the offending
|
|
186
|
+
* value happened to be in card #1. In any other card it stored fine and became
|
|
187
|
+
* a credential the mirror could never carry.
|
|
188
|
+
*
|
|
189
|
+
* Bounding here makes it one rule, checked on every card, in the words of the
|
|
190
|
+
* field the operator is actually looking at.
|
|
191
|
+
*/
|
|
192
|
+
export const MAX_SNMP_CONFIG_SHORT_TEXT_LENGTH: number = ColumnLength.ShortText;
|
|
193
|
+
export const MAX_SNMP_CONFIG_KEY_LENGTH: number = ColumnLength.LongText;
|
|
194
|
+
|
|
195
|
+
// Matches the UDP port range; see validateSnmpPort in the Dashboard's form.
|
|
196
|
+
export const MINIMUM_SNMP_PORT: number = 1;
|
|
197
|
+
export const MAXIMUM_SNMP_PORT: number = 65535;
|
|
198
|
+
|
|
199
|
+
export class SnmpScanConfigUtil {
|
|
200
|
+
/*
|
|
201
|
+
* The credential sets this scan tries, in the order it tries them. NEVER
|
|
202
|
+
* empty: a scan with no `snmpConfigs` is a scan configured the old way, and
|
|
203
|
+
* its flattened columns ARE its one credential set.
|
|
204
|
+
*
|
|
205
|
+
* This is the single reader. The probe sweeps with what it returns, the
|
|
206
|
+
* import path resolves a host's credentials out of it, and the form seeds
|
|
207
|
+
* its editor from it — so "what does this scan actually try?" has exactly
|
|
208
|
+
* one answer no matter who asks.
|
|
209
|
+
*/
|
|
210
|
+
public static resolve(
|
|
211
|
+
scan: SnmpScanConfigSource,
|
|
212
|
+
): Array<DiscoveryScanSnmpConfig> {
|
|
213
|
+
const stored: Array<DiscoveryScanSnmpConfig> = Array.isArray(
|
|
214
|
+
scan.snmpConfigs,
|
|
215
|
+
)
|
|
216
|
+
? scan.snmpConfigs.filter((config: DiscoveryScanSnmpConfig): boolean => {
|
|
217
|
+
return Boolean(config) && typeof config === "object";
|
|
218
|
+
})
|
|
219
|
+
: [];
|
|
220
|
+
|
|
221
|
+
if (stored.length > 0) {
|
|
222
|
+
return stored.map(
|
|
223
|
+
(
|
|
224
|
+
config: DiscoveryScanSnmpConfig,
|
|
225
|
+
index: number,
|
|
226
|
+
): DiscoveryScanSnmpConfig => {
|
|
227
|
+
return SnmpScanConfigUtil.normalizeConfig(config, index);
|
|
228
|
+
},
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/*
|
|
233
|
+
* The legacy shape. Read straight off the flattened columns rather than
|
|
234
|
+
* migrated into the new column, deliberately: a data migration over every
|
|
235
|
+
* historical scan buys nothing (this synthesizes the identical config on
|
|
236
|
+
* every read) and would have to guess at rows whose columns are half
|
|
237
|
+
* populated.
|
|
238
|
+
*/
|
|
239
|
+
return [
|
|
240
|
+
SnmpScanConfigUtil.normalizeConfig(
|
|
241
|
+
{
|
|
242
|
+
id: LEGACY_SNMP_CONFIG_ID,
|
|
243
|
+
snmpVersion: scan.snmpVersion ?? undefined,
|
|
244
|
+
snmpCommunityString: scan.snmpCommunityString ?? undefined,
|
|
245
|
+
snmpPort: scan.snmpPort ?? undefined,
|
|
246
|
+
snmpV3SecurityLevel: scan.snmpV3SecurityLevel ?? undefined,
|
|
247
|
+
snmpV3Username: scan.snmpV3Username ?? undefined,
|
|
248
|
+
snmpV3AuthProtocol: scan.snmpV3AuthProtocol ?? undefined,
|
|
249
|
+
snmpV3AuthKey: scan.snmpV3AuthKey ?? undefined,
|
|
250
|
+
snmpV3PrivProtocol: scan.snmpV3PrivProtocol ?? undefined,
|
|
251
|
+
snmpV3PrivKey: scan.snmpV3PrivKey ?? undefined,
|
|
252
|
+
},
|
|
253
|
+
0,
|
|
254
|
+
),
|
|
255
|
+
];
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/*
|
|
259
|
+
* The stored list, when the value really is one, or null.
|
|
260
|
+
*
|
|
261
|
+
* The distinction matters at every WRITE site: "this row has its own
|
|
262
|
+
* credential list" and "this row is described by its flattened columns" are
|
|
263
|
+
* two different states, and a jsonb column can arrive holding neither shape
|
|
264
|
+
* (a string, an object, an empty array) from an out-of-band writer. resolve()
|
|
265
|
+
* papers over all of that for readers; this is the version writers need,
|
|
266
|
+
* which answers the question honestly rather than synthesizing something.
|
|
267
|
+
*/
|
|
268
|
+
public static readStoredList(
|
|
269
|
+
value: unknown,
|
|
270
|
+
): Array<DiscoveryScanSnmpConfig> | null {
|
|
271
|
+
if (!Array.isArray(value) || value.length === 0) {
|
|
272
|
+
return null;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
const configs: Array<DiscoveryScanSnmpConfig> = value.filter(
|
|
276
|
+
(config: unknown): boolean => {
|
|
277
|
+
return Boolean(config) && typeof config === "object";
|
|
278
|
+
},
|
|
279
|
+
);
|
|
280
|
+
|
|
281
|
+
return configs.length > 0 ? configs : null;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/*
|
|
285
|
+
* The config that found a given host, or undefined when the host carries no
|
|
286
|
+
* config id (every result stored before this feature) or names one that is
|
|
287
|
+
* no longer in the list.
|
|
288
|
+
*
|
|
289
|
+
* Callers fall back to the FIRST config rather than to nothing — see
|
|
290
|
+
* `resolveForHost` — because a device imported with the wrong credentials is
|
|
291
|
+
* repairable on the device form, whereas a device imported with none can
|
|
292
|
+
* never poll and gives the operator nothing to correct.
|
|
293
|
+
*/
|
|
294
|
+
public static findById(
|
|
295
|
+
configs: Array<DiscoveryScanSnmpConfig>,
|
|
296
|
+
id: string | null | undefined,
|
|
297
|
+
): DiscoveryScanSnmpConfig | undefined {
|
|
298
|
+
if (!id) {
|
|
299
|
+
return undefined;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
return configs.find((config: DiscoveryScanSnmpConfig): boolean => {
|
|
303
|
+
return config.id === id;
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
/*
|
|
308
|
+
* The credentials to import a discovered host with: the config that actually
|
|
309
|
+
* answered it, falling back to the first config in the list.
|
|
310
|
+
*
|
|
311
|
+
* The fallback is what makes results stored before this feature — and
|
|
312
|
+
* ping-only hosts, which no config found — import exactly as they did
|
|
313
|
+
* before, because for a legacy scan the first (and only) config IS the
|
|
314
|
+
* flattened columns.
|
|
315
|
+
*/
|
|
316
|
+
public static resolveForHost(
|
|
317
|
+
scan: SnmpScanConfigSource,
|
|
318
|
+
snmpConfigId: string | null | undefined,
|
|
319
|
+
): DiscoveryScanSnmpConfig {
|
|
320
|
+
const configs: Array<DiscoveryScanSnmpConfig> =
|
|
321
|
+
SnmpScanConfigUtil.resolve(scan);
|
|
322
|
+
|
|
323
|
+
return SnmpScanConfigUtil.findById(configs, snmpConfigId) || configs[0]!;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
/*
|
|
327
|
+
* One config, cleaned up into the shape everything downstream expects:
|
|
328
|
+
* trimmed strings, a numeric port, blanks dropped, and an id guaranteed.
|
|
329
|
+
*
|
|
330
|
+
* The `index` is only used to synthesize an id for a config that has none.
|
|
331
|
+
* That is a repair for out-of-band writers, NOT the normal path — the form
|
|
332
|
+
* mints an id per card and the service's write hooks mint one for anything
|
|
333
|
+
* that arrives without. It is index-derived rather than random so that
|
|
334
|
+
* resolving the same row twice yields the same ids, which matters because
|
|
335
|
+
* this runs independently in the probe and in the importer.
|
|
336
|
+
*/
|
|
337
|
+
private static normalizeConfig(
|
|
338
|
+
config: DiscoveryScanSnmpConfig,
|
|
339
|
+
index: number,
|
|
340
|
+
): DiscoveryScanSnmpConfig {
|
|
341
|
+
const normalized: DiscoveryScanSnmpConfig = {
|
|
342
|
+
id: SnmpScanConfigUtil.readString(config.id) || `config-${index + 1}`,
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
const name: string | undefined = SnmpScanConfigUtil.readString(config.name);
|
|
346
|
+
if (name !== undefined) {
|
|
347
|
+
normalized.name = name;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/*
|
|
351
|
+
* Normalized to the stored spelling ("V1"/"V2c"/"V3") rather than left as
|
|
352
|
+
* typed. SnmpVersionUtil.parse accepts either spelling and defaults to
|
|
353
|
+
* V2c, so this both repairs a hand-written "3" and gives the version an
|
|
354
|
+
* unambiguous value for the comparisons the service does on save.
|
|
355
|
+
*/
|
|
356
|
+
normalized.snmpVersion = SnmpScanConfigUtil.toStoredVersion(
|
|
357
|
+
config.snmpVersion,
|
|
358
|
+
);
|
|
359
|
+
|
|
360
|
+
const communityString: string | undefined = SnmpScanConfigUtil.readString(
|
|
361
|
+
config.snmpCommunityString,
|
|
362
|
+
);
|
|
363
|
+
if (communityString !== undefined) {
|
|
364
|
+
normalized.snmpCommunityString = communityString;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
const port: number | undefined = SnmpScanConfigUtil.readPort(
|
|
368
|
+
config.snmpPort,
|
|
369
|
+
);
|
|
370
|
+
if (port !== undefined) {
|
|
371
|
+
normalized.snmpPort = port;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
/*
|
|
375
|
+
* The v3 block is carried verbatim (beyond trimming). It is NOT dropped
|
|
376
|
+
* for a v1/v2c config, nor is the community dropped for a v3 one: an
|
|
377
|
+
* operator who switches a card's version to try something and switches it
|
|
378
|
+
* back must not silently lose the keys they had typed. The probe reads
|
|
379
|
+
* only what the chosen version needs.
|
|
380
|
+
*/
|
|
381
|
+
const v3Fields: Array<[keyof DiscoveryScanSnmpConfig, string | undefined]> =
|
|
382
|
+
[
|
|
383
|
+
["snmpV3SecurityLevel", config.snmpV3SecurityLevel],
|
|
384
|
+
["snmpV3Username", config.snmpV3Username],
|
|
385
|
+
["snmpV3AuthProtocol", config.snmpV3AuthProtocol],
|
|
386
|
+
["snmpV3AuthKey", config.snmpV3AuthKey],
|
|
387
|
+
["snmpV3PrivProtocol", config.snmpV3PrivProtocol],
|
|
388
|
+
["snmpV3PrivKey", config.snmpV3PrivKey],
|
|
389
|
+
];
|
|
390
|
+
|
|
391
|
+
for (const [key, rawValue] of v3Fields) {
|
|
392
|
+
const value: string | undefined = SnmpScanConfigUtil.readString(rawValue);
|
|
393
|
+
|
|
394
|
+
if (value !== undefined) {
|
|
395
|
+
(normalized as Record<string, unknown>)[key as string] = value;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
return normalized;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
/*
|
|
403
|
+
* The stored spelling of a version ("V1" / "V2c" / "V3").
|
|
404
|
+
*
|
|
405
|
+
* Written as an explicit map off the parsed enum rather than by
|
|
406
|
+
* upper-casing the input, so an unrecognized value lands on the same
|
|
407
|
+
* default the probe would have used ("V2c") instead of being stored as
|
|
408
|
+
* itself and disagreeing with the sweep.
|
|
409
|
+
*/
|
|
410
|
+
public static toStoredVersion(value: string | null | undefined): string {
|
|
411
|
+
if (SnmpVersionUtil.isV3(value)) {
|
|
412
|
+
return "V3";
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
return SnmpVersionUtil.parse(value) === SnmpVersion.V1 ? "V1" : "V2c";
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
/*
|
|
419
|
+
* A short, non-secret way to refer to one config in running text — a probe
|
|
420
|
+
* log line, a validation message, the caption under a discovered host.
|
|
421
|
+
*
|
|
422
|
+
* NEVER includes a community string or a key. These strings reach places the
|
|
423
|
+
* credential columns deliberately do not (the probe's log, the scan's
|
|
424
|
+
* statusMessage, which is readable by a Viewer), so the label is built from
|
|
425
|
+
* the operator's own name and the version alone.
|
|
426
|
+
*/
|
|
427
|
+
public static getConfigLabel(
|
|
428
|
+
config: DiscoveryScanSnmpConfig,
|
|
429
|
+
index?: number | undefined,
|
|
430
|
+
): string {
|
|
431
|
+
const name: string | undefined = SnmpScanConfigUtil.readString(config.name);
|
|
432
|
+
const version: string = SnmpScanConfigUtil.toStoredVersion(
|
|
433
|
+
config.snmpVersion,
|
|
434
|
+
);
|
|
435
|
+
|
|
436
|
+
if (name) {
|
|
437
|
+
return `${name} (${version})`;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
return index === undefined
|
|
441
|
+
? version
|
|
442
|
+
: `SNMP config ${index + 1} (${version})`;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
/*
|
|
446
|
+
* The single validation entry point for the whole list, shared by the
|
|
447
|
+
* Dashboard form and the server's create/update hooks — so the sentence the
|
|
448
|
+
* operator reads on the form is the same sentence the API returns.
|
|
449
|
+
*
|
|
450
|
+
* Returns null when the value is storable, INCLUDING when it is absent: the
|
|
451
|
+
* column is optional and a scan with no list is a scan configured through
|
|
452
|
+
* the flattened columns.
|
|
453
|
+
*
|
|
454
|
+
* `value` is typed unknown for the same reason ScanTargetUtil's target is:
|
|
455
|
+
* the server hook runs before the model's own type checks, so it is the
|
|
456
|
+
* first thing to see whatever the client actually sent — which for a jsonb
|
|
457
|
+
* column really can be a string, a number or an object.
|
|
458
|
+
*/
|
|
459
|
+
public static getValidationError(value: unknown): string | null {
|
|
460
|
+
if (value === undefined || value === null) {
|
|
461
|
+
return null;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
if (!Array.isArray(value)) {
|
|
465
|
+
return "SNMP configs must be a list.";
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
if (value.length === 0) {
|
|
469
|
+
/*
|
|
470
|
+
* An empty list is refused rather than quietly treated as "use the
|
|
471
|
+
* flattened columns". The operator got here by deleting every card, and
|
|
472
|
+
* silently falling back to a hidden credential set they can no longer
|
|
473
|
+
* see is the kind of behaviour that produces a scan nobody can explain.
|
|
474
|
+
*/
|
|
475
|
+
return "Add at least one SNMP config, or the scan has no credentials to try.";
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
if (value.length > MAX_SNMP_CONFIGS_PER_SCAN) {
|
|
479
|
+
return (
|
|
480
|
+
`A scan can try at most ${MAX_SNMP_CONFIGS_PER_SCAN} SNMP configs. ` +
|
|
481
|
+
`This one has ${value.length}. Every extra config costs another SNMP ` +
|
|
482
|
+
`timeout on each address that answers nothing, so a long list can push ` +
|
|
483
|
+
`a large sweep past the probe's time limit. Split the range into more scans instead.`
|
|
484
|
+
);
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
const seenIds: Set<string> = new Set<string>();
|
|
488
|
+
|
|
489
|
+
for (let index: number = 0; index < value.length; index++) {
|
|
490
|
+
const config: unknown = value[index];
|
|
491
|
+
|
|
492
|
+
if (!config || typeof config !== "object" || Array.isArray(config)) {
|
|
493
|
+
return `SNMP config ${index + 1} is not valid.`;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
const error: string | null = SnmpScanConfigUtil.getConfigValidationError(
|
|
497
|
+
config as DiscoveryScanSnmpConfig,
|
|
498
|
+
index,
|
|
499
|
+
);
|
|
500
|
+
|
|
501
|
+
if (error) {
|
|
502
|
+
return error;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
/*
|
|
506
|
+
* Duplicate ids would make `findById` ambiguous, so a host found by the
|
|
507
|
+
* second of two identically-identified configs could import with the
|
|
508
|
+
* first one's credentials — the precise bug this whole id scheme exists
|
|
509
|
+
* to prevent. Only reachable through an out-of-band write; the form
|
|
510
|
+
* mints one id per card.
|
|
511
|
+
*/
|
|
512
|
+
const id: string | undefined = SnmpScanConfigUtil.readString(
|
|
513
|
+
(config as DiscoveryScanSnmpConfig).id,
|
|
514
|
+
);
|
|
515
|
+
|
|
516
|
+
if (id) {
|
|
517
|
+
if (seenIds.has(id)) {
|
|
518
|
+
return `Two SNMP configs share the id "${id}". Each config needs its own.`;
|
|
519
|
+
}
|
|
520
|
+
seenIds.add(id);
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
return null;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
/*
|
|
528
|
+
* One config's rules. Split out so the message can name WHICH card is wrong
|
|
529
|
+
* — with five credential sets on screen, "SNMP v3 Username is required" on
|
|
530
|
+
* its own is not an actionable sentence.
|
|
531
|
+
*/
|
|
532
|
+
private static getConfigValidationError(
|
|
533
|
+
config: DiscoveryScanSnmpConfig,
|
|
534
|
+
index: number,
|
|
535
|
+
): string | null {
|
|
536
|
+
const position: string = `SNMP config ${index + 1}`;
|
|
537
|
+
|
|
538
|
+
for (const [key, label] of [
|
|
539
|
+
["id", "id"],
|
|
540
|
+
["name", "name"],
|
|
541
|
+
["snmpVersion", "version"],
|
|
542
|
+
["snmpCommunityString", "community string"],
|
|
543
|
+
["snmpV3SecurityLevel", "v3 security level"],
|
|
544
|
+
["snmpV3Username", "v3 username"],
|
|
545
|
+
["snmpV3AuthProtocol", "v3 authentication protocol"],
|
|
546
|
+
["snmpV3AuthKey", "v3 authentication key"],
|
|
547
|
+
["snmpV3PrivProtocol", "v3 privacy protocol"],
|
|
548
|
+
["snmpV3PrivKey", "v3 privacy key"],
|
|
549
|
+
] as Array<[keyof DiscoveryScanSnmpConfig, string]>) {
|
|
550
|
+
const raw: unknown = config[key];
|
|
551
|
+
|
|
552
|
+
if (raw !== undefined && raw !== null && typeof raw !== "string") {
|
|
553
|
+
return `${position}: the ${label} must be text.`;
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
const name: string | undefined = SnmpScanConfigUtil.readString(config.name);
|
|
558
|
+
|
|
559
|
+
if (name !== undefined && name.length > MAX_SNMP_CONFIG_NAME_LENGTH) {
|
|
560
|
+
return (
|
|
561
|
+
`${position}: a name cannot be longer than ${MAX_SNMP_CONFIG_NAME_LENGTH} ` +
|
|
562
|
+
`characters. This one is ${name.length}.`
|
|
563
|
+
);
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
for (const [key, label, maxLength] of [
|
|
567
|
+
["id", "id", MAX_SNMP_CONFIG_SHORT_TEXT_LENGTH],
|
|
568
|
+
[
|
|
569
|
+
"snmpCommunityString",
|
|
570
|
+
"community string",
|
|
571
|
+
MAX_SNMP_CONFIG_SHORT_TEXT_LENGTH,
|
|
572
|
+
],
|
|
573
|
+
["snmpV3Username", "v3 username", MAX_SNMP_CONFIG_SHORT_TEXT_LENGTH],
|
|
574
|
+
[
|
|
575
|
+
"snmpV3SecurityLevel",
|
|
576
|
+
"v3 security level",
|
|
577
|
+
MAX_SNMP_CONFIG_SHORT_TEXT_LENGTH,
|
|
578
|
+
],
|
|
579
|
+
[
|
|
580
|
+
"snmpV3AuthProtocol",
|
|
581
|
+
"v3 authentication protocol",
|
|
582
|
+
MAX_SNMP_CONFIG_SHORT_TEXT_LENGTH,
|
|
583
|
+
],
|
|
584
|
+
[
|
|
585
|
+
"snmpV3PrivProtocol",
|
|
586
|
+
"v3 privacy protocol",
|
|
587
|
+
MAX_SNMP_CONFIG_SHORT_TEXT_LENGTH,
|
|
588
|
+
],
|
|
589
|
+
["snmpV3AuthKey", "v3 authentication key", MAX_SNMP_CONFIG_KEY_LENGTH],
|
|
590
|
+
["snmpV3PrivKey", "v3 privacy key", MAX_SNMP_CONFIG_KEY_LENGTH],
|
|
591
|
+
] as Array<[keyof DiscoveryScanSnmpConfig, string, number]>) {
|
|
592
|
+
const value: string | undefined = SnmpScanConfigUtil.readString(
|
|
593
|
+
config[key],
|
|
594
|
+
);
|
|
595
|
+
|
|
596
|
+
if (value !== undefined && value.length > maxLength) {
|
|
597
|
+
return (
|
|
598
|
+
`${position}: the ${label} cannot be longer than ${maxLength} ` +
|
|
599
|
+
`characters. This one is ${value.length}.`
|
|
600
|
+
);
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
const portError: string | null = SnmpScanConfigUtil.getPortValidationError(
|
|
605
|
+
config.snmpPort,
|
|
606
|
+
position,
|
|
607
|
+
);
|
|
608
|
+
|
|
609
|
+
if (portError) {
|
|
610
|
+
return portError;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
if (!SnmpVersionUtil.isV3(config.snmpVersion)) {
|
|
614
|
+
/*
|
|
615
|
+
* v1/v2c. The community string is NOT required here even though the
|
|
616
|
+
* device certainly needs one, because the probe falls back to "public"
|
|
617
|
+
* — which is a real, and very common, answer for discovery. Requiring it
|
|
618
|
+
* would refuse the single most useful default.
|
|
619
|
+
*/
|
|
620
|
+
return null;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
if (!SnmpScanConfigUtil.readString(config.snmpV3Username)) {
|
|
624
|
+
return `${position}: SNMP v3 needs a username (the security name configured on the device).`;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
if (SnmpSecurityLevelUtil.isUnrecognized(config.snmpV3SecurityLevel)) {
|
|
628
|
+
return (
|
|
629
|
+
`${position}: "${config.snmpV3SecurityLevel}" is not a recognized SNMP v3 security level. ` +
|
|
630
|
+
`Expected one of: ${Object.values(SnmpSecurityLevel).join(", ")}.`
|
|
631
|
+
);
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
if (SnmpAuthProtocolUtil.isUnrecognized(config.snmpV3AuthProtocol)) {
|
|
635
|
+
return (
|
|
636
|
+
`${position}: "${config.snmpV3AuthProtocol}" is not a recognized SNMP v3 authentication protocol. ` +
|
|
637
|
+
`Expected one of: ${Object.values(SnmpAuthProtocol).join(", ")}.`
|
|
638
|
+
);
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
if (SnmpPrivProtocolUtil.isUnrecognized(config.snmpV3PrivProtocol)) {
|
|
642
|
+
return (
|
|
643
|
+
`${position}: "${config.snmpV3PrivProtocol}" is not a recognized SNMP v3 privacy protocol. ` +
|
|
644
|
+
`Expected one of: ${Object.values(SnmpPrivProtocol).join(", ")}.`
|
|
645
|
+
);
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
const securityLevel: SnmpSecurityLevel | undefined =
|
|
649
|
+
SnmpSecurityLevelUtil.parse(config.snmpV3SecurityLevel);
|
|
650
|
+
|
|
651
|
+
/*
|
|
652
|
+
* A level that asks for authentication with nothing to authenticate with
|
|
653
|
+
* does not fail loudly — the session is simply rejected by every device,
|
|
654
|
+
* host after host, and the scan reports zero. Caught here so it is a
|
|
655
|
+
* sentence on the form instead.
|
|
656
|
+
*/
|
|
657
|
+
const needsAuth: boolean =
|
|
658
|
+
securityLevel === SnmpSecurityLevel.AuthNoPriv ||
|
|
659
|
+
securityLevel === SnmpSecurityLevel.AuthPriv;
|
|
660
|
+
|
|
661
|
+
if (needsAuth && !SnmpScanConfigUtil.readString(config.snmpV3AuthKey)) {
|
|
662
|
+
return `${position}: the "${securityLevel}" security level needs an authentication key.`;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
if (
|
|
666
|
+
securityLevel === SnmpSecurityLevel.AuthPriv &&
|
|
667
|
+
!SnmpScanConfigUtil.readString(config.snmpV3PrivKey)
|
|
668
|
+
) {
|
|
669
|
+
return `${position}: the "${SnmpSecurityLevel.AuthPriv}" security level needs a privacy key.`;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
return null;
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
/*
|
|
676
|
+
* The port rule, in the same words the single-config form used before this
|
|
677
|
+
* list existed (see validateSnmpPort in the Dashboard's SnmpConfigFormFields
|
|
678
|
+
* — that one still guards the NetworkDevice forms).
|
|
679
|
+
*
|
|
680
|
+
* Checked against the RAW value: a Number form field posts its contents as
|
|
681
|
+
* text, so "161.5" would parseInt to 161, clear both bounds, and then fail
|
|
682
|
+
* the write against a port the probe cannot dial.
|
|
683
|
+
*/
|
|
684
|
+
public static getPortValidationError(
|
|
685
|
+
raw: unknown,
|
|
686
|
+
position: string,
|
|
687
|
+
): string | null {
|
|
688
|
+
if (raw === undefined || raw === null || String(raw).trim() === "") {
|
|
689
|
+
return null;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
const port: number = Number(String(raw).trim());
|
|
693
|
+
|
|
694
|
+
if (!isFinite(port) || !Number.isInteger(port)) {
|
|
695
|
+
return `${position}: the SNMP port must be a whole number.`;
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
if (port < MINIMUM_SNMP_PORT || port > MAXIMUM_SNMP_PORT) {
|
|
699
|
+
return `${position}: the SNMP port must be between ${MINIMUM_SNMP_PORT} and ${MAXIMUM_SNMP_PORT}.`;
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
return null;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
/*
|
|
706
|
+
* The list as it should be stored: validated by the caller, then normalized
|
|
707
|
+
* and given ids.
|
|
708
|
+
*
|
|
709
|
+
* Returns null for an absent list, which is what the column holds for a scan
|
|
710
|
+
* configured the old way — so a write that never mentions `snmpConfigs`
|
|
711
|
+
* leaves it alone rather than materializing a list nobody asked for.
|
|
712
|
+
*/
|
|
713
|
+
public static normalizeForStorage(
|
|
714
|
+
value: unknown,
|
|
715
|
+
): Array<DiscoveryScanSnmpConfig> | null {
|
|
716
|
+
if (!Array.isArray(value) || value.length === 0) {
|
|
717
|
+
return null;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
return value.map(
|
|
721
|
+
(config: unknown, index: number): DiscoveryScanSnmpConfig => {
|
|
722
|
+
const normalized: DiscoveryScanSnmpConfig =
|
|
723
|
+
SnmpScanConfigUtil.normalizeConfig(
|
|
724
|
+
(config || {}) as DiscoveryScanSnmpConfig,
|
|
725
|
+
index,
|
|
726
|
+
);
|
|
727
|
+
|
|
728
|
+
/*
|
|
729
|
+
* Mint a real id for anything that arrived without one. The
|
|
730
|
+
* index-derived id `normalizeConfig` falls back to is fine for READING
|
|
731
|
+
* a row, but storing it would make the id positional — delete the
|
|
732
|
+
* first card and every id below it now names a different credential
|
|
733
|
+
* set, re-pointing results the probe has already stamped.
|
|
734
|
+
*/
|
|
735
|
+
if (
|
|
736
|
+
!SnmpScanConfigUtil.readString(
|
|
737
|
+
(config as DiscoveryScanSnmpConfig | undefined)?.id,
|
|
738
|
+
)
|
|
739
|
+
) {
|
|
740
|
+
normalized.id = ObjectID.generate().toString();
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
return normalized;
|
|
744
|
+
},
|
|
745
|
+
);
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
/*
|
|
749
|
+
* The flattened columns that should accompany a stored list, taken from its
|
|
750
|
+
* FIRST config.
|
|
751
|
+
*
|
|
752
|
+
* This mirroring is a compatibility guarantee, not redundancy. A probe is
|
|
753
|
+
* deployed separately from the server and is routinely a version behind; a
|
|
754
|
+
* probe that has never heard of `snmpConfigs` reads the flattened columns
|
|
755
|
+
* and nothing else. Without the mirror, saving a multi-config scan would
|
|
756
|
+
* blank the credentials of every older probe in the fleet — the scan would
|
|
757
|
+
* run with the column defaults (v2c/"public") and report a confident zero.
|
|
758
|
+
*
|
|
759
|
+
* The FIRST config specifically, because that is the one such a probe would
|
|
760
|
+
* have been given under the old single-config UI, and because the list is
|
|
761
|
+
* ordered by the operator's own preference.
|
|
762
|
+
*
|
|
763
|
+
* Every key is always present, with null for "unset": these values are also
|
|
764
|
+
* what the probe-claim endpoint compares its optimistic-concurrency
|
|
765
|
+
* `expectedData` against, and a key omitted for being empty would read as
|
|
766
|
+
* "unchanged" instead of "cleared".
|
|
767
|
+
*/
|
|
768
|
+
public static getMirroredLegacyColumns(
|
|
769
|
+
configs: Array<DiscoveryScanSnmpConfig>,
|
|
770
|
+
): Record<string, string | number | null> {
|
|
771
|
+
const first: DiscoveryScanSnmpConfig | undefined = configs[0];
|
|
772
|
+
|
|
773
|
+
return {
|
|
774
|
+
snmpVersion: SnmpScanConfigUtil.toStoredVersion(first?.snmpVersion),
|
|
775
|
+
snmpCommunityString: first?.snmpCommunityString ?? null,
|
|
776
|
+
snmpPort: first?.snmpPort ?? null,
|
|
777
|
+
snmpV3SecurityLevel: first?.snmpV3SecurityLevel ?? null,
|
|
778
|
+
snmpV3Username: first?.snmpV3Username ?? null,
|
|
779
|
+
snmpV3AuthProtocol: first?.snmpV3AuthProtocol ?? null,
|
|
780
|
+
snmpV3AuthKey: first?.snmpV3AuthKey ?? null,
|
|
781
|
+
snmpV3PrivProtocol: first?.snmpV3PrivProtocol ?? null,
|
|
782
|
+
snmpV3PrivKey: first?.snmpV3PrivKey ?? null,
|
|
783
|
+
};
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
/*
|
|
787
|
+
* A trimmed string, or undefined for anything that is not usable text.
|
|
788
|
+
* Values arrive straight from request JSON, so "not a string" is a real
|
|
789
|
+
* case rather than a defensive one.
|
|
790
|
+
*/
|
|
791
|
+
private static readString(value: unknown): string | undefined {
|
|
792
|
+
if (typeof value !== "string") {
|
|
793
|
+
return undefined;
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
const trimmed: string = value.trim();
|
|
797
|
+
|
|
798
|
+
return trimmed.length > 0 ? trimmed : undefined;
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
/*
|
|
802
|
+
* A usable port number, or undefined. Anything out of range is dropped
|
|
803
|
+
* rather than clamped, so the column default (161) applies — callers that
|
|
804
|
+
* want to REFUSE it call getPortValidationError first, exactly like
|
|
805
|
+
* ScanNameUtil.normalize/getValidationError.
|
|
806
|
+
*/
|
|
807
|
+
private static readPort(value: unknown): number | undefined {
|
|
808
|
+
if (value === undefined || value === null || String(value).trim() === "") {
|
|
809
|
+
return undefined;
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
const port: number = Number(String(value).trim());
|
|
813
|
+
|
|
814
|
+
if (
|
|
815
|
+
!isFinite(port) ||
|
|
816
|
+
!Number.isInteger(port) ||
|
|
817
|
+
port < MINIMUM_SNMP_PORT ||
|
|
818
|
+
port > MAXIMUM_SNMP_PORT
|
|
819
|
+
) {
|
|
820
|
+
return undefined;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
return port;
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
export default SnmpScanConfigUtil;
|