@oneuptime/common 14.0.96 → 14.0.98
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/NetworkFlow.d.mts +4 -0
- package/Models/AnalyticsModels/NetworkFlow.d.ts +4 -0
- package/Models/AnalyticsModels/NetworkFlow.js +50 -0
- package/Models/DatabaseModels/Alert.d.mts +2 -0
- package/Models/DatabaseModels/Alert.d.ts +2 -0
- package/Models/DatabaseModels/Alert.js +63 -0
- package/Models/DatabaseModels/CodeRepository.d.mts +3 -0
- package/Models/DatabaseModels/CodeRepository.d.ts +3 -0
- package/Models/DatabaseModels/CodeRepository.js +104 -0
- package/Models/DatabaseModels/Incident.d.mts +2 -0
- package/Models/DatabaseModels/Incident.d.ts +2 -0
- package/Models/DatabaseModels/Incident.js +63 -0
- package/Models/DatabaseModels/Index.js +12 -0
- package/Models/DatabaseModels/NetworkAddressName.d.mts +14 -0
- package/Models/DatabaseModels/NetworkAddressName.d.ts +14 -0
- package/Models/DatabaseModels/NetworkAddressName.js +300 -0
- package/Models/DatabaseModels/NetworkAddressName.mjs +2 -0
- package/Models/DatabaseModels/NetworkDevice.d.mts +1 -0
- package/Models/DatabaseModels/NetworkDevice.d.ts +1 -0
- package/Models/DatabaseModels/NetworkDevice.js +38 -0
- package/Models/DatabaseModels/SecurityCase.d.mts +8 -0
- package/Models/DatabaseModels/SecurityCase.d.ts +8 -0
- package/Models/DatabaseModels/SecurityCase.js +145 -0
- package/Models/DatabaseModels/SecurityCaseEvidence.d.mts +32 -0
- package/Models/DatabaseModels/SecurityCaseEvidence.d.ts +32 -0
- package/Models/DatabaseModels/SecurityCaseEvidence.js +548 -0
- package/Models/DatabaseModels/SecurityCaseEvidence.mjs +2 -0
- package/Models/DatabaseModels/SecurityCaseFeed.d.mts +4 -1
- package/Models/DatabaseModels/SecurityCaseFeed.d.ts +4 -1
- package/Models/DatabaseModels/SecurityCaseFeed.js +6 -0
- package/Models/DatabaseModels/SecurityCasePriority.d.mts +2 -0
- package/Models/DatabaseModels/SecurityCasePriority.d.ts +2 -0
- package/Models/DatabaseModels/SecurityCasePriority.js +44 -0
- package/Models/DatabaseModels/SecurityCaseTask.d.mts +22 -0
- package/Models/DatabaseModels/SecurityCaseTask.d.ts +22 -0
- package/Models/DatabaseModels/SecurityCaseTask.js +467 -0
- package/Models/DatabaseModels/SecurityCaseTask.mjs +2 -0
- package/Models/DatabaseModels/SecurityHunt.d.mts +34 -0
- package/Models/DatabaseModels/SecurityHunt.d.ts +34 -0
- package/Models/DatabaseModels/SecurityHunt.js +608 -0
- package/Models/DatabaseModels/SecurityHunt.mjs +2 -0
- package/Models/DatabaseModels/SecurityWatchlist.d.mts +22 -0
- package/Models/DatabaseModels/SecurityWatchlist.d.ts +22 -0
- package/Models/DatabaseModels/SecurityWatchlist.js +411 -0
- package/Models/DatabaseModels/SecurityWatchlist.mjs +2 -0
- package/Models/DatabaseModels/SecurityWatchlistItem.d.mts +17 -0
- package/Models/DatabaseModels/SecurityWatchlistItem.d.ts +17 -0
- package/Models/DatabaseModels/SecurityWatchlistItem.js +321 -0
- package/Models/DatabaseModels/SecurityWatchlistItem.mjs +2 -0
- package/Types/AI/AIChatTypes.d.mts +1 -0
- package/Types/AI/AIChatTypes.d.ts +1 -0
- package/Types/AI/AIRunEventType.d.mts +1 -0
- package/Types/AI/AIRunEventType.d.ts +1 -0
- package/Types/AI/AIRunEventType.js +8 -0
- package/Types/AI/AiAffectedResources.d.mts +2 -1
- package/Types/AI/AiAffectedResources.d.ts +2 -1
- package/Types/AI/AiAffectedResources.js +12 -1
- package/Types/AI/AiTokenCount.d.mts +22 -1
- package/Types/AI/AiTokenCount.d.ts +22 -1
- package/Types/AI/AiTokenCount.js +126 -57
- package/Types/AI/AiTokenCount.mjs +2 -0
- package/Types/AI/CodeFixTaskContext.d.mts +1 -0
- package/Types/AI/CodeFixTaskContext.d.ts +1 -0
- package/Types/AffectedResources/AffectedResourceSearch.d.mts +53 -0
- package/Types/AffectedResources/AffectedResourceSearch.d.ts +53 -0
- package/Types/AffectedResources/AffectedResourceSearch.js +224 -0
- package/Types/AffectedResources/AffectedResourceSearch.mjs +11 -0
- package/Types/ArchivableValue/ArchivableValueUsage.d.mts +21 -2
- package/Types/ArchivableValue/ArchivableValueUsage.d.ts +21 -2
- package/Types/ArchivableValue/ArchivableValueUsage.js +91 -12
- package/Types/ArchivableValue/ArchivableValueUsage.mjs +1 -0
- package/Types/CodeRepository/CodeRepositorySetting.d.mts +1 -0
- package/Types/CodeRepository/CodeRepositorySetting.d.ts +1 -0
- package/Types/CodeRepository/CodeRepositorySetting.js +2 -0
- package/Types/Color.d.mts +0 -2
- package/Types/Color.d.ts +0 -2
- package/Types/Color.js +0 -14
- package/Types/Database/DatabaseProperty.d.mts +0 -2
- package/Types/Database/DatabaseProperty.d.ts +0 -2
- package/Types/Database/DatabaseProperty.js +0 -3
- package/Types/Date.d.mts +0 -2
- package/Types/Date.d.ts +0 -2
- package/Types/Date.js +0 -23
- package/Types/Domain.d.mts +0 -2
- package/Types/Domain.d.ts +0 -2
- package/Types/Domain.js +0 -14
- package/Types/Email/EmailTemplateType.d.mts +3 -0
- package/Types/Email/EmailTemplateType.d.ts +3 -0
- package/Types/Email/EmailTemplateType.js +4 -0
- package/Types/Email.d.mts +0 -2
- package/Types/Email.d.ts +0 -2
- package/Types/Email.js +0 -15
- package/Types/IP/IP.d.mts +0 -2
- package/Types/IP/IP.d.ts +0 -2
- package/Types/IP/IP.js +0 -14
- package/Types/Link.d.mts +1 -0
- package/Types/Link.d.ts +1 -0
- package/Types/Monitor/CriteriaAlert.d.mts +0 -2
- package/Types/Monitor/CriteriaAlert.d.ts +0 -2
- package/Types/Monitor/CriteriaAlert.js +0 -18
- package/Types/Monitor/CriteriaAlert.mjs +1 -2
- package/Types/Monitor/CriteriaFilter.d.mts +0 -2
- package/Types/Monitor/CriteriaFilter.d.ts +0 -2
- package/Types/Monitor/CriteriaFilter.js +1 -42
- package/Types/Monitor/CriteriaFilter.mjs +0 -1
- package/Types/Monitor/CriteriaIncident.d.mts +0 -2
- package/Types/Monitor/CriteriaIncident.d.ts +0 -2
- package/Types/Monitor/CriteriaIncident.js +0 -23
- package/Types/Monitor/CriteriaIncident.mjs +1 -2
- package/Types/Monitor/IncomingMonitor/IncidentGroupingConfig.d.mts +0 -2
- package/Types/Monitor/IncomingMonitor/IncidentGroupingConfig.d.ts +0 -2
- package/Types/Monitor/IncomingMonitor/IncidentGroupingConfig.js +0 -11
- package/Types/Monitor/IncomingMonitor/IncidentGroupingConfig.mjs +1 -2
- package/Types/Monitor/MonitorCriteria.d.mts +0 -2
- package/Types/Monitor/MonitorCriteria.d.ts +0 -2
- package/Types/Monitor/MonitorCriteria.js +0 -21
- package/Types/Monitor/MonitorCriteriaInstance.d.mts +0 -2
- package/Types/Monitor/MonitorCriteriaInstance.d.ts +0 -2
- package/Types/Monitor/MonitorCriteriaInstance.js +0 -54
- package/Types/Monitor/MonitorStep.d.mts +0 -2
- package/Types/Monitor/MonitorStep.d.ts +0 -2
- package/Types/Monitor/MonitorStep.js +0 -80
- package/Types/Monitor/MonitorSteps.d.mts +0 -2
- package/Types/Monitor/MonitorSteps.d.ts +0 -2
- package/Types/Monitor/MonitorSteps.js +0 -31
- package/Types/Name.d.mts +0 -2
- package/Types/Name.d.ts +0 -2
- package/Types/Name.js +0 -14
- package/Types/NetFlow/NetworkAddressName.d.mts +30 -0
- package/Types/NetFlow/NetworkAddressName.d.ts +30 -0
- package/Types/NetFlow/NetworkAddressName.js +149 -0
- package/Types/NetFlow/NetworkAddressName.mjs +6 -0
- package/Types/NetFlow/NetworkTraffic.d.mts +20 -0
- package/Types/NetFlow/NetworkTraffic.d.ts +20 -0
- package/Types/NetFlow/NetworkTraffic.js +5 -1
- package/Types/NetFlow/NetworkTraffic.mjs +2 -0
- package/Types/NetworkController/NetworkControllerReadSummary.d.mts +2 -0
- package/Types/NetworkController/NetworkControllerReadSummary.d.ts +2 -0
- package/Types/NetworkController/NetworkControllerReadSummary.js +7 -1
- package/Types/NetworkDevice/NetworkDeviceDiscoveredDetails.d.mts +47 -1
- package/Types/NetworkDevice/NetworkDeviceDiscoveredDetails.d.ts +47 -1
- package/Types/NetworkDevice/NetworkDeviceDiscoveredDetails.js +173 -8
- package/Types/NetworkDevice/NetworkDeviceDiscoveredDetails.mjs +7 -0
- package/Types/NotificationSetting/NotificationEmailRollupCategory.d.mts +1 -0
- package/Types/NotificationSetting/NotificationEmailRollupCategory.d.ts +1 -0
- package/Types/NotificationSetting/NotificationEmailRollupCategory.js +12 -0
- package/Types/NotificationSetting/NotificationEmailRollupPolicy.js +6 -0
- package/Types/NotificationSetting/NotificationSettingEventType.d.mts +3 -0
- package/Types/NotificationSetting/NotificationSettingEventType.d.ts +3 -0
- package/Types/NotificationSetting/NotificationSettingEventType.js +15 -0
- package/Types/ObjectID.d.mts +0 -1
- package/Types/ObjectID.d.ts +0 -1
- package/Types/ObjectID.js +0 -9
- package/Types/OnCallDutyPolicy/OnCallDutyPolicyRunEnding.d.mts +4 -0
- package/Types/OnCallDutyPolicy/OnCallDutyPolicyRunEnding.d.ts +4 -0
- package/Types/OnCallDutyPolicy/OnCallDutyPolicyRunEnding.js +25 -1
- package/Types/OnCallDutyPolicy/OnCallDutyPolicyRunEnding.mjs +4 -0
- package/Types/OnCallDutyPolicy/OnCallEmptyLevel.d.mts +15 -0
- package/Types/OnCallDutyPolicy/OnCallEmptyLevel.d.ts +15 -0
- package/Types/OnCallDutyPolicy/OnCallEmptyLevel.js +118 -0
- package/Types/OnCallDutyPolicy/OnCallEmptyLevel.mjs +9 -0
- package/Types/Permission.d.mts +8 -0
- package/Types/Permission.d.ts +8 -0
- package/Types/Permission.js +87 -3
- package/Types/Phone.d.mts +0 -2
- package/Types/Phone.d.ts +0 -2
- package/Types/Phone.js +0 -14
- package/Types/Port.d.mts +0 -2
- package/Types/Port.d.ts +0 -2
- package/Types/Port.js +0 -14
- package/Types/ProviderLogo/ProviderLogo.d.mts +8 -1
- package/Types/ProviderLogo/ProviderLogo.d.ts +8 -1
- package/Types/ProviderLogo/ProviderLogo.js +14 -0
- package/Types/SecurityCase/SecurityCaseEventEvidence.d.mts +67 -0
- package/Types/SecurityCase/SecurityCaseEventEvidence.d.ts +67 -0
- package/Types/SecurityCase/SecurityCaseEventEvidence.js +271 -0
- package/Types/SecurityCase/SecurityCaseEventEvidence.mjs +13 -0
- package/Types/SecurityCase/SecurityCaseEvidenceKind.d.mts +8 -0
- package/Types/SecurityCase/SecurityCaseEvidenceKind.d.ts +8 -0
- package/Types/SecurityCase/SecurityCaseEvidenceKind.js +34 -0
- package/Types/SecurityCase/SecurityCaseEvidenceKind.mjs +4 -0
- package/Types/SecurityEvent/SecurityHunt.d.mts +122 -0
- package/Types/SecurityEvent/SecurityHunt.d.ts +122 -0
- package/Types/SecurityEvent/SecurityHunt.js +391 -0
- package/Types/SecurityEvent/SecurityHunt.mjs +32 -0
- package/Types/SecurityEvent/SecurityWatchlist.d.mts +167 -0
- package/Types/SecurityEvent/SecurityWatchlist.d.ts +167 -0
- package/Types/SecurityEvent/SecurityWatchlist.js +648 -0
- package/Types/SecurityEvent/SecurityWatchlist.mjs +51 -0
- package/Types/SecurityEvent/SigmaRule.d.mts +2 -0
- package/Types/SecurityEvent/SigmaRule.d.ts +2 -0
- package/Types/SecurityEvent/SigmaRule.js +5 -0
- package/Types/Telemetry/OpenTelemetryGuides.js +177 -5
- package/Types/Version.d.mts +0 -2
- package/Types/Version.d.ts +0 -2
- package/Types/Version.js +0 -14
- package/Types/Workflow/AffectedResourcesSetting.d.mts +13 -0
- package/Types/Workflow/AffectedResourcesSetting.d.ts +13 -0
- package/Types/Workflow/AffectedResourcesSetting.js +120 -0
- package/Types/Workflow/AffectedResourcesSetting.mjs +8 -0
- package/Types/Workflow/Components/BaseModel.js +15 -3
- package/Types/Workflow/Documentation/DatabaseDocumentation.js +36 -0
- package/Types/Workflow/RunRecord.d.mts +3 -14
- package/Types/Workflow/RunRecord.d.ts +3 -14
- package/Types/Workflow/RunRecord.js +10 -51
- package/Utils/AI/InvestigationLogStall.d.mts +38 -0
- package/Utils/AI/InvestigationLogStall.d.ts +38 -0
- package/Utils/AI/InvestigationLogStall.js +163 -0
- package/Utils/AI/InvestigationLogStall.mjs +11 -0
- package/Utils/Inventory/AssetFactSource.d.mts +6 -2
- package/Utils/Inventory/AssetFactSource.d.ts +6 -2
- package/Utils/Inventory/AssetFactSource.js +18 -1
- package/Utils/Inventory/AssetFactSource.mjs +1 -0
- package/Utils/Markdown/FeedLead.d.mts +10 -0
- package/Utils/Markdown/FeedLead.d.ts +10 -0
- package/Utils/Markdown/FeedLead.js +198 -0
- package/Utils/Markdown/FeedLead.mjs +8 -0
- package/Utils/NetworkDevice/NetworkDeviceAssetFacts.d.mts +9 -1
- package/Utils/NetworkDevice/NetworkDeviceAssetFacts.d.ts +9 -1
- package/Utils/NetworkDevice/NetworkDeviceAssetFacts.js +139 -18
- package/Utils/NetworkDevice/NetworkDeviceAssetFacts.mjs +1 -0
- package/Utils/NetworkDevice/NetworkDeviceRefresh.d.mts +88 -0
- package/Utils/NetworkDevice/NetworkDeviceRefresh.d.ts +88 -0
- package/Utils/NetworkDevice/NetworkDeviceRefresh.js +232 -0
- package/Utils/NetworkDevice/NetworkDeviceRefresh.mjs +16 -0
- package/Utils/NetworkTraffic/NetworkAddressBlock.d.mts +20 -0
- package/Utils/NetworkTraffic/NetworkAddressBlock.d.ts +20 -0
- package/Utils/NetworkTraffic/NetworkAddressBlock.js +264 -0
- package/Utils/NetworkTraffic/NetworkAddressBlock.mjs +3 -0
- package/Utils/Project/RecordNumber.d.mts +43 -0
- package/Utils/Project/RecordNumber.d.ts +43 -0
- package/Utils/Project/RecordNumber.js +151 -0
- package/Utils/Project/RecordNumber.mjs +6 -0
- package/Utils/Schema/MonitorSchemas.d.mts +9 -0
- package/Utils/Schema/MonitorSchemas.d.ts +9 -0
- package/Utils/Schema/MonitorSchemas.js +291 -0
- package/Utils/Schema/MonitorSchemas.mjs +9 -0
- package/Utils/Schema/TypeSchemas.d.mts +12 -0
- package/Utils/Schema/TypeSchemas.d.ts +12 -0
- package/Utils/Schema/TypeSchemas.js +176 -0
- package/Utils/Schema/TypeSchemas.mjs +11 -0
- package/Utils/Schema/Zod.js +17 -17
- package/Utils/SecurityCase/SecurityCaseMarkdown.d.mts +43 -0
- package/Utils/SecurityCase/SecurityCaseMarkdown.d.ts +43 -0
- package/Utils/SecurityCase/SecurityCaseMarkdown.js +89 -0
- package/Utils/SecurityCase/SecurityCaseMarkdown.mjs +11 -0
- package/Utils/SecurityCase/SecurityCasePriorities.d.mts +2 -0
- package/Utils/SecurityCase/SecurityCasePriorities.d.ts +2 -0
- package/Utils/SecurityCase/SecurityCasePriorities.js +15 -1
- package/Utils/SecurityCase/SecurityCaseTargets.d.mts +128 -0
- package/Utils/SecurityCase/SecurityCaseTargets.d.ts +128 -0
- package/Utils/SecurityCase/SecurityCaseTargets.js +482 -0
- package/Utils/SecurityCase/SecurityCaseTargets.mjs +28 -0
- package/Utils/SecurityEvent/SecurityEventSearch.d.mts +56 -0
- package/Utils/SecurityEvent/SecurityEventSearch.d.ts +56 -0
- package/Utils/SecurityEvent/SecurityEventSearch.js +422 -0
- package/Utils/SecurityEvent/SecurityEventSearch.mjs +21 -0
- package/Utils/SecurityEvent/SecurityHuntSearch.d.mts +12 -0
- package/Utils/SecurityEvent/SecurityHuntSearch.d.ts +12 -0
- package/Utils/SecurityEvent/SecurityHuntSearch.js +51 -0
- package/Utils/SecurityEvent/SecurityHuntSearch.mjs +3 -0
- package/Utils/SecurityEvent/Sigma/SigmaRuleParser.js +22 -0
- package/Utils/SecurityEvent/Sigma/SigmaWatchlists.d.mts +24 -0
- package/Utils/SecurityEvent/Sigma/SigmaWatchlists.d.ts +24 -0
- package/Utils/SecurityEvent/Sigma/SigmaWatchlists.js +183 -0
- package/Utils/SecurityEvent/Sigma/SigmaWatchlists.mjs +9 -0
- package/Utils/Suggestions/TracePerformanceFixSuggestion.d.mts +9 -0
- package/Utils/Suggestions/TracePerformanceFixSuggestion.d.ts +9 -0
- package/Utils/Suggestions/TracePerformanceFixSuggestion.js +69 -1
- package/Utils/Suggestions/TracePerformanceFixSuggestion.mjs +4 -0
- package/package.json +1 -1
|
@@ -0,0 +1,391 @@
|
|
|
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.SECURITY_HUNT_RUN_ERRORS = exports.SECURITY_HUNT_RETRY_AFTER_FAILURE_IN_MINUTES = exports.SECURITY_HUNT_MAX_CATCH_UP_IN_MINUTES = exports.SECURITY_HUNT_RUN_DELAY_IN_SECONDS = exports.SECURITY_HUNT_MESSAGES = exports.SECURITY_HUNTS_PER_PROJECT_MAX = exports.SECURITY_HUNT_RECIPIENTS_MAX = exports.SECURITY_HUNT_FILTER_VALUE_MAX_LENGTH = exports.SECURITY_HUNT_FILTER_VALUES_MAX = exports.SECURITY_HUNT_SEARCH_MAX_LENGTH = exports.SECURITY_HUNT_DESCRIPTION_MAX_LENGTH = exports.SECURITY_HUNT_NAME_MAX_LENGTH = exports.DEFAULT_SECURITY_HUNT_TIME_RANGE = exports.SECURITY_HUNT_TIME_RANGES = exports.SECURITY_HUNT_SCHEDULES = exports.SecurityHuntSchedule = void 0;
|
|
7
|
+
exports.isSecurityHuntSchedule = isSecurityHuntSchedule;
|
|
8
|
+
exports.getSecurityHuntIntervalInMinutes = getSecurityHuntIntervalInMinutes;
|
|
9
|
+
exports.isScheduledSecurityHunt = isScheduledSecurityHunt;
|
|
10
|
+
exports.isSecurityHuntTimeRange = isSecurityHuntTimeRange;
|
|
11
|
+
exports.getSecurityHuntTimeRangeForLength = getSecurityHuntTimeRangeForLength;
|
|
12
|
+
exports.getSecurityHuntProblems = getSecurityHuntProblems;
|
|
13
|
+
exports.readSecurityHuntFilters = readSecurityHuntFilters;
|
|
14
|
+
exports.countSecurityHuntFilterValues = countSecurityHuntFilterValues;
|
|
15
|
+
exports.securityHuntFiltersToMap = securityHuntFiltersToMap;
|
|
16
|
+
exports.securityHuntFiltersFromMap = securityHuntFiltersFromMap;
|
|
17
|
+
exports.areSecurityHuntFiltersEqual = areSecurityHuntFiltersEqual;
|
|
18
|
+
exports.getSecurityHuntSearchStart = getSecurityHuntSearchStart;
|
|
19
|
+
exports.getSecurityHuntRunWindow = getSecurityHuntRunWindow;
|
|
20
|
+
exports.getNextSecurityHuntRunAt = getNextSecurityHuntRunAt;
|
|
21
|
+
exports.getSecurityHuntRetryAt = getSecurityHuntRetryAt;
|
|
22
|
+
const Date_1 = __importDefault(require("../Date"));
|
|
23
|
+
const TimeRange_1 = __importDefault(require("../Time/TimeRange"));
|
|
24
|
+
const DetectionFindingConstants_1 = require("./DetectionFindingConstants");
|
|
25
|
+
/*
|
|
26
|
+
* HUNTS: SEARCHES OVER SECURITY EVENTS, SAVED.
|
|
27
|
+
*
|
|
28
|
+
* A hunt is a search over a project's security events, kept with a name:
|
|
29
|
+
* the search bar's text and the sidebar's chips as Security Events > Events
|
|
30
|
+
* draws them, and how far back it looks when it is opened. A team saves the
|
|
31
|
+
* questions it asks again and again - encoded PowerShell, admin sign-ins
|
|
32
|
+
* from a new country, a known-bad domain - and opens any of them in one
|
|
33
|
+
* click, on the Events explorer, to bookmark what it finds onto a case.
|
|
34
|
+
*
|
|
35
|
+
* A hunt can also run on a schedule - every hour, 6 hours, day or week. Each
|
|
36
|
+
* run reads the events that arrived since the one before (never the same
|
|
37
|
+
* events twice), counts what the search finds in them, and, when it finds
|
|
38
|
+
* any, tells the people and teams the hunt names, through each person's
|
|
39
|
+
* notification settings. A run reads only what the person who set the
|
|
40
|
+
* schedule can read, at the moment it runs, so a hunt never learns more
|
|
41
|
+
* than its author could look at. A run opens no case and raises no alert:
|
|
42
|
+
* what should open cases is written as a detection rule.
|
|
43
|
+
*
|
|
44
|
+
* Shared by the server, which keeps and runs hunts (SecurityHuntService,
|
|
45
|
+
* SecurityHuntScheduler), and the Dashboard, which saves, edits and opens
|
|
46
|
+
* them. Each message below is a Dashboard translation key, read from here
|
|
47
|
+
* by the string extractor, so a form shows it in the reader's language and
|
|
48
|
+
* the API answers a save in the same words.
|
|
49
|
+
*/
|
|
50
|
+
// How often a hunt runs on its own.
|
|
51
|
+
var SecurityHuntSchedule;
|
|
52
|
+
(function (SecurityHuntSchedule) {
|
|
53
|
+
// Opened by hand only.
|
|
54
|
+
SecurityHuntSchedule["NotScheduled"] = "Not Scheduled";
|
|
55
|
+
SecurityHuntSchedule["EveryHour"] = "Every Hour";
|
|
56
|
+
SecurityHuntSchedule["EverySixHours"] = "Every 6 Hours";
|
|
57
|
+
SecurityHuntSchedule["EveryDay"] = "Every Day";
|
|
58
|
+
SecurityHuntSchedule["EveryWeek"] = "Every Week";
|
|
59
|
+
})(SecurityHuntSchedule || (exports.SecurityHuntSchedule = SecurityHuntSchedule = {}));
|
|
60
|
+
// In the order the form offers them: not scheduled first, then the shortest.
|
|
61
|
+
exports.SECURITY_HUNT_SCHEDULES = [
|
|
62
|
+
SecurityHuntSchedule.NotScheduled,
|
|
63
|
+
SecurityHuntSchedule.EveryHour,
|
|
64
|
+
SecurityHuntSchedule.EverySixHours,
|
|
65
|
+
SecurityHuntSchedule.EveryDay,
|
|
66
|
+
SecurityHuntSchedule.EveryWeek,
|
|
67
|
+
];
|
|
68
|
+
const SCHEDULE_INTERVAL_IN_MINUTES = {
|
|
69
|
+
[SecurityHuntSchedule.NotScheduled]: null,
|
|
70
|
+
[SecurityHuntSchedule.EveryHour]: 60,
|
|
71
|
+
[SecurityHuntSchedule.EverySixHours]: 6 * 60,
|
|
72
|
+
[SecurityHuntSchedule.EveryDay]: 24 * 60,
|
|
73
|
+
[SecurityHuntSchedule.EveryWeek]: 7 * 24 * 60,
|
|
74
|
+
};
|
|
75
|
+
function isSecurityHuntSchedule(value) {
|
|
76
|
+
return exports.SECURITY_HUNT_SCHEDULES.includes(value);
|
|
77
|
+
}
|
|
78
|
+
// How many minutes apart a schedule's runs are; null when it does not run on its own.
|
|
79
|
+
function getSecurityHuntIntervalInMinutes(schedule) {
|
|
80
|
+
if (!isSecurityHuntSchedule(schedule)) {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
return SCHEDULE_INTERVAL_IN_MINUTES[schedule];
|
|
84
|
+
}
|
|
85
|
+
function isScheduledSecurityHunt(schedule) {
|
|
86
|
+
return getSecurityHuntIntervalInMinutes(schedule) !== null;
|
|
87
|
+
}
|
|
88
|
+
/*
|
|
89
|
+
* How far back a hunt searches when it is opened: any window the Events
|
|
90
|
+
* page's time picker offers that moves with the clock. A fixed window would
|
|
91
|
+
* open on the same past events forever.
|
|
92
|
+
*/
|
|
93
|
+
const TIME_RANGE_LENGTH_IN_MINUTES = [
|
|
94
|
+
[TimeRange_1.default.PAST_FIVE_MINS, 5],
|
|
95
|
+
[TimeRange_1.default.PAST_FIFTEEN_MINS, 15],
|
|
96
|
+
[TimeRange_1.default.PAST_THIRTY_MINS, 30],
|
|
97
|
+
[TimeRange_1.default.PAST_ONE_HOUR, 60],
|
|
98
|
+
[TimeRange_1.default.PAST_TWO_HOURS, 2 * 60],
|
|
99
|
+
[TimeRange_1.default.PAST_THREE_HOURS, 3 * 60],
|
|
100
|
+
[TimeRange_1.default.PAST_ONE_DAY, 24 * 60],
|
|
101
|
+
[TimeRange_1.default.PAST_TWO_DAYS, 2 * 24 * 60],
|
|
102
|
+
[TimeRange_1.default.PAST_ONE_WEEK, 7 * 24 * 60],
|
|
103
|
+
[TimeRange_1.default.PAST_TWO_WEEKS, 14 * 24 * 60],
|
|
104
|
+
[TimeRange_1.default.PAST_ONE_MONTH, 30 * 24 * 60],
|
|
105
|
+
[TimeRange_1.default.PAST_THREE_MONTHS, 90 * 24 * 60],
|
|
106
|
+
];
|
|
107
|
+
exports.SECURITY_HUNT_TIME_RANGES = TIME_RANGE_LENGTH_IN_MINUTES.map((entry) => {
|
|
108
|
+
return entry[0];
|
|
109
|
+
});
|
|
110
|
+
/*
|
|
111
|
+
* A week: long enough to show what a hunt looks for, short enough to read
|
|
112
|
+
* quickly. Saved from Events, a hunt keeps the window the page was on.
|
|
113
|
+
*/
|
|
114
|
+
exports.DEFAULT_SECURITY_HUNT_TIME_RANGE = TimeRange_1.default.PAST_ONE_WEEK;
|
|
115
|
+
function isSecurityHuntTimeRange(value) {
|
|
116
|
+
return exports.SECURITY_HUNT_TIME_RANGES.includes(value);
|
|
117
|
+
}
|
|
118
|
+
/*
|
|
119
|
+
* The window a hunt saved from a page on a fixed window (a zoom into the
|
|
120
|
+
* chart, a range typed by hand) searches over: the shortest of the moving
|
|
121
|
+
* windows that is at least as long, so it still holds what was on screen.
|
|
122
|
+
*/
|
|
123
|
+
function getSecurityHuntTimeRangeForLength(lengthInMinutes) {
|
|
124
|
+
for (const [range, minutes] of TIME_RANGE_LENGTH_IN_MINUTES) {
|
|
125
|
+
if (lengthInMinutes <= minutes) {
|
|
126
|
+
return range;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return TimeRange_1.default.PAST_THREE_MONTHS;
|
|
130
|
+
}
|
|
131
|
+
/*
|
|
132
|
+
* Limits. A hunt's search is what a person types in one line; its chips are
|
|
133
|
+
* values clicked in a sidebar; it tells a team, not a company.
|
|
134
|
+
*/
|
|
135
|
+
exports.SECURITY_HUNT_NAME_MAX_LENGTH = 100;
|
|
136
|
+
exports.SECURITY_HUNT_DESCRIPTION_MAX_LENGTH = 2000;
|
|
137
|
+
exports.SECURITY_HUNT_SEARCH_MAX_LENGTH = 2000;
|
|
138
|
+
exports.SECURITY_HUNT_FILTER_VALUES_MAX = 50;
|
|
139
|
+
exports.SECURITY_HUNT_FILTER_VALUE_MAX_LENGTH = 500;
|
|
140
|
+
exports.SECURITY_HUNT_RECIPIENTS_MAX = 50;
|
|
141
|
+
// The most hunts one project keeps.
|
|
142
|
+
exports.SECURITY_HUNTS_PER_PROJECT_MAX = 200;
|
|
143
|
+
/*
|
|
144
|
+
* What is wrong with a hunt, in the words the form and the API both say.
|
|
145
|
+
* Kept as `{ message }` objects so the Dashboard's string extractor reads
|
|
146
|
+
* each as a translation key.
|
|
147
|
+
*/
|
|
148
|
+
exports.SECURITY_HUNT_MESSAGES = {
|
|
149
|
+
enterName: { message: "Enter a name for the hunt." },
|
|
150
|
+
nameTooLong: { message: "A hunt's name is at most 100 characters." },
|
|
151
|
+
descriptionTooLong: {
|
|
152
|
+
message: "A hunt's description is at most 2,000 characters.",
|
|
153
|
+
},
|
|
154
|
+
enterSearch: {
|
|
155
|
+
message: "Enter what the hunt searches for, so it does not find every event.",
|
|
156
|
+
},
|
|
157
|
+
searchTooLong: { message: "A hunt's search is at most 2,000 characters." },
|
|
158
|
+
unknownFilter: {
|
|
159
|
+
message: "One of the hunt's filters is not one Events offers.",
|
|
160
|
+
},
|
|
161
|
+
tooManyFilterValues: {
|
|
162
|
+
message: "A hunt keeps at most 50 filter values.",
|
|
163
|
+
},
|
|
164
|
+
filterValueTooLong: {
|
|
165
|
+
message: "A filter value is at most 500 characters.",
|
|
166
|
+
},
|
|
167
|
+
unknownSchedule: { message: "Choose how often the hunt runs." },
|
|
168
|
+
unknownTimeRange: { message: "Choose how far back the hunt searches." },
|
|
169
|
+
chooseRecipients: {
|
|
170
|
+
message: "Choose who to tell when the hunt finds something: a person or a team.",
|
|
171
|
+
},
|
|
172
|
+
tooManyRecipients: {
|
|
173
|
+
message: "A hunt tells at most 50 people and teams.",
|
|
174
|
+
},
|
|
175
|
+
tooManyHunts: {
|
|
176
|
+
message: "A project keeps at most 200 hunts. Delete one you no longer use, then save this one.",
|
|
177
|
+
},
|
|
178
|
+
scheduleNeedsPerson: {
|
|
179
|
+
message: "Only a person can set a hunt's schedule: its runs read what that person can read.",
|
|
180
|
+
},
|
|
181
|
+
oneHuntAtATime: {
|
|
182
|
+
message: "Change the search or the schedule of one hunt at a time.",
|
|
183
|
+
},
|
|
184
|
+
};
|
|
185
|
+
/*
|
|
186
|
+
* What is wrong with a hunt's name, description and search: none, or each
|
|
187
|
+
* problem with its field. The search is the text, and the chips stand in
|
|
188
|
+
* for it - a hunt saved from a sidebar click alone is a search too.
|
|
189
|
+
*/
|
|
190
|
+
function getSecurityHuntProblems(data) {
|
|
191
|
+
const problems = [];
|
|
192
|
+
const name = (data.name || "").trim();
|
|
193
|
+
if (!name) {
|
|
194
|
+
problems.push({
|
|
195
|
+
field: "name",
|
|
196
|
+
message: exports.SECURITY_HUNT_MESSAGES.enterName.message,
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
else if (name.length > exports.SECURITY_HUNT_NAME_MAX_LENGTH) {
|
|
200
|
+
problems.push({
|
|
201
|
+
field: "name",
|
|
202
|
+
message: exports.SECURITY_HUNT_MESSAGES.nameTooLong.message,
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
if ((data.description || "").length > exports.SECURITY_HUNT_DESCRIPTION_MAX_LENGTH) {
|
|
206
|
+
problems.push({
|
|
207
|
+
field: "description",
|
|
208
|
+
message: exports.SECURITY_HUNT_MESSAGES.descriptionTooLong.message,
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
const search = (data.searchQuery || "").trim();
|
|
212
|
+
if (search.length > exports.SECURITY_HUNT_SEARCH_MAX_LENGTH) {
|
|
213
|
+
problems.push({
|
|
214
|
+
field: "searchQuery",
|
|
215
|
+
message: exports.SECURITY_HUNT_MESSAGES.searchTooLong.message,
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
else if (!search && countSecurityHuntFilterValues(data.filters) === 0) {
|
|
219
|
+
problems.push({
|
|
220
|
+
field: "searchQuery",
|
|
221
|
+
message: exports.SECURITY_HUNT_MESSAGES.enterSearch.message,
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
return problems;
|
|
225
|
+
}
|
|
226
|
+
/*
|
|
227
|
+
* A hunt's chips as kept: each key's values, the empty and the repeated
|
|
228
|
+
* left out, and a key with none dropped. Anything that is not a list of
|
|
229
|
+
* text reads as no chips (a value stored by hand, an old shape).
|
|
230
|
+
*/
|
|
231
|
+
function readSecurityHuntFilters(value) {
|
|
232
|
+
const filters = {};
|
|
233
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
234
|
+
return filters;
|
|
235
|
+
}
|
|
236
|
+
for (const [key, values] of Object.entries(value)) {
|
|
237
|
+
if (!key || !Array.isArray(values)) {
|
|
238
|
+
continue;
|
|
239
|
+
}
|
|
240
|
+
const kept = [];
|
|
241
|
+
for (const item of values) {
|
|
242
|
+
if (typeof item === "string" && item.length > 0 && !kept.includes(item)) {
|
|
243
|
+
kept.push(item);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
if (kept.length > 0) {
|
|
247
|
+
filters[key] = kept;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
return filters;
|
|
251
|
+
}
|
|
252
|
+
// How many values a hunt's chips name, in all.
|
|
253
|
+
function countSecurityHuntFilterValues(filters) {
|
|
254
|
+
let count = 0;
|
|
255
|
+
for (const values of Object.values(readSecurityHuntFilters(filters))) {
|
|
256
|
+
count += values.length;
|
|
257
|
+
}
|
|
258
|
+
return count;
|
|
259
|
+
}
|
|
260
|
+
// A hunt's chips as the Events page keeps them: key -> values.
|
|
261
|
+
function securityHuntFiltersToMap(filters) {
|
|
262
|
+
const map = new Map();
|
|
263
|
+
for (const [key, values] of Object.entries(readSecurityHuntFilters(filters))) {
|
|
264
|
+
map.set(key, new Set(values));
|
|
265
|
+
}
|
|
266
|
+
return map;
|
|
267
|
+
}
|
|
268
|
+
// The Events page's chips as a hunt keeps them.
|
|
269
|
+
function securityHuntFiltersFromMap(map) {
|
|
270
|
+
const filters = {};
|
|
271
|
+
for (const [key, values] of map.entries()) {
|
|
272
|
+
filters[key] = Array.from(values);
|
|
273
|
+
}
|
|
274
|
+
return readSecurityHuntFilters(filters);
|
|
275
|
+
}
|
|
276
|
+
/*
|
|
277
|
+
* Whether two sets of chips are the same filters: the same keys, each with
|
|
278
|
+
* the same values, in whatever order they were clicked.
|
|
279
|
+
*/
|
|
280
|
+
function areSecurityHuntFiltersEqual(a, b) {
|
|
281
|
+
const left = readSecurityHuntFilters(a);
|
|
282
|
+
const right = readSecurityHuntFilters(b);
|
|
283
|
+
const leftKeys = Object.keys(left).sort();
|
|
284
|
+
const rightKeys = Object.keys(right).sort();
|
|
285
|
+
if (leftKeys.join("\n") !== rightKeys.join("\n")) {
|
|
286
|
+
return false;
|
|
287
|
+
}
|
|
288
|
+
return leftKeys.every((key) => {
|
|
289
|
+
const leftValues = [...(left[key] || [])].sort();
|
|
290
|
+
const rightValues = [...(right[key] || [])].sort();
|
|
291
|
+
return (leftValues.length === rightValues.length &&
|
|
292
|
+
leftValues.every((value, index) => {
|
|
293
|
+
return value === rightValues[index];
|
|
294
|
+
}));
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
/*
|
|
298
|
+
* THE SCHEDULE'S RUNS.
|
|
299
|
+
*
|
|
300
|
+
* A run reads as far as SECURITY_HUNT_RUN_DELAY_IN_SECONDS behind the
|
|
301
|
+
* clock, as detection rules do, so an event is in the table before its
|
|
302
|
+
* moment is read. It reads from where the run before it stopped - from when
|
|
303
|
+
* the schedule was set, for the first - so every event is searched once.
|
|
304
|
+
* A run the workers could not make for a while (an outage, a failed run)
|
|
305
|
+
* reads what came in since, up to SECURITY_HUNT_MAX_CATCH_UP_IN_MINUTES
|
|
306
|
+
* more than one interval.
|
|
307
|
+
*/
|
|
308
|
+
exports.SECURITY_HUNT_RUN_DELAY_IN_SECONDS = DetectionFindingConstants_1.DETECTION_EVALUATION_DELAY_IN_SECONDS;
|
|
309
|
+
exports.SECURITY_HUNT_MAX_CATCH_UP_IN_MINUTES = 24 * 60;
|
|
310
|
+
/*
|
|
311
|
+
* How soon a run that failed is tried again: at its next interval, or
|
|
312
|
+
* within the hour when its interval is longer - a weekly hunt that failed
|
|
313
|
+
* once would otherwise say nothing for a week.
|
|
314
|
+
*/
|
|
315
|
+
exports.SECURITY_HUNT_RETRY_AFTER_FAILURE_IN_MINUTES = 60;
|
|
316
|
+
// Where a schedule set (or a search changed) now starts reading: from now on.
|
|
317
|
+
function getSecurityHuntSearchStart(now) {
|
|
318
|
+
return Date_1.default.addRemoveSeconds(now, -exports.SECURITY_HUNT_RUN_DELAY_IN_SECONDS);
|
|
319
|
+
}
|
|
320
|
+
/*
|
|
321
|
+
* The events a run made at `now` reads: from where the last one stopped
|
|
322
|
+
* (`searchedUpTo`), to SECURITY_HUNT_RUN_DELAY_IN_SECONDS before now. Null
|
|
323
|
+
* when the hunt does not run on its own, or there is nothing new to read.
|
|
324
|
+
*/
|
|
325
|
+
function getSecurityHuntRunWindow(data) {
|
|
326
|
+
const interval = getSecurityHuntIntervalInMinutes(data.schedule);
|
|
327
|
+
if (interval === null) {
|
|
328
|
+
return null;
|
|
329
|
+
}
|
|
330
|
+
const endTime = getSecurityHuntSearchStart(data.now);
|
|
331
|
+
const earliest = Date_1.default.addRemoveMinutes(endTime, -(interval + exports.SECURITY_HUNT_MAX_CATCH_UP_IN_MINUTES));
|
|
332
|
+
/*
|
|
333
|
+
* A read takes in both ends of its window, so a run starts a millisecond
|
|
334
|
+
* after the one before it stopped: an event at that moment is counted
|
|
335
|
+
* once.
|
|
336
|
+
*/
|
|
337
|
+
let startTime = data.searchedUpTo
|
|
338
|
+
? new Date(new Date(data.searchedUpTo).getTime() + 1)
|
|
339
|
+
: Date_1.default.addRemoveMinutes(endTime, -interval);
|
|
340
|
+
if (Number.isNaN(startTime.getTime())) {
|
|
341
|
+
startTime = Date_1.default.addRemoveMinutes(endTime, -interval);
|
|
342
|
+
}
|
|
343
|
+
if (startTime.getTime() < earliest.getTime()) {
|
|
344
|
+
startTime = earliest;
|
|
345
|
+
}
|
|
346
|
+
if (startTime.getTime() >= endTime.getTime()) {
|
|
347
|
+
return null;
|
|
348
|
+
}
|
|
349
|
+
return { startTime, endTime };
|
|
350
|
+
}
|
|
351
|
+
/*
|
|
352
|
+
* When a schedule is next due after a run made at `now`: one interval after
|
|
353
|
+
* the time it was due (so a daily hunt keeps its hour), or one interval from
|
|
354
|
+
* now when it ran later than that.
|
|
355
|
+
*/
|
|
356
|
+
function getNextSecurityHuntRunAt(data) {
|
|
357
|
+
const interval = getSecurityHuntIntervalInMinutes(data.schedule);
|
|
358
|
+
if (interval === null) {
|
|
359
|
+
return null;
|
|
360
|
+
}
|
|
361
|
+
if (data.dueAt) {
|
|
362
|
+
const next = Date_1.default.addRemoveMinutes(new Date(data.dueAt), interval);
|
|
363
|
+
if (next.getTime() > data.now.getTime()) {
|
|
364
|
+
return next;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
return Date_1.default.addRemoveMinutes(data.now, interval);
|
|
368
|
+
}
|
|
369
|
+
// When a run that failed at `now` is tried again.
|
|
370
|
+
function getSecurityHuntRetryAt(data) {
|
|
371
|
+
const interval = getSecurityHuntIntervalInMinutes(data.schedule);
|
|
372
|
+
if (interval === null) {
|
|
373
|
+
return null;
|
|
374
|
+
}
|
|
375
|
+
return Date_1.default.addRemoveMinutes(data.now, Math.min(interval, exports.SECURITY_HUNT_RETRY_AFTER_FAILURE_IN_MINUTES));
|
|
376
|
+
}
|
|
377
|
+
/*
|
|
378
|
+
* Why a run could not be made, in words the hunt's list says under its
|
|
379
|
+
* name. Dashboard translation keys, like the problems above.
|
|
380
|
+
*/
|
|
381
|
+
exports.SECURITY_HUNT_RUN_ERRORS = {
|
|
382
|
+
schedulerCannotRead: {
|
|
383
|
+
message: "The person it runs as can no longer read security events in this project. Edit the hunt and save it to run it as you.",
|
|
384
|
+
},
|
|
385
|
+
timedOut: {
|
|
386
|
+
message: "Its search took too long and was stopped. Narrow it with a field, such as user: or host:, rather than words alone.",
|
|
387
|
+
},
|
|
388
|
+
searchFailed: {
|
|
389
|
+
message: "Its search could not be run. Open the hunt to check it.",
|
|
390
|
+
},
|
|
391
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import commonJsModule from "./SecurityHunt.js";
|
|
2
|
+
export const DEFAULT_SECURITY_HUNT_TIME_RANGE = commonJsModule.DEFAULT_SECURITY_HUNT_TIME_RANGE;
|
|
3
|
+
export const SECURITY_HUNTS_PER_PROJECT_MAX = commonJsModule.SECURITY_HUNTS_PER_PROJECT_MAX;
|
|
4
|
+
export const SECURITY_HUNT_DESCRIPTION_MAX_LENGTH = commonJsModule.SECURITY_HUNT_DESCRIPTION_MAX_LENGTH;
|
|
5
|
+
export const SECURITY_HUNT_FILTER_VALUES_MAX = commonJsModule.SECURITY_HUNT_FILTER_VALUES_MAX;
|
|
6
|
+
export const SECURITY_HUNT_FILTER_VALUE_MAX_LENGTH = commonJsModule.SECURITY_HUNT_FILTER_VALUE_MAX_LENGTH;
|
|
7
|
+
export const SECURITY_HUNT_MAX_CATCH_UP_IN_MINUTES = commonJsModule.SECURITY_HUNT_MAX_CATCH_UP_IN_MINUTES;
|
|
8
|
+
export const SECURITY_HUNT_MESSAGES = commonJsModule.SECURITY_HUNT_MESSAGES;
|
|
9
|
+
export const SECURITY_HUNT_NAME_MAX_LENGTH = commonJsModule.SECURITY_HUNT_NAME_MAX_LENGTH;
|
|
10
|
+
export const SECURITY_HUNT_RECIPIENTS_MAX = commonJsModule.SECURITY_HUNT_RECIPIENTS_MAX;
|
|
11
|
+
export const SECURITY_HUNT_RETRY_AFTER_FAILURE_IN_MINUTES = commonJsModule.SECURITY_HUNT_RETRY_AFTER_FAILURE_IN_MINUTES;
|
|
12
|
+
export const SECURITY_HUNT_RUN_DELAY_IN_SECONDS = commonJsModule.SECURITY_HUNT_RUN_DELAY_IN_SECONDS;
|
|
13
|
+
export const SECURITY_HUNT_RUN_ERRORS = commonJsModule.SECURITY_HUNT_RUN_ERRORS;
|
|
14
|
+
export const SECURITY_HUNT_SCHEDULES = commonJsModule.SECURITY_HUNT_SCHEDULES;
|
|
15
|
+
export const SECURITY_HUNT_SEARCH_MAX_LENGTH = commonJsModule.SECURITY_HUNT_SEARCH_MAX_LENGTH;
|
|
16
|
+
export const SECURITY_HUNT_TIME_RANGES = commonJsModule.SECURITY_HUNT_TIME_RANGES;
|
|
17
|
+
export const SecurityHuntSchedule = commonJsModule.SecurityHuntSchedule;
|
|
18
|
+
export const areSecurityHuntFiltersEqual = commonJsModule.areSecurityHuntFiltersEqual;
|
|
19
|
+
export const countSecurityHuntFilterValues = commonJsModule.countSecurityHuntFilterValues;
|
|
20
|
+
export const getNextSecurityHuntRunAt = commonJsModule.getNextSecurityHuntRunAt;
|
|
21
|
+
export const getSecurityHuntIntervalInMinutes = commonJsModule.getSecurityHuntIntervalInMinutes;
|
|
22
|
+
export const getSecurityHuntProblems = commonJsModule.getSecurityHuntProblems;
|
|
23
|
+
export const getSecurityHuntRetryAt = commonJsModule.getSecurityHuntRetryAt;
|
|
24
|
+
export const getSecurityHuntRunWindow = commonJsModule.getSecurityHuntRunWindow;
|
|
25
|
+
export const getSecurityHuntSearchStart = commonJsModule.getSecurityHuntSearchStart;
|
|
26
|
+
export const getSecurityHuntTimeRangeForLength = commonJsModule.getSecurityHuntTimeRangeForLength;
|
|
27
|
+
export const isScheduledSecurityHunt = commonJsModule.isScheduledSecurityHunt;
|
|
28
|
+
export const isSecurityHuntSchedule = commonJsModule.isSecurityHuntSchedule;
|
|
29
|
+
export const isSecurityHuntTimeRange = commonJsModule.isSecurityHuntTimeRange;
|
|
30
|
+
export const readSecurityHuntFilters = commonJsModule.readSecurityHuntFilters;
|
|
31
|
+
export const securityHuntFiltersFromMap = commonJsModule.securityHuntFiltersFromMap;
|
|
32
|
+
export const securityHuntFiltersToMap = commonJsModule.securityHuntFiltersToMap;
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { SecurityEntityType } from "../SecurityCase/SecurityEntity.mjs";
|
|
2
|
+
import { ThreatIntelIndicatorType } from "./ThreatIntelConstants.mjs";
|
|
3
|
+
export declare enum SecurityWatchlistSource {
|
|
4
|
+
Values = "Values",
|
|
5
|
+
ThreatIntelFeed = "Threat Intel Feed"
|
|
6
|
+
}
|
|
7
|
+
export declare const SECURITY_WATCHLIST_SOURCES: ReadonlyArray<SecurityWatchlistSource>;
|
|
8
|
+
export declare const SECURITY_WATCHLIST_ENTITY_TYPES: ReadonlyArray<SecurityEntityType>;
|
|
9
|
+
export declare const SECURITY_WATCHLIST_FEED_INDICATOR_TYPES: Readonly<Partial<Record<SecurityEntityType, ReadonlyArray<ThreatIntelIndicatorType>>>>;
|
|
10
|
+
export declare const SECURITY_WATCHLIST_FEED_ENTITY_TYPES: ReadonlyArray<SecurityEntityType>;
|
|
11
|
+
export declare const SECURITY_WATCHLIST_SNIPPET_FIELDS: Readonly<Record<string, string>>;
|
|
12
|
+
export declare const SECURITY_WATCHLIST_DEFAULT_SNIPPET_FIELD: string;
|
|
13
|
+
export declare const SECURITY_WATCHLIST_MODIFIER: string;
|
|
14
|
+
export declare const SECURITY_WATCHLIST_PLACEHOLDER_MARK: string;
|
|
15
|
+
export declare const SECURITY_WATCHLIST_NAME_MAX_LENGTH: number;
|
|
16
|
+
export declare const SECURITY_WATCHLIST_DESCRIPTION_MAX_LENGTH: number;
|
|
17
|
+
export declare const SECURITY_WATCHLIST_VALUES_MAX: number;
|
|
18
|
+
export declare const SECURITY_WATCHLIST_PATTERN_VALUES_MAX: number;
|
|
19
|
+
export declare const SECURITY_WATCHLIST_RANGE_VALUES_MAX: number;
|
|
20
|
+
export declare const SECURITY_WATCHLIST_VALUE_MAX_LENGTH: number;
|
|
21
|
+
export declare const SECURITY_WATCHLIST_NOTE_MAX_LENGTH: number;
|
|
22
|
+
export declare const SECURITY_WATCHLISTS_PER_PROJECT_MAX: number;
|
|
23
|
+
export declare const SECURITY_WATCHLIST_IMPORT_MAX_CHARACTERS: number;
|
|
24
|
+
export declare const SECURITY_WATCHLIST_WILDCARD: string;
|
|
25
|
+
export declare const SECURITY_WATCHLIST_MESSAGES: {
|
|
26
|
+
enterValue: {
|
|
27
|
+
message: string;
|
|
28
|
+
};
|
|
29
|
+
loneWildcard: {
|
|
30
|
+
message: string;
|
|
31
|
+
};
|
|
32
|
+
valueTooLong: {
|
|
33
|
+
message: string;
|
|
34
|
+
};
|
|
35
|
+
valueNotOneLine: {
|
|
36
|
+
message: string;
|
|
37
|
+
};
|
|
38
|
+
notAnAddress: {
|
|
39
|
+
message: string;
|
|
40
|
+
};
|
|
41
|
+
notAHash: {
|
|
42
|
+
message: string;
|
|
43
|
+
};
|
|
44
|
+
noteTooLong: {
|
|
45
|
+
message: string;
|
|
46
|
+
};
|
|
47
|
+
enterName: {
|
|
48
|
+
message: string;
|
|
49
|
+
};
|
|
50
|
+
nameTooLong: {
|
|
51
|
+
message: string;
|
|
52
|
+
};
|
|
53
|
+
nameCharacters: {
|
|
54
|
+
message: string;
|
|
55
|
+
};
|
|
56
|
+
tooManyValues: {
|
|
57
|
+
message: string;
|
|
58
|
+
};
|
|
59
|
+
tooManyPatterns: {
|
|
60
|
+
message: string;
|
|
61
|
+
};
|
|
62
|
+
tooManyRanges: {
|
|
63
|
+
message: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
export declare enum SecurityWatchlistValueMatch {
|
|
67
|
+
Exact = "exact",
|
|
68
|
+
Pattern = "pattern",
|
|
69
|
+
Range = "range"
|
|
70
|
+
}
|
|
71
|
+
export interface SigmaWatchlist {
|
|
72
|
+
name: string;
|
|
73
|
+
entityType: SecurityEntityType;
|
|
74
|
+
exactValues: Array<string>;
|
|
75
|
+
patterns: Array<string>;
|
|
76
|
+
ranges: Array<string>;
|
|
77
|
+
threatIntelFeed?: {
|
|
78
|
+
projectId: string;
|
|
79
|
+
feedId: string;
|
|
80
|
+
indicatorTypes: Array<string>;
|
|
81
|
+
} | undefined;
|
|
82
|
+
}
|
|
83
|
+
export type SigmaWatchlists = Record<string, SigmaWatchlist>;
|
|
84
|
+
export declare function isSecurityWatchlistSource(value: unknown): value is SecurityWatchlistSource;
|
|
85
|
+
export declare function isSecurityWatchlistEntityType(value: unknown): value is SecurityEntityType;
|
|
86
|
+
export declare function canSecurityWatchlistFollowFeed(value: unknown): boolean;
|
|
87
|
+
export declare function getSecurityWatchlistFeedIndicatorTypes(entityType: unknown): Array<string>;
|
|
88
|
+
export declare function normalizeSecurityWatchlistName(value: unknown): string;
|
|
89
|
+
export declare function getSecurityWatchlistNameKey(value: unknown): string;
|
|
90
|
+
export declare function isSecurityWatchlistName(value: unknown): boolean;
|
|
91
|
+
export declare function getSecurityWatchlistPlaceholder(name: string): string;
|
|
92
|
+
export declare function readSecurityWatchlistPlaceholder(value: unknown): string | null;
|
|
93
|
+
export declare function getMissingSecurityWatchlistsMessage(names: ReadonlyArray<string>): string;
|
|
94
|
+
export declare function getSecurityWatchlistSnippetField(entityType: unknown): string;
|
|
95
|
+
export declare function getSecurityWatchlistRuleSnippet(data: {
|
|
96
|
+
name: string;
|
|
97
|
+
entityType: unknown;
|
|
98
|
+
}): string;
|
|
99
|
+
export declare function normalizeSecurityWatchlistValue(value: unknown): string;
|
|
100
|
+
export declare function getSecurityWatchlistValueKey(value: unknown): string;
|
|
101
|
+
export declare function normalizeSecurityWatchlistNote(value: unknown): string;
|
|
102
|
+
export declare function getSecurityWatchlistValueMatch(data: {
|
|
103
|
+
value: string;
|
|
104
|
+
entityType: unknown;
|
|
105
|
+
}): SecurityWatchlistValueMatch;
|
|
106
|
+
export declare function getSecurityWatchlistValueProblem(data: {
|
|
107
|
+
value: unknown;
|
|
108
|
+
entityType: unknown;
|
|
109
|
+
}): string | null;
|
|
110
|
+
export declare function getSecurityWatchlistNoteProblem(value: unknown): string | null;
|
|
111
|
+
export type SecurityWatchlistFormField = "name" | "entityType" | "description" | "source" | "threatIntelFeedId";
|
|
112
|
+
export interface SecurityWatchlistProblem {
|
|
113
|
+
field: SecurityWatchlistFormField;
|
|
114
|
+
message: string;
|
|
115
|
+
}
|
|
116
|
+
export interface SecurityWatchlistShape {
|
|
117
|
+
name?: string | null | undefined;
|
|
118
|
+
entityType?: string | null | undefined;
|
|
119
|
+
description?: string | null | undefined;
|
|
120
|
+
source?: string | null | undefined;
|
|
121
|
+
threatIntelFeedId?: unknown;
|
|
122
|
+
}
|
|
123
|
+
export declare function getSecurityWatchlistNameProblem(value: unknown): string | null;
|
|
124
|
+
export declare function getSecurityWatchlistProblems(watchlist: SecurityWatchlistShape): Array<SecurityWatchlistProblem>;
|
|
125
|
+
export declare function getSecurityWatchlistProblem(watchlist: SecurityWatchlistShape): string | null;
|
|
126
|
+
export interface SecurityWatchlistImportValue {
|
|
127
|
+
value: string;
|
|
128
|
+
note: string;
|
|
129
|
+
}
|
|
130
|
+
export interface SecurityWatchlistImportProblem {
|
|
131
|
+
line: number;
|
|
132
|
+
value: string;
|
|
133
|
+
message: string;
|
|
134
|
+
}
|
|
135
|
+
export interface SecurityWatchlistImportResult {
|
|
136
|
+
values: Array<SecurityWatchlistImportValue>;
|
|
137
|
+
problems: Array<SecurityWatchlistImportProblem>;
|
|
138
|
+
duplicates: number;
|
|
139
|
+
}
|
|
140
|
+
export declare enum SecurityWatchlistImportMode {
|
|
141
|
+
Add = "add",
|
|
142
|
+
Replace = "replace"
|
|
143
|
+
}
|
|
144
|
+
export declare function isSecurityWatchlistImportMode(value: unknown): value is SecurityWatchlistImportMode;
|
|
145
|
+
export declare function readSecurityWatchlistImportLine(line: string): {
|
|
146
|
+
value: string;
|
|
147
|
+
note: string;
|
|
148
|
+
};
|
|
149
|
+
export declare function parseSecurityWatchlistImport(data: {
|
|
150
|
+
text: string;
|
|
151
|
+
entityType: unknown;
|
|
152
|
+
}): SecurityWatchlistImportResult;
|
|
153
|
+
export interface SecurityWatchlistValueCounts {
|
|
154
|
+
total: number;
|
|
155
|
+
patterns: number;
|
|
156
|
+
ranges: number;
|
|
157
|
+
}
|
|
158
|
+
export declare function countSecurityWatchlistValues(data: {
|
|
159
|
+
values: ReadonlyArray<string>;
|
|
160
|
+
entityType: unknown;
|
|
161
|
+
}): SecurityWatchlistValueCounts;
|
|
162
|
+
export declare function getSecurityWatchlistSizeProblem(counts: SecurityWatchlistValueCounts): string | null;
|
|
163
|
+
export declare function splitSecurityWatchlistValues(data: {
|
|
164
|
+
values: ReadonlyArray<string>;
|
|
165
|
+
entityType: unknown;
|
|
166
|
+
}): Pick<SigmaWatchlist, "exactValues" | "patterns" | "ranges">;
|
|
167
|
+
export declare function matchesSecurityWatchlistPattern(pattern: string, value: string): boolean;
|