@oneuptime/common 14.0.94 → 14.0.96

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (289) hide show
  1. package/Models/AnalyticsModels/ExceptionInstance.d.mts +2 -0
  2. package/Models/AnalyticsModels/ExceptionInstance.d.ts +2 -0
  3. package/Models/AnalyticsModels/ExceptionInstance.js +7 -0
  4. package/Models/AnalyticsModels/Log.d.mts +2 -0
  5. package/Models/AnalyticsModels/Log.d.ts +2 -0
  6. package/Models/AnalyticsModels/Log.js +7 -0
  7. package/Models/AnalyticsModels/SecurityEvent.d.mts +8 -0
  8. package/Models/AnalyticsModels/SecurityEvent.d.ts +8 -0
  9. package/Models/AnalyticsModels/SecurityEvent.js +55 -0
  10. package/Models/AnalyticsModels/Span.d.mts +4 -0
  11. package/Models/AnalyticsModels/Span.d.ts +4 -0
  12. package/Models/AnalyticsModels/Span.js +63 -0
  13. package/Models/DatabaseModels/CustomNotificationChannel.d.mts +16 -0
  14. package/Models/DatabaseModels/CustomNotificationChannel.d.ts +16 -0
  15. package/Models/DatabaseModels/CustomNotificationChannel.js +337 -0
  16. package/Models/DatabaseModels/CustomNotificationChannel.mjs +2 -0
  17. package/Models/DatabaseModels/DashboardPlaylist.d.mts +16 -0
  18. package/Models/DatabaseModels/DashboardPlaylist.d.ts +16 -0
  19. package/Models/DatabaseModels/DashboardPlaylist.js +314 -0
  20. package/Models/DatabaseModels/DashboardPlaylist.mjs +2 -0
  21. package/Models/DatabaseModels/DatabaseBaseModel/DatabaseBaseModel.js +14 -37
  22. package/Models/DatabaseModels/DatabaseBaseModel/OnCallRuleBaseModel.d.mts +1 -0
  23. package/Models/DatabaseModels/DatabaseBaseModel/OnCallRuleBaseModel.d.ts +1 -0
  24. package/Models/DatabaseModels/DatabaseBaseModel/OnCallRuleBaseModel.js +27 -3
  25. package/Models/DatabaseModels/DetectionRuleException.d.mts +25 -0
  26. package/Models/DatabaseModels/DetectionRuleException.d.ts +25 -0
  27. package/Models/DatabaseModels/DetectionRuleException.js +412 -0
  28. package/Models/DatabaseModels/DetectionRuleException.mjs +2 -0
  29. package/Models/DatabaseModels/GlobalConfig.d.mts +5 -0
  30. package/Models/DatabaseModels/GlobalConfig.d.ts +5 -0
  31. package/Models/DatabaseModels/GlobalConfig.js +107 -0
  32. package/Models/DatabaseModels/Index.js +8 -0
  33. package/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.d.mts +2 -0
  34. package/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.d.ts +2 -0
  35. package/Models/DatabaseModels/OnCallDutyPolicyExecutionLog.js +40 -0
  36. package/Models/DatabaseModels/SecurityTelemetrySource.d.mts +21 -0
  37. package/Models/DatabaseModels/SecurityTelemetrySource.d.ts +21 -0
  38. package/Models/DatabaseModels/SecurityTelemetrySource.js +357 -0
  39. package/Models/DatabaseModels/SecurityTelemetrySource.mjs +2 -0
  40. package/Models/DatabaseModels/TeamComplianceSetting.js +2 -2
  41. package/Models/DatabaseModels/TeamPermission.js +5 -7
  42. package/Models/DatabaseModels/UserNotificationRule.d.mts +3 -0
  43. package/Models/DatabaseModels/UserNotificationRule.d.ts +3 -0
  44. package/Models/DatabaseModels/UserNotificationRule.js +67 -0
  45. package/Models/DatabaseModels/UserNotificationSetting.d.mts +1 -0
  46. package/Models/DatabaseModels/UserNotificationSetting.d.ts +1 -0
  47. package/Models/DatabaseModels/UserNotificationSetting.js +26 -0
  48. package/Models/DatabaseModels/UserOnCallLogTimeline.d.mts +3 -0
  49. package/Models/DatabaseModels/UserOnCallLogTimeline.d.ts +3 -0
  50. package/Models/DatabaseModels/UserOnCallLogTimeline.js +53 -0
  51. package/Types/AI/AIChatPermissionMode.js +11 -5
  52. package/Types/AI/ResourceCardFacts.d.mts +11 -0
  53. package/Types/AI/ResourceCardFacts.d.ts +11 -0
  54. package/Types/AI/ResourceCardFacts.js +80 -0
  55. package/Types/AI/ResourceCardFacts.mjs +4 -0
  56. package/Types/AnalyticsDatabase/TableColumn.d.mts +4 -0
  57. package/Types/AnalyticsDatabase/TableColumn.d.ts +4 -0
  58. package/Types/AnalyticsDatabase/TableColumn.js +7 -0
  59. package/Types/AuditLog/Export/AuditLogExportDestinationCatalog.d.mts +2 -0
  60. package/Types/AuditLog/Export/AuditLogExportDestinationCatalog.d.ts +2 -0
  61. package/Types/AuditLog/Export/AuditLogExportDestinationCatalog.js +4 -0
  62. package/Types/Backup/BackupDestinationCatalog.d.mts +2 -0
  63. package/Types/Backup/BackupDestinationCatalog.d.ts +2 -0
  64. package/Types/Backup/BackupDestinationCatalog.js +8 -0
  65. package/Types/CallAndSMS/CallAndSmsGatewayPayload.d.mts +25 -0
  66. package/Types/CallAndSMS/CallAndSmsGatewayPayload.d.ts +25 -0
  67. package/Types/CallAndSMS/CallAndSmsGatewayPayload.js +86 -0
  68. package/Types/CallAndSMS/CallAndSmsGatewayPayload.mjs +6 -0
  69. package/Types/CallAndSMS/CallAndSmsProvider.d.mts +23 -0
  70. package/Types/CallAndSMS/CallAndSmsProvider.d.ts +23 -0
  71. package/Types/CallAndSMS/CallAndSmsProvider.js +107 -0
  72. package/Types/CallAndSMS/CallAndSmsProvider.mjs +7 -0
  73. package/Types/CloudConnection/CloudConnectionCatalog.d.mts +2 -0
  74. package/Types/CloudConnection/CloudConnectionCatalog.d.ts +2 -0
  75. package/Types/CloudConnection/CloudConnectionCatalog.js +4 -0
  76. package/Types/CustomNotificationChannel/CustomNotificationChannelPayload.d.mts +95 -0
  77. package/Types/CustomNotificationChannel/CustomNotificationChannelPayload.d.ts +95 -0
  78. package/Types/CustomNotificationChannel/CustomNotificationChannelPayload.js +236 -0
  79. package/Types/CustomNotificationChannel/CustomNotificationChannelPayload.mjs +16 -0
  80. package/Types/Dashboard/DashboardPlaylist.d.mts +21 -0
  81. package/Types/Dashboard/DashboardPlaylist.d.ts +21 -0
  82. package/Types/Dashboard/DashboardPlaylist.js +197 -0
  83. package/Types/Dashboard/DashboardPlaylist.mjs +19 -0
  84. package/Types/Database/TableColumn.d.mts +8 -0
  85. package/Types/Database/TableColumn.d.ts +8 -0
  86. package/Types/Database/TableColumn.js +69 -23
  87. package/Types/Database/TableColumn.mjs +1 -0
  88. package/Types/HeldPermissions.d.mts +2 -0
  89. package/Types/HeldPermissions.d.ts +2 -0
  90. package/Types/HeldPermissions.js +32 -8
  91. package/Types/Icon/IconProp.d.mts +3 -0
  92. package/Types/Icon/IconProp.d.ts +3 -0
  93. package/Types/Icon/IconProp.js +4 -0
  94. package/Types/JSONFunctions.js +16 -1
  95. package/Types/LlmObservability/LlmConnectionCatalog.d.mts +2 -0
  96. package/Types/LlmObservability/LlmConnectionCatalog.d.ts +2 -0
  97. package/Types/LlmObservability/LlmConnectionCatalog.js +8 -0
  98. package/Types/Monitor/MonitorType.js +5 -4
  99. package/Types/Monitor/TelemetryAlertRule.d.mts +111 -0
  100. package/Types/Monitor/TelemetryAlertRule.d.ts +111 -0
  101. package/Types/Monitor/TelemetryAlertRule.js +886 -0
  102. package/Types/Monitor/TelemetryAlertRule.mjs +5 -0
  103. package/Types/Monitor/TelemetryRulePreview.d.mts +57 -0
  104. package/Types/Monitor/TelemetryRulePreview.d.ts +57 -0
  105. package/Types/Monitor/TelemetryRulePreview.js +190 -0
  106. package/Types/Monitor/TelemetryRulePreview.mjs +6 -0
  107. package/Types/OnCallDutyPolicy/EveryNewEventRules.d.mts +23 -0
  108. package/Types/OnCallDutyPolicy/EveryNewEventRules.d.ts +23 -0
  109. package/Types/OnCallDutyPolicy/EveryNewEventRules.js +105 -0
  110. package/Types/OnCallDutyPolicy/EveryNewEventRules.mjs +9 -0
  111. package/Types/OnCallDutyPolicy/OnCallDutyPolicyRunWait.d.mts +3 -0
  112. package/Types/OnCallDutyPolicy/OnCallDutyPolicyRunWait.d.ts +3 -0
  113. package/Types/OnCallDutyPolicy/OnCallDutyPolicyRunWait.js +23 -8
  114. package/Types/OnCallDutyPolicy/OnCallDutyPolicyRunWait.mjs +2 -0
  115. package/Types/OnCallDutyPolicy/OnCallPolicyAiHold.d.mts +47 -0
  116. package/Types/OnCallDutyPolicy/OnCallPolicyAiHold.d.ts +47 -0
  117. package/Types/OnCallDutyPolicy/OnCallPolicyAiHold.js +122 -0
  118. package/Types/OnCallDutyPolicy/OnCallPolicyAiHold.mjs +12 -0
  119. package/Types/OnCallDutyPolicy/OnCallRuleWhenToPage.d.mts +2 -1
  120. package/Types/OnCallDutyPolicy/OnCallRuleWhenToPage.d.ts +2 -1
  121. package/Types/OnCallDutyPolicy/OnCallRuleWhenToPage.js +10 -1
  122. package/Types/Permission.d.mts +10 -0
  123. package/Types/Permission.d.ts +10 -0
  124. package/Types/Permission.js +83 -19
  125. package/Types/ProviderLogo/ProviderLogo.d.mts +87 -0
  126. package/Types/ProviderLogo/ProviderLogo.d.ts +87 -0
  127. package/Types/ProviderLogo/ProviderLogo.js +215 -0
  128. package/Types/ProviderLogo/ProviderLogo.mjs +6 -0
  129. package/Types/PushNotification/PushNotificationsTurnedOff.d.mts +3 -0
  130. package/Types/PushNotification/PushNotificationsTurnedOff.d.ts +3 -0
  131. package/Types/PushNotification/PushNotificationsTurnedOff.js +32 -0
  132. package/Types/PushNotification/PushNotificationsTurnedOff.mjs +4 -0
  133. package/Types/RollingTime/RollingTimeUtil.js +20 -10
  134. package/Types/Runbook/RunbookTriggerType.d.mts +2 -1
  135. package/Types/Runbook/RunbookTriggerType.d.ts +2 -1
  136. package/Types/Runbook/RunbookTriggerType.js +5 -1
  137. package/Types/SecurityCase/SecurityCaseContext.d.mts +188 -0
  138. package/Types/SecurityCase/SecurityCaseContext.d.ts +188 -0
  139. package/Types/SecurityCase/SecurityCaseContext.js +165 -0
  140. package/Types/SecurityCase/SecurityCaseContext.mjs +30 -0
  141. package/Types/SecurityCase/SecurityEntityRisk.d.mts +11 -0
  142. package/Types/SecurityCase/SecurityEntityRisk.d.ts +11 -0
  143. package/Types/SecurityCase/SecurityEntityRisk.js +9 -1
  144. package/Types/SecurityCase/SecurityEntityRisk.mjs +1 -0
  145. package/Types/SecurityEvent/Connectors/SecurityEventConnectorCatalog.d.mts +2 -0
  146. package/Types/SecurityEvent/Connectors/SecurityEventConnectorCatalog.d.ts +2 -0
  147. package/Types/SecurityEvent/Connectors/SecurityEventConnectorCatalog.js +9 -0
  148. package/Types/SecurityEvent/Destinations/SecurityEventDestinationCatalog.d.mts +2 -0
  149. package/Types/SecurityEvent/Destinations/SecurityEventDestinationCatalog.d.ts +2 -0
  150. package/Types/SecurityEvent/Destinations/SecurityEventDestinationCatalog.js +5 -0
  151. package/Types/SecurityEvent/DetectionRetrohunt.d.mts +38 -0
  152. package/Types/SecurityEvent/DetectionRetrohunt.d.ts +38 -0
  153. package/Types/SecurityEvent/DetectionRetrohunt.js +147 -0
  154. package/Types/SecurityEvent/DetectionRetrohunt.mjs +10 -0
  155. package/Types/SecurityEvent/DetectionRuleDataKind.d.mts +5 -1
  156. package/Types/SecurityEvent/DetectionRuleDataKind.d.ts +5 -1
  157. package/Types/SecurityEvent/DetectionRuleDataKind.js +42 -0
  158. package/Types/SecurityEvent/DetectionRuleException.d.mts +65 -0
  159. package/Types/SecurityEvent/DetectionRuleException.d.ts +65 -0
  160. package/Types/SecurityEvent/DetectionRuleException.js +441 -0
  161. package/Types/SecurityEvent/DetectionRuleException.mjs +24 -0
  162. package/Types/SecurityEvent/DetectionRuleLibrary.js +330 -0
  163. package/Types/SecurityEvent/NormalizedSecurityEvent.d.mts +5 -0
  164. package/Types/SecurityEvent/NormalizedSecurityEvent.d.ts +5 -0
  165. package/Types/SecurityEvent/SecurityAttackCampaign.d.mts +31 -0
  166. package/Types/SecurityEvent/SecurityAttackCampaign.d.ts +31 -0
  167. package/Types/SecurityEvent/SecurityAttackCampaign.js +81 -0
  168. package/Types/SecurityEvent/SecurityAttackCampaign.mjs +8 -0
  169. package/Types/SecurityEvent/SecurityEventRequestOutcome.d.mts +28 -0
  170. package/Types/SecurityEvent/SecurityEventRequestOutcome.d.ts +28 -0
  171. package/Types/SecurityEvent/SecurityEventRequestOutcome.js +78 -0
  172. package/Types/SecurityEvent/SecurityEventRequestOutcome.mjs +6 -0
  173. package/Types/SecurityEvent/SecurityTelemetrySource.d.mts +39 -0
  174. package/Types/SecurityEvent/SecurityTelemetrySource.d.ts +39 -0
  175. package/Types/SecurityEvent/SecurityTelemetrySource.js +127 -0
  176. package/Types/SecurityEvent/SecurityTelemetrySource.mjs +12 -0
  177. package/Types/SecurityEvent/TurnOnRecommended.d.mts +2 -0
  178. package/Types/SecurityEvent/TurnOnRecommended.d.ts +2 -0
  179. package/Types/SecurityEvent/TurnOnRecommended.js +7 -0
  180. package/Types/SecurityPlaybook/SecurityPlaybookAction.d.mts +7 -1
  181. package/Types/SecurityPlaybook/SecurityPlaybookAction.d.ts +7 -1
  182. package/Types/SecurityPlaybook/SecurityPlaybookAction.js +46 -0
  183. package/Types/SecurityPlaybook/SecurityPlaybookAction.mjs +1 -0
  184. package/Types/SecurityPlaybook/SecurityPlaybookStep.d.mts +10 -0
  185. package/Types/SecurityPlaybook/SecurityPlaybookStep.d.ts +10 -0
  186. package/Types/SecurityPlaybook/SecurityPlaybookStep.js +37 -1
  187. package/Types/SecurityPlaybook/SecurityPlaybookStep.mjs +1 -0
  188. package/Types/SecurityPlaybook/SecurityPlaybookTemplates.js +17 -0
  189. package/Types/Team/ComplianceNotificationChannel.d.mts +2 -1
  190. package/Types/Team/ComplianceNotificationChannel.d.ts +2 -1
  191. package/Types/Team/ComplianceNotificationChannel.js +10 -1
  192. package/Types/Team/ComplianceRule.d.mts +8 -3
  193. package/Types/Team/ComplianceRule.d.ts +8 -3
  194. package/Types/Team/ComplianceRule.js +34 -22
  195. package/Types/Team/TeamComplianceStatus.d.mts +1 -0
  196. package/Types/Team/TeamComplianceStatus.d.ts +1 -0
  197. package/Types/Telemetry/OpenTelemetryGuides.d.mts +52 -0
  198. package/Types/Telemetry/OpenTelemetryGuides.d.ts +52 -0
  199. package/Types/Telemetry/OpenTelemetryGuides.js +419 -0
  200. package/Types/Telemetry/OpenTelemetryGuides.mjs +17 -0
  201. package/Types/Telemetry/TelemetrySavedViewState.d.mts +1 -0
  202. package/Types/Telemetry/TelemetrySavedViewState.d.ts +1 -0
  203. package/Types/Telemetry/TraceHealth.d.mts +24 -0
  204. package/Types/Telemetry/TraceHealth.d.ts +24 -0
  205. package/Types/Telemetry/TraceHealth.js +97 -0
  206. package/Types/Telemetry/TraceHealth.mjs +4 -0
  207. package/Types/Telemetry/TraceSpanType.d.mts +90 -0
  208. package/Types/Telemetry/TraceSpanType.d.ts +90 -0
  209. package/Types/Telemetry/TraceSpanType.js +238 -0
  210. package/Types/Telemetry/TraceSpanType.mjs +19 -0
  211. package/Types/Theme/ThemePreference.d.mts +26 -0
  212. package/Types/Theme/ThemePreference.d.ts +26 -0
  213. package/Types/Theme/ThemePreference.js +104 -0
  214. package/Types/Theme/ThemePreference.mjs +12 -0
  215. package/Types/Workflow/Component.d.mts +3 -0
  216. package/Types/Workflow/Component.d.ts +3 -0
  217. package/Types/Workflow/Components/Discord.js +2 -0
  218. package/Types/Workflow/Components/Mattermost.js +2 -0
  219. package/Types/Workflow/Components/MicrosoftTeams.js +2 -0
  220. package/Types/Workflow/Components/Slack.js +2 -0
  221. package/Types/Workflow/Components/Telegram.js +2 -0
  222. package/Types/Workflow/Components.js +6 -0
  223. package/Types/Workflow/Templates.js +5 -3
  224. package/Utils/ColorContrast.d.mts +0 -3
  225. package/Utils/ColorContrast.d.ts +0 -3
  226. package/Utils/ColorContrast.js +3 -41
  227. package/Utils/ColorContrast.mjs +0 -2
  228. package/Utils/NameInitials.d.mts +5 -0
  229. package/Utils/NameInitials.d.ts +5 -0
  230. package/Utils/NameInitials.js +92 -0
  231. package/Utils/NameInitials.mjs +6 -0
  232. package/Utils/OldestKeyCursor.d.mts +7 -0
  233. package/Utils/OldestKeyCursor.d.ts +7 -0
  234. package/Utils/OldestKeyCursor.js +68 -0
  235. package/Utils/OldestKeyCursor.mjs +2 -0
  236. package/Utils/Schema/OpenApiMetadataRegistry.d.mts +4 -0
  237. package/Utils/Schema/OpenApiMetadataRegistry.d.ts +4 -0
  238. package/Utils/Schema/OpenApiMetadataRegistry.js +20 -0
  239. package/Utils/Schema/OpenApiMetadataRegistry.mjs +2 -0
  240. package/Utils/Schema/Zod.js +6 -0
  241. package/Utils/SecurityCase/SecurityCaseImpactFacts.d.mts +41 -0
  242. package/Utils/SecurityCase/SecurityCaseImpactFacts.d.ts +41 -0
  243. package/Utils/SecurityCase/SecurityCaseImpactFacts.js +215 -0
  244. package/Utils/SecurityCase/SecurityCaseImpactFacts.mjs +6 -0
  245. package/Utils/SecurityCase/SecurityCaseStoryItems.d.mts +46 -0
  246. package/Utils/SecurityCase/SecurityCaseStoryItems.d.ts +46 -0
  247. package/Utils/SecurityCase/SecurityCaseStoryItems.js +327 -0
  248. package/Utils/SecurityCase/SecurityCaseStoryItems.mjs +17 -0
  249. package/Utils/SecurityEvent/LogParsers/SecurityLogLine.d.mts +5 -0
  250. package/Utils/SecurityEvent/LogParsers/SecurityLogLine.d.ts +5 -0
  251. package/Utils/SecurityEvent/LogParsers/SecurityLogLine.js +22 -2
  252. package/Utils/SecurityEvent/LogParsers/SecurityLogLine.mjs +2 -0
  253. package/Utils/SecurityEvent/LogParsers/WebAttackLogParser.d.mts +20 -0
  254. package/Utils/SecurityEvent/LogParsers/WebAttackLogParser.d.ts +20 -0
  255. package/Utils/SecurityEvent/LogParsers/WebAttackLogParser.js +347 -31
  256. package/Utils/SecurityEvent/LogParsers/WebAttackLogParser.mjs +11 -0
  257. package/Utils/SecurityEvent/RequestFollowUp.d.mts +4 -0
  258. package/Utils/SecurityEvent/RequestFollowUp.d.ts +4 -0
  259. package/Utils/SecurityEvent/RequestFollowUp.js +127 -0
  260. package/Utils/SecurityEvent/RequestFollowUp.mjs +3 -0
  261. package/Utils/SecurityEvent/RequestOutcome.d.mts +80 -0
  262. package/Utils/SecurityEvent/RequestOutcome.d.ts +80 -0
  263. package/Utils/SecurityEvent/RequestOutcome.js +371 -0
  264. package/Utils/SecurityEvent/RequestOutcome.mjs +18 -0
  265. package/Utils/SecurityEvent/TelemetryScan/AuditLogSignals.d.mts +76 -0
  266. package/Utils/SecurityEvent/TelemetryScan/AuditLogSignals.d.ts +76 -0
  267. package/Utils/SecurityEvent/TelemetryScan/AuditLogSignals.js +348 -0
  268. package/Utils/SecurityEvent/TelemetryScan/AuditLogSignals.mjs +15 -0
  269. package/Utils/SecurityEvent/TelemetryScan/FlowSignals.d.mts +61 -0
  270. package/Utils/SecurityEvent/TelemetryScan/FlowSignals.d.ts +61 -0
  271. package/Utils/SecurityEvent/TelemetryScan/FlowSignals.js +260 -0
  272. package/Utils/SecurityEvent/TelemetryScan/FlowSignals.mjs +17 -0
  273. package/Utils/SecurityEvent/TelemetryScan/RumSignals.d.mts +30 -0
  274. package/Utils/SecurityEvent/TelemetryScan/RumSignals.d.ts +30 -0
  275. package/Utils/SecurityEvent/TelemetryScan/RumSignals.js +134 -0
  276. package/Utils/SecurityEvent/TelemetryScan/RumSignals.mjs +8 -0
  277. package/Utils/SecurityEvent/TelemetryScan/TelemetrySecurityEvent.d.mts +40 -0
  278. package/Utils/SecurityEvent/TelemetryScan/TelemetrySecurityEvent.d.ts +40 -0
  279. package/Utils/SecurityEvent/TelemetryScan/TelemetrySecurityEvent.js +190 -0
  280. package/Utils/SecurityEvent/TelemetryScan/TelemetrySecurityEvent.mjs +6 -0
  281. package/Utils/SecurityEvent/TelemetryScan/TraceSignals.d.mts +57 -0
  282. package/Utils/SecurityEvent/TelemetryScan/TraceSignals.d.ts +57 -0
  283. package/Utils/SecurityEvent/TelemetryScan/TraceSignals.js +491 -0
  284. package/Utils/SecurityEvent/TelemetryScan/TraceSignals.mjs +27 -0
  285. package/Utils/Telemetry/EntrySpan.d.mts +8 -0
  286. package/Utils/Telemetry/EntrySpan.d.ts +8 -0
  287. package/Utils/Telemetry/EntrySpan.js +53 -0
  288. package/Utils/Telemetry/EntrySpan.mjs +4 -0
  289. package/package.json +1 -1
@@ -0,0 +1,260 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.FLOW_ATTRIBUTES = exports.MAX_FLOW_ROWS_PER_SIGNAL = exports.LARGE_TRANSFER_MIN_BYTES = exports.SWEEP_IGNORED_PORTS = exports.NETWORK_SWEEP_MIN_HOSTS = exports.PORT_SCAN_MIN_PORTS = exports.EPHEMERAL_PORT_START = exports.NETWORK_ACTIVITY_CLASS_UID = void 0;
7
+ exports.getProtocolName = getProtocolName;
8
+ exports.formatBytes = formatBytes;
9
+ exports.buildPortScanEvent = buildPortScanEvent;
10
+ exports.buildNetworkSweepEvent = buildNetworkSweepEvent;
11
+ exports.isOutboundPair = isOutboundPair;
12
+ exports.buildLargeTransferEvent = buildLargeTransferEvent;
13
+ exports.buildThreatIntelTrafficEvent = buildThreatIntelTrafficEvent;
14
+ exports.selectThreatIntelCandidates = selectThreatIntelCandidates;
15
+ const OcsfSeverity_1 = __importDefault(require("../../../Types/SecurityEvent/OcsfSeverity"));
16
+ const SecurityTelemetrySource_1 = require("../../../Types/SecurityEvent/SecurityTelemetrySource");
17
+ const SecurityConnectionMatch_1 = require("../../SecurityCase/SecurityConnectionMatch");
18
+ const TelemetrySecurityEvent_1 = require("./TelemetrySecurityEvent");
19
+ /*
20
+ * WHAT NETWORK FLOWS SAY ABOUT AN ATTACK - read from the NetFlow, IPFIX and
21
+ * sFlow records the project's devices export to OneUptime, a window of
22
+ * arrivals at a time (Server/Utils/SecurityEvent/TelemetryScan/
23
+ * FlowSecurityScan.ts):
24
+ *
25
+ * port scan one address reaching many ports of one host;
26
+ * network sweep one address reaching one port on many hosts;
27
+ * threat intel traffic with an address a threat-intel feed knows;
28
+ * large transfer a private address sending a lot to a public one.
29
+ *
30
+ * Flows are many and every one is ordinary, so none becomes an event by
31
+ * itself: each is one row the database already summed, per address (or
32
+ * pair) per window. The thresholds are where ordinary traffic stops: return
33
+ * traffic to a client lands on its ephemeral ports, so a port scan counts
34
+ * only ports below EPHEMERAL_PORT_START; a resolver or a browser behind NAT
35
+ * reaches many hosts on the same few ports, so a sweep ignores them.
36
+ *
37
+ * Pure: the scan hands it the rows it read.
38
+ */
39
+ exports.NETWORK_ACTIVITY_CLASS_UID = 4001;
40
+ // Ports at and above this are clients' own, where answers to them land.
41
+ exports.EPHEMERAL_PORT_START = 32768;
42
+ // Distinct ports below EPHEMERAL_PORT_START, of one host, in one window.
43
+ exports.PORT_SCAN_MIN_PORTS = 25;
44
+ // Distinct hosts on one port, in one window.
45
+ exports.NETWORK_SWEEP_MIN_HOSTS = 30;
46
+ /*
47
+ * Ports a sweep never counts: what clients reach many hosts on every day
48
+ * (DNS, HTTP, NTP, HTTPS, QUIC).
49
+ */
50
+ exports.SWEEP_IGNORED_PORTS = [53, 80, 123, 443];
51
+ // Bytes from one private address to one public address, in one window.
52
+ exports.LARGE_TRANSFER_MIN_BYTES = 1024 * 1024 * 1024;
53
+ // The most rows of each kind one window turns into events.
54
+ exports.MAX_FLOW_ROWS_PER_SIGNAL = 50;
55
+ exports.FLOW_ATTRIBUTES = {
56
+ bytes: "network.bytes",
57
+ packets: "network.packets",
58
+ flows: "network.flows",
59
+ protocol: "network.transport",
60
+ distinctPorts: "network.distinct_ports",
61
+ samplePorts: "network.sample_ports",
62
+ distinctHosts: "network.distinct_hosts",
63
+ sampleHosts: "network.sample_hosts",
64
+ deviceId: "oneuptime.network_device.id",
65
+ windowStart: "oneuptime.window.start",
66
+ windowEnd: "oneuptime.window.end",
67
+ indicator: "oneuptime.threat_intel.address",
68
+ };
69
+ // IANA protocol numbers flows record, by name.
70
+ function getProtocolName(protocol) {
71
+ switch (protocol) {
72
+ case 1:
73
+ return "icmp";
74
+ case 6:
75
+ return "tcp";
76
+ case 17:
77
+ return "udp";
78
+ case 58:
79
+ return "ipv6-icmp";
80
+ default:
81
+ return protocol > 0 ? String(protocol) : "";
82
+ }
83
+ }
84
+ const BYTE_UNITS = ["B", "KB", "MB", "GB", "TB"];
85
+ // 1288490188 -> "1.2 GB": how a message says an amount of data.
86
+ function formatBytes(bytes) {
87
+ let value = Math.max(0, bytes || 0);
88
+ let unit = 0;
89
+ while (value >= 1024 && unit < BYTE_UNITS.length - 1) {
90
+ value = value / 1024;
91
+ unit++;
92
+ }
93
+ const rounded = unit === 0 || value >= 100 ? String(Math.round(value)) : value.toFixed(1);
94
+ return `${rounded} ${BYTE_UNITS[unit]}`;
95
+ }
96
+ function windowAttributes(window, row) {
97
+ const attributes = {
98
+ [exports.FLOW_ATTRIBUTES.bytes]: String(Math.round(row.bytes)),
99
+ [exports.FLOW_ATTRIBUTES.packets]: String(Math.round(row.packets)),
100
+ [exports.FLOW_ATTRIBUTES.flows]: String(Math.round(row.flows)),
101
+ [exports.FLOW_ATTRIBUTES.windowStart]: window.from.toISOString(),
102
+ [exports.FLOW_ATTRIBUTES.windowEnd]: window.to.toISOString(),
103
+ };
104
+ if (row.deviceId) {
105
+ attributes[exports.FLOW_ATTRIBUTES.deviceId] = row.deviceId;
106
+ }
107
+ return attributes;
108
+ }
109
+ function windowKey(window) {
110
+ return window.from.toISOString();
111
+ }
112
+ function eventTime(row, window) {
113
+ return row.firstSeen && !Number.isNaN(row.firstSeen.getTime())
114
+ ? row.firstSeen
115
+ : window.from;
116
+ }
117
+ function buildPortScanEvent(row, window) {
118
+ if (row.ports < exports.PORT_SCAN_MIN_PORTS || !row.srcIp || !row.dstIp) {
119
+ return null;
120
+ }
121
+ const sample = [...row.samplePorts]
122
+ .filter((port) => {
123
+ return port > 0;
124
+ })
125
+ .sort((a, b) => {
126
+ return a - b;
127
+ })
128
+ .slice(0, 10);
129
+ return (0, TelemetrySecurityEvent_1.buildTelemetrySecurityEvent)({
130
+ kind: SecurityTelemetrySource_1.SecurityTelemetrySourceKind.NetworkFlows,
131
+ signal: SecurityTelemetrySource_1.SecurityTelemetrySignal.PortScan,
132
+ time: eventTime(row, window),
133
+ eventUid: `flow:${SecurityTelemetrySource_1.SecurityTelemetrySignal.PortScan}:${row.srcIp}:${row.dstIp}:${windowKey(window)}`,
134
+ classUid: exports.NETWORK_ACTIVITY_CLASS_UID,
135
+ activityName: "Traffic",
136
+ statusName: "",
137
+ severity: OcsfSeverity_1.default.Medium,
138
+ message: `Port scan: ${row.srcIp} reached ${row.ports} ports on ${row.dstIp}`,
139
+ principalIp: row.srcIp,
140
+ targetIp: row.dstIp,
141
+ attributes: Object.assign(Object.assign({}, windowAttributes(window, row)), { [exports.FLOW_ATTRIBUTES.distinctPorts]: String(row.ports), [exports.FLOW_ATTRIBUTES.samplePorts]: sample.join(",") }),
142
+ });
143
+ }
144
+ function buildNetworkSweepEvent(row, window) {
145
+ if (row.hosts < exports.NETWORK_SWEEP_MIN_HOSTS ||
146
+ !row.srcIp ||
147
+ exports.SWEEP_IGNORED_PORTS.includes(row.dstPort)) {
148
+ return null;
149
+ }
150
+ const sample = [...row.sampleHosts]
151
+ .filter(Boolean)
152
+ .sort()
153
+ .slice(0, 10);
154
+ return (0, TelemetrySecurityEvent_1.buildTelemetrySecurityEvent)({
155
+ kind: SecurityTelemetrySource_1.SecurityTelemetrySourceKind.NetworkFlows,
156
+ signal: SecurityTelemetrySource_1.SecurityTelemetrySignal.NetworkSweep,
157
+ time: eventTime(row, window),
158
+ eventUid: `flow:${SecurityTelemetrySource_1.SecurityTelemetrySignal.NetworkSweep}:${row.srcIp}:${row.dstPort}:${windowKey(window)}`,
159
+ classUid: exports.NETWORK_ACTIVITY_CLASS_UID,
160
+ activityName: "Traffic",
161
+ statusName: "",
162
+ severity: OcsfSeverity_1.default.Medium,
163
+ message: `Network sweep: ${row.srcIp} reached port ${row.dstPort} on ${row.hosts} hosts`,
164
+ principalIp: row.srcIp,
165
+ targetPort: row.dstPort,
166
+ attributes: Object.assign(Object.assign({}, windowAttributes(window, row)), { [exports.FLOW_ATTRIBUTES.distinctHosts]: String(row.hosts), [exports.FLOW_ATTRIBUTES.sampleHosts]: sample.join(",") }),
167
+ });
168
+ }
169
+ /*
170
+ * A private address sending a lot to a public one: the direction data
171
+ * leaves a network in. Any other pair - two public addresses, data coming
172
+ * in - is not this.
173
+ */
174
+ function isOutboundPair(srcIp, dstIp) {
175
+ return ((0, SecurityConnectionMatch_1.getSecurityAddressScope)(srcIp) === SecurityConnectionMatch_1.SecurityAddressScope.Private &&
176
+ (0, SecurityConnectionMatch_1.getSecurityAddressScope)(dstIp) === SecurityConnectionMatch_1.SecurityAddressScope.Public);
177
+ }
178
+ function buildLargeTransferEvent(row, window) {
179
+ if (row.bytes < exports.LARGE_TRANSFER_MIN_BYTES ||
180
+ !isOutboundPair(row.srcIp, row.dstIp)) {
181
+ return null;
182
+ }
183
+ const protocol = getProtocolName(row.protocol);
184
+ const attributes = windowAttributes(window, row);
185
+ if (protocol) {
186
+ attributes[exports.FLOW_ATTRIBUTES.protocol] = protocol;
187
+ }
188
+ return (0, TelemetrySecurityEvent_1.buildTelemetrySecurityEvent)({
189
+ kind: SecurityTelemetrySource_1.SecurityTelemetrySourceKind.NetworkFlows,
190
+ signal: SecurityTelemetrySource_1.SecurityTelemetrySignal.LargeOutboundTransfer,
191
+ time: eventTime(row, window),
192
+ eventUid: `flow:${SecurityTelemetrySource_1.SecurityTelemetrySignal.LargeOutboundTransfer}:${row.srcIp}:${row.dstIp}:${windowKey(window)}`,
193
+ classUid: exports.NETWORK_ACTIVITY_CLASS_UID,
194
+ activityName: "Traffic",
195
+ statusName: "",
196
+ severity: OcsfSeverity_1.default.Low,
197
+ message: `Large transfer out: ${row.srcIp} sent ${formatBytes(row.bytes)} to ${row.dstIp}${row.dstPort ? ` on port ${row.dstPort}` : ""}`,
198
+ principalIp: row.srcIp,
199
+ targetIp: row.dstIp,
200
+ targetPort: row.dstPort,
201
+ attributes,
202
+ });
203
+ }
204
+ /*
205
+ * Traffic with an address a threat-intel feed knows. The feed's own facts
206
+ * are stamped by the enrichment every stored event goes through
207
+ * (ThreatIntelEnricher); this says which side it was.
208
+ */
209
+ function buildThreatIntelTrafficEvent(row, window, knownAddress) {
210
+ if (!knownAddress ||
211
+ (row.srcIp !== knownAddress && row.dstIp !== knownAddress)) {
212
+ return null;
213
+ }
214
+ const inbound = row.srcIp === knownAddress;
215
+ const protocol = getProtocolName(row.protocol);
216
+ const attributes = Object.assign(Object.assign({}, windowAttributes(window, row)), { [exports.FLOW_ATTRIBUTES.indicator]: knownAddress });
217
+ if (protocol) {
218
+ attributes[exports.FLOW_ATTRIBUTES.protocol] = protocol;
219
+ }
220
+ return (0, TelemetrySecurityEvent_1.buildTelemetrySecurityEvent)({
221
+ kind: SecurityTelemetrySource_1.SecurityTelemetrySourceKind.NetworkFlows,
222
+ signal: SecurityTelemetrySource_1.SecurityTelemetrySignal.ThreatIntelTraffic,
223
+ time: eventTime(row, window),
224
+ eventUid: `flow:${SecurityTelemetrySource_1.SecurityTelemetrySignal.ThreatIntelTraffic}:${row.srcIp}:${row.dstIp}:${row.dstPort}:${windowKey(window)}`,
225
+ classUid: exports.NETWORK_ACTIVITY_CLASS_UID,
226
+ activityName: "Traffic",
227
+ statusName: "",
228
+ severity: OcsfSeverity_1.default.High,
229
+ message: inbound
230
+ ? `Traffic from a known-bad address: ${row.srcIp} → ${row.dstIp}${row.dstPort ? `:${row.dstPort}` : ""} (${formatBytes(row.bytes)})`
231
+ : `Traffic to a known-bad address: ${row.srcIp} → ${row.dstIp}${row.dstPort ? `:${row.dstPort}` : ""} (${formatBytes(row.bytes)})`,
232
+ principalIp: row.srcIp,
233
+ targetIp: row.dstIp,
234
+ targetPort: row.dstPort,
235
+ attributes,
236
+ });
237
+ }
238
+ /*
239
+ * The addresses of a window worth asking threat intel about: public ones
240
+ * only - a feed never lists a private address, and asking about them would
241
+ * spend the lookup on addresses no feed can know.
242
+ */
243
+ function selectThreatIntelCandidates(addresses, limit) {
244
+ const candidates = [];
245
+ const seen = new Set();
246
+ for (const address of addresses) {
247
+ const value = (address || "").trim();
248
+ if (!value ||
249
+ seen.has(value) ||
250
+ (0, SecurityConnectionMatch_1.getSecurityAddressScope)(value) !== SecurityConnectionMatch_1.SecurityAddressScope.Public) {
251
+ continue;
252
+ }
253
+ seen.add(value);
254
+ candidates.push(value);
255
+ if (candidates.length >= limit) {
256
+ break;
257
+ }
258
+ }
259
+ return candidates;
260
+ }
@@ -0,0 +1,17 @@
1
+ import commonJsModule from "./FlowSignals.js";
2
+ export const EPHEMERAL_PORT_START = commonJsModule.EPHEMERAL_PORT_START;
3
+ export const FLOW_ATTRIBUTES = commonJsModule.FLOW_ATTRIBUTES;
4
+ export const LARGE_TRANSFER_MIN_BYTES = commonJsModule.LARGE_TRANSFER_MIN_BYTES;
5
+ export const MAX_FLOW_ROWS_PER_SIGNAL = commonJsModule.MAX_FLOW_ROWS_PER_SIGNAL;
6
+ export const NETWORK_ACTIVITY_CLASS_UID = commonJsModule.NETWORK_ACTIVITY_CLASS_UID;
7
+ export const NETWORK_SWEEP_MIN_HOSTS = commonJsModule.NETWORK_SWEEP_MIN_HOSTS;
8
+ export const PORT_SCAN_MIN_PORTS = commonJsModule.PORT_SCAN_MIN_PORTS;
9
+ export const SWEEP_IGNORED_PORTS = commonJsModule.SWEEP_IGNORED_PORTS;
10
+ export const buildLargeTransferEvent = commonJsModule.buildLargeTransferEvent;
11
+ export const buildNetworkSweepEvent = commonJsModule.buildNetworkSweepEvent;
12
+ export const buildPortScanEvent = commonJsModule.buildPortScanEvent;
13
+ export const buildThreatIntelTrafficEvent = commonJsModule.buildThreatIntelTrafficEvent;
14
+ export const formatBytes = commonJsModule.formatBytes;
15
+ export const getProtocolName = commonJsModule.getProtocolName;
16
+ export const isOutboundPair = commonJsModule.isOutboundPair;
17
+ export const selectThreatIntelCandidates = commonJsModule.selectThreatIntelCandidates;
@@ -0,0 +1,30 @@
1
+ import NormalizedSecurityEvent from "../../../Types/SecurityEvent/NormalizedSecurityEvent.mjs";
2
+ export declare const AUTHENTICATION_CLASS_UID: number;
3
+ export declare const RUM_COUNTRY_WINDOW_IN_MINUTES: number;
4
+ export declare const MAX_RUM_SESSIONS_LISTED: number;
5
+ export declare const RUM_ATTRIBUTES: {
6
+ userKey: string;
7
+ countries: string;
8
+ sessionIds: string;
9
+ applicationId: string;
10
+ browsers: string;
11
+ };
12
+ export interface RumScanSession {
13
+ sessionId: string;
14
+ rumApplicationId: string;
15
+ countryCode: string;
16
+ startTime: Date;
17
+ browserName: string;
18
+ osName: string;
19
+ }
20
+ export interface RumUserCountriesRow {
21
+ userKey: string;
22
+ sessions: Array<RumScanSession>;
23
+ }
24
+ export declare function readCountries(sessions: Array<RumScanSession>): Array<string>;
25
+ export declare function findClosestCountryChange(sessions: Array<RumScanSession>): {
26
+ from: RumScanSession;
27
+ to: RumScanSession;
28
+ minutes: number;
29
+ } | null;
30
+ export declare function buildUserInTwoCountriesEvent(row: RumUserCountriesRow): NormalizedSecurityEvent | null;
@@ -0,0 +1,30 @@
1
+ import NormalizedSecurityEvent from "../../../Types/SecurityEvent/NormalizedSecurityEvent";
2
+ export declare const AUTHENTICATION_CLASS_UID: number;
3
+ export declare const RUM_COUNTRY_WINDOW_IN_MINUTES: number;
4
+ export declare const MAX_RUM_SESSIONS_LISTED: number;
5
+ export declare const RUM_ATTRIBUTES: {
6
+ userKey: string;
7
+ countries: string;
8
+ sessionIds: string;
9
+ applicationId: string;
10
+ browsers: string;
11
+ };
12
+ export interface RumScanSession {
13
+ sessionId: string;
14
+ rumApplicationId: string;
15
+ countryCode: string;
16
+ startTime: Date;
17
+ browserName: string;
18
+ osName: string;
19
+ }
20
+ export interface RumUserCountriesRow {
21
+ userKey: string;
22
+ sessions: Array<RumScanSession>;
23
+ }
24
+ export declare function readCountries(sessions: Array<RumScanSession>): Array<string>;
25
+ export declare function findClosestCountryChange(sessions: Array<RumScanSession>): {
26
+ from: RumScanSession;
27
+ to: RumScanSession;
28
+ minutes: number;
29
+ } | null;
30
+ export declare function buildUserInTwoCountriesEvent(row: RumUserCountriesRow): NormalizedSecurityEvent | null;
@@ -0,0 +1,134 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.RUM_ATTRIBUTES = exports.MAX_RUM_SESSIONS_LISTED = exports.RUM_COUNTRY_WINDOW_IN_MINUTES = exports.AUTHENTICATION_CLASS_UID = void 0;
7
+ exports.readCountries = readCountries;
8
+ exports.findClosestCountryChange = findClosestCountryChange;
9
+ exports.buildUserInTwoCountriesEvent = buildUserInTwoCountriesEvent;
10
+ const OcsfSeverity_1 = __importDefault(require("../../../Types/SecurityEvent/OcsfSeverity"));
11
+ const SecurityTelemetrySource_1 = require("../../../Types/SecurityEvent/SecurityTelemetrySource");
12
+ const TelemetrySecurityEvent_1 = require("./TelemetrySecurityEvent");
13
+ /*
14
+ * WHAT SESSION REPLAYS SAY ABOUT AN ATTACK: one signed-in user using the
15
+ * app from two or more countries within RUM_COUNTRY_WINDOW_IN_MINUTES -
16
+ * nobody travels that fast, so somebody else has their session or their
17
+ * password (Server/Utils/SecurityEvent/TelemetryScan/RumSecurityScan.ts).
18
+ *
19
+ * The user is named by the session replay's identity key, a keyed hash of
20
+ * what the app identified them by, never by their name or email: those
21
+ * stay behind Session Replay's own identity permission, and the event links
22
+ * to the sessions, where somebody allowed to can see who it was. The event's
23
+ * session is the latest of them, so the event opens on it.
24
+ *
25
+ * Pure: the scan hands it the rows it read.
26
+ */
27
+ exports.AUTHENTICATION_CLASS_UID = 3002;
28
+ // How close together two sessions in different countries must start.
29
+ exports.RUM_COUNTRY_WINDOW_IN_MINUTES = 60;
30
+ // The most sessions an event lists.
31
+ exports.MAX_RUM_SESSIONS_LISTED = 10;
32
+ exports.RUM_ATTRIBUTES = {
33
+ userKey: "rum.identified_user_key",
34
+ countries: "rum.countries",
35
+ sessionIds: "rum.session_ids",
36
+ applicationId: "rum.application_id",
37
+ browsers: "rum.browsers",
38
+ };
39
+ // Two-letter country codes, upper-cased, each once, in order.
40
+ function readCountries(sessions) {
41
+ const countries = new Set();
42
+ for (const session of sessions) {
43
+ const code = (session.countryCode || "").trim().toUpperCase();
44
+ if (code.length === 2) {
45
+ countries.add(code);
46
+ }
47
+ }
48
+ return Array.from(countries).sort();
49
+ }
50
+ /*
51
+ * The sessions in different countries that started closest together, or
52
+ * null when no two did within the window: what makes it impossible travel
53
+ * rather than two trips.
54
+ */
55
+ function findClosestCountryChange(sessions) {
56
+ const ordered = sessions
57
+ .filter((session) => {
58
+ return ((session.countryCode || "").trim().length === 2 &&
59
+ !Number.isNaN(session.startTime.getTime()));
60
+ })
61
+ .sort((a, b) => {
62
+ return a.startTime.getTime() - b.startTime.getTime();
63
+ });
64
+ let closest = null;
65
+ for (let index = 1; index < ordered.length; index++) {
66
+ const previous = ordered[index - 1];
67
+ const current = ordered[index];
68
+ if (previous.countryCode.trim().toUpperCase() ===
69
+ current.countryCode.trim().toUpperCase()) {
70
+ continue;
71
+ }
72
+ const minutes = (current.startTime.getTime() - previous.startTime.getTime()) / 60000;
73
+ if (minutes <= exports.RUM_COUNTRY_WINDOW_IN_MINUTES &&
74
+ (!closest || minutes < closest.minutes)) {
75
+ closest = { from: previous, to: current, minutes };
76
+ }
77
+ }
78
+ return closest;
79
+ }
80
+ function buildUserInTwoCountriesEvent(row) {
81
+ const userKey = (row.userKey || "").trim();
82
+ if (!userKey) {
83
+ return null;
84
+ }
85
+ const change = findClosestCountryChange(row.sessions);
86
+ if (!change) {
87
+ return null;
88
+ }
89
+ const countries = readCountries(row.sessions);
90
+ const latest = [...row.sessions].sort((a, b) => {
91
+ return b.startTime.getTime() - a.startTime.getTime();
92
+ })[0];
93
+ const minutes = Math.max(1, Math.round(change.minutes));
94
+ const from = change.from.countryCode.trim().toUpperCase();
95
+ const to = change.to.countryCode.trim().toUpperCase();
96
+ const sessionIds = row.sessions
97
+ .map((session) => {
98
+ return session.sessionId;
99
+ })
100
+ .filter(Boolean)
101
+ .slice(0, exports.MAX_RUM_SESSIONS_LISTED);
102
+ const browsers = Array.from(new Set(row.sessions
103
+ .map((session) => {
104
+ return [session.browserName, session.osName]
105
+ .filter(Boolean)
106
+ .join(" on ");
107
+ })
108
+ .filter(Boolean))).slice(0, 5);
109
+ const attributes = {
110
+ [exports.RUM_ATTRIBUTES.userKey]: userKey,
111
+ [exports.RUM_ATTRIBUTES.countries]: countries.join(","),
112
+ [exports.RUM_ATTRIBUTES.sessionIds]: sessionIds.join(","),
113
+ [exports.RUM_ATTRIBUTES.applicationId]: latest.rumApplicationId,
114
+ };
115
+ if (browsers.length > 0) {
116
+ attributes[exports.RUM_ATTRIBUTES.browsers] = browsers.join(", ");
117
+ }
118
+ // One event a user a day for the same countries, however often it is seen.
119
+ const day = change.to.startTime.toISOString().slice(0, 10);
120
+ return (0, TelemetrySecurityEvent_1.buildTelemetrySecurityEvent)({
121
+ kind: SecurityTelemetrySource_1.SecurityTelemetrySourceKind.RumSessions,
122
+ signal: SecurityTelemetrySource_1.SecurityTelemetrySignal.UserInTwoCountries,
123
+ time: change.to.startTime,
124
+ eventUid: `rum:${SecurityTelemetrySource_1.SecurityTelemetrySignal.UserInTwoCountries}:${userKey}:${countries.join("-")}:${day}`,
125
+ classUid: exports.AUTHENTICATION_CLASS_UID,
126
+ activityName: "Logon",
127
+ statusName: "Success",
128
+ severity: OcsfSeverity_1.default.Medium,
129
+ message: `One signed-in user used the app from ${from} and then ${to}, ${minutes} ${minutes === 1 ? "minute" : "minutes"} apart`,
130
+ attributes,
131
+ extraObservables: [userKey],
132
+ sessionId: latest.sessionId,
133
+ });
134
+ }
@@ -0,0 +1,8 @@
1
+ import commonJsModule from "./RumSignals.js";
2
+ export const AUTHENTICATION_CLASS_UID = commonJsModule.AUTHENTICATION_CLASS_UID;
3
+ export const MAX_RUM_SESSIONS_LISTED = commonJsModule.MAX_RUM_SESSIONS_LISTED;
4
+ export const RUM_ATTRIBUTES = commonJsModule.RUM_ATTRIBUTES;
5
+ export const RUM_COUNTRY_WINDOW_IN_MINUTES = commonJsModule.RUM_COUNTRY_WINDOW_IN_MINUTES;
6
+ export const buildUserInTwoCountriesEvent = commonJsModule.buildUserInTwoCountriesEvent;
7
+ export const findClosestCountryChange = commonJsModule.findClosestCountryChange;
8
+ export const readCountries = commonJsModule.readCountries;
@@ -0,0 +1,40 @@
1
+ import { JSONObject } from "../../../Types/JSON.mjs";
2
+ import NormalizedSecurityEvent from "../../../Types/SecurityEvent/NormalizedSecurityEvent.mjs";
3
+ import OcsfSeverity from "../../../Types/SecurityEvent/OcsfSeverity.mjs";
4
+ import SecurityEventRequestOutcome from "../../../Types/SecurityEvent/SecurityEventRequestOutcome.mjs";
5
+ import { SecurityTelemetrySignal, SecurityTelemetrySourceKind } from "../../../Types/SecurityEvent/SecurityTelemetrySource.mjs";
6
+ export declare const MAX_TELEMETRY_EVENT_MESSAGE_LENGTH: number;
7
+ export declare const MAX_TELEMETRY_ATTRIBUTE_LENGTH: number;
8
+ export declare function cutTelemetryText(text: string, limit: number): string;
9
+ export declare const SECURITY_TELEMETRY_SIGNAL_ATTACK: Record<SecurityTelemetrySignal, {
10
+ tactics: Array<string>;
11
+ techniques: Array<string>;
12
+ }>;
13
+ export interface TelemetrySecurityEventInput {
14
+ kind: SecurityTelemetrySourceKind;
15
+ signal: SecurityTelemetrySignal;
16
+ time: Date;
17
+ eventUid: string;
18
+ classUid: number;
19
+ activityName: string;
20
+ statusName: string;
21
+ severity: OcsfSeverity;
22
+ message: string;
23
+ principalUser?: string | undefined;
24
+ principalHost?: string | undefined;
25
+ principalIp?: string | undefined;
26
+ targetUser?: string | undefined;
27
+ targetHost?: string | undefined;
28
+ targetIp?: string | undefined;
29
+ targetPort?: number | undefined;
30
+ targetResource?: string | undefined;
31
+ attributes: JSONObject;
32
+ extraObservables?: Array<string> | undefined;
33
+ traceId?: string | undefined;
34
+ spanId?: string | undefined;
35
+ sessionId?: string | undefined;
36
+ requestOutcome?: SecurityEventRequestOutcome | undefined;
37
+ resourceId?: string | undefined;
38
+ resourceType?: string | undefined;
39
+ }
40
+ export declare function buildTelemetrySecurityEvent(input: TelemetrySecurityEventInput): NormalizedSecurityEvent;
@@ -0,0 +1,40 @@
1
+ import { JSONObject } from "../../../Types/JSON";
2
+ import NormalizedSecurityEvent from "../../../Types/SecurityEvent/NormalizedSecurityEvent";
3
+ import OcsfSeverity from "../../../Types/SecurityEvent/OcsfSeverity";
4
+ import SecurityEventRequestOutcome from "../../../Types/SecurityEvent/SecurityEventRequestOutcome";
5
+ import { SecurityTelemetrySignal, SecurityTelemetrySourceKind } from "../../../Types/SecurityEvent/SecurityTelemetrySource";
6
+ export declare const MAX_TELEMETRY_EVENT_MESSAGE_LENGTH: number;
7
+ export declare const MAX_TELEMETRY_ATTRIBUTE_LENGTH: number;
8
+ export declare function cutTelemetryText(text: string, limit: number): string;
9
+ export declare const SECURITY_TELEMETRY_SIGNAL_ATTACK: Record<SecurityTelemetrySignal, {
10
+ tactics: Array<string>;
11
+ techniques: Array<string>;
12
+ }>;
13
+ export interface TelemetrySecurityEventInput {
14
+ kind: SecurityTelemetrySourceKind;
15
+ signal: SecurityTelemetrySignal;
16
+ time: Date;
17
+ eventUid: string;
18
+ classUid: number;
19
+ activityName: string;
20
+ statusName: string;
21
+ severity: OcsfSeverity;
22
+ message: string;
23
+ principalUser?: string | undefined;
24
+ principalHost?: string | undefined;
25
+ principalIp?: string | undefined;
26
+ targetUser?: string | undefined;
27
+ targetHost?: string | undefined;
28
+ targetIp?: string | undefined;
29
+ targetPort?: number | undefined;
30
+ targetResource?: string | undefined;
31
+ attributes: JSONObject;
32
+ extraObservables?: Array<string> | undefined;
33
+ traceId?: string | undefined;
34
+ spanId?: string | undefined;
35
+ sessionId?: string | undefined;
36
+ requestOutcome?: SecurityEventRequestOutcome | undefined;
37
+ resourceId?: string | undefined;
38
+ resourceType?: string | undefined;
39
+ }
40
+ export declare function buildTelemetrySecurityEvent(input: TelemetrySecurityEventInput): NormalizedSecurityEvent;