@cyvest/cyvest-js 5.4.1 → 6.0.0
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/README.md +1 -1
- package/dist/index.cjs +496 -196
- package/dist/index.d.cts +165 -107
- package/dist/index.d.ts +165 -107
- package/dist/index.js +477 -179
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
type InvestigationName = string | null;
|
|
5
5
|
/**
|
|
6
|
-
* Security level classification for
|
|
6
|
+
* Security level classification for findings, observables, and threat intelligence.
|
|
7
7
|
*
|
|
8
8
|
* Levels are ordered from lowest (NONE) to highest (MALICIOUS) severity.
|
|
9
9
|
*/
|
|
@@ -22,6 +22,8 @@ type Reason = string | null;
|
|
|
22
22
|
type Tool = string | null;
|
|
23
23
|
type ObjectType = string | null;
|
|
24
24
|
type ObjectKey = string | null;
|
|
25
|
+
type Subtype = string | null;
|
|
26
|
+
type Namespace = string | null;
|
|
25
27
|
type ThreatIntels = string[];
|
|
26
28
|
/**
|
|
27
29
|
* Direction of a relationship between observables.
|
|
@@ -29,16 +31,23 @@ type ThreatIntels = string[];
|
|
|
29
31
|
type RelationshipDirection = "outbound" | "inbound" | "bidirectional";
|
|
30
32
|
type Relationships = Relationship[];
|
|
31
33
|
/**
|
|
32
|
-
*
|
|
34
|
+
* Findings that currently link to this observable (navigation-only).
|
|
33
35
|
*/
|
|
34
|
-
type
|
|
36
|
+
type FindingLinks = string[];
|
|
35
37
|
/**
|
|
36
|
-
* Controls how a
|
|
38
|
+
* Controls how a Finding↔Observable link propagates across merged investigations.
|
|
37
39
|
*/
|
|
38
40
|
type PropagationMode = "LOCAL_ONLY" | "GLOBAL";
|
|
39
41
|
type ObservableLinks = ObservableLink[];
|
|
42
|
+
type EvidenceLinks = EvidenceLink[];
|
|
43
|
+
type ExternalId = string | null;
|
|
44
|
+
type Uri = string | null;
|
|
45
|
+
/**
|
|
46
|
+
* Findings that currently link to this evidence (navigation-only).
|
|
47
|
+
*/
|
|
48
|
+
type FindingLinks1 = string[];
|
|
40
49
|
type Taxonomies = Taxonomy[];
|
|
41
|
-
type
|
|
50
|
+
type Findings1 = string[];
|
|
42
51
|
/**
|
|
43
52
|
* Root observable type used during data extraction.
|
|
44
53
|
*/
|
|
@@ -58,6 +67,7 @@ type ScoreMode = "max" | "sum";
|
|
|
58
67
|
* schemas matching the actual model_dump() output.
|
|
59
68
|
*/
|
|
60
69
|
interface CyvestInvestigation {
|
|
70
|
+
schema_version?: "6.0.0";
|
|
61
71
|
/**
|
|
62
72
|
* Stable investigation identity (ULID).
|
|
63
73
|
*/
|
|
@@ -75,7 +85,8 @@ interface CyvestInvestigation {
|
|
|
75
85
|
whitelists: Whitelists;
|
|
76
86
|
audit_log?: AuditLog;
|
|
77
87
|
observables: Observables;
|
|
78
|
-
|
|
88
|
+
findings: Findings;
|
|
89
|
+
evidences: Evidences;
|
|
79
90
|
threat_intels: ThreatIntels1;
|
|
80
91
|
enrichments: Enrichments;
|
|
81
92
|
tags: Tags;
|
|
@@ -122,11 +133,13 @@ interface Observables {
|
|
|
122
133
|
/**
|
|
123
134
|
* Represents a cyber observable (IP, URL, domain, hash, etc.).
|
|
124
135
|
*
|
|
125
|
-
* Observables can be linked to threat intelligence,
|
|
136
|
+
* Observables can be linked to threat intelligence, findings, and other observables
|
|
126
137
|
* through relationships.
|
|
127
138
|
*/
|
|
128
139
|
interface Observable {
|
|
129
140
|
type: string;
|
|
141
|
+
subtype?: Subtype;
|
|
142
|
+
namespace?: Namespace;
|
|
130
143
|
value: string;
|
|
131
144
|
internal: boolean;
|
|
132
145
|
whitelisted: boolean;
|
|
@@ -137,7 +150,7 @@ interface Observable {
|
|
|
137
150
|
threat_intels: ThreatIntels;
|
|
138
151
|
relationships: Relationships;
|
|
139
152
|
key: string;
|
|
140
|
-
|
|
153
|
+
finding_links: FindingLinks;
|
|
141
154
|
score_display: string;
|
|
142
155
|
[k: string]: unknown;
|
|
143
156
|
}
|
|
@@ -154,19 +167,19 @@ interface Relationship {
|
|
|
154
167
|
[k: string]: unknown;
|
|
155
168
|
}
|
|
156
169
|
/**
|
|
157
|
-
*
|
|
170
|
+
* Findings keyed by their unique key.
|
|
158
171
|
*/
|
|
159
|
-
interface
|
|
160
|
-
[k: string]:
|
|
172
|
+
interface Findings {
|
|
173
|
+
[k: string]: Finding;
|
|
161
174
|
}
|
|
162
175
|
/**
|
|
163
176
|
* Represents a verification step in the investigation.
|
|
164
177
|
*
|
|
165
|
-
* A
|
|
178
|
+
* A finding validates a specific aspect of the data under investigation
|
|
166
179
|
* and contributes to the overall investigation score.
|
|
167
180
|
*/
|
|
168
|
-
interface
|
|
169
|
-
|
|
181
|
+
interface Finding {
|
|
182
|
+
finding_name: string;
|
|
170
183
|
description: string;
|
|
171
184
|
comment: string;
|
|
172
185
|
extra: Extra1;
|
|
@@ -174,6 +187,7 @@ interface Check {
|
|
|
174
187
|
level: Level;
|
|
175
188
|
origin_investigation_id: string;
|
|
176
189
|
observable_links: ObservableLinks;
|
|
190
|
+
evidence_links: EvidenceLinks;
|
|
177
191
|
key: string;
|
|
178
192
|
score_display: string;
|
|
179
193
|
[k: string]: unknown;
|
|
@@ -182,12 +196,44 @@ interface Extra1 {
|
|
|
182
196
|
[k: string]: unknown;
|
|
183
197
|
}
|
|
184
198
|
/**
|
|
185
|
-
* Edge metadata for a
|
|
199
|
+
* Edge metadata for a Finding↔Observable association.
|
|
186
200
|
*/
|
|
187
201
|
interface ObservableLink {
|
|
188
202
|
observable_key: string;
|
|
189
203
|
propagation_mode?: PropagationMode;
|
|
190
204
|
}
|
|
205
|
+
/**
|
|
206
|
+
* Edge metadata for a Finding↔Evidence association.
|
|
207
|
+
*/
|
|
208
|
+
interface EvidenceLink {
|
|
209
|
+
evidence_key: string;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Evidence objects keyed by their unique key.
|
|
213
|
+
*/
|
|
214
|
+
interface Evidences {
|
|
215
|
+
[k: string]: Evidence;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Structured material supporting one or more findings.
|
|
219
|
+
*/
|
|
220
|
+
interface Evidence {
|
|
221
|
+
type: string;
|
|
222
|
+
title: string;
|
|
223
|
+
description: string;
|
|
224
|
+
source: string;
|
|
225
|
+
external_id: ExternalId;
|
|
226
|
+
content: unknown;
|
|
227
|
+
uri: Uri;
|
|
228
|
+
captured_at: string;
|
|
229
|
+
extra: Extra2;
|
|
230
|
+
key: string;
|
|
231
|
+
finding_links: FindingLinks1;
|
|
232
|
+
[k: string]: unknown;
|
|
233
|
+
}
|
|
234
|
+
interface Extra2 {
|
|
235
|
+
[k: string]: unknown;
|
|
236
|
+
}
|
|
191
237
|
/**
|
|
192
238
|
* Threat intelligence entries keyed by their unique key.
|
|
193
239
|
*/
|
|
@@ -204,7 +250,7 @@ interface ThreatIntel {
|
|
|
204
250
|
source: string;
|
|
205
251
|
observable_key: string;
|
|
206
252
|
comment: string;
|
|
207
|
-
extra:
|
|
253
|
+
extra: Extra3;
|
|
208
254
|
score: number;
|
|
209
255
|
level: Level;
|
|
210
256
|
taxonomies: Taxonomies;
|
|
@@ -212,7 +258,7 @@ interface ThreatIntel {
|
|
|
212
258
|
score_display: string;
|
|
213
259
|
[k: string]: unknown;
|
|
214
260
|
}
|
|
215
|
-
interface
|
|
261
|
+
interface Extra3 {
|
|
216
262
|
[k: string]: unknown;
|
|
217
263
|
}
|
|
218
264
|
/**
|
|
@@ -252,7 +298,7 @@ interface Tags {
|
|
|
252
298
|
[k: string]: Tag;
|
|
253
299
|
}
|
|
254
300
|
/**
|
|
255
|
-
* Groups
|
|
301
|
+
* Groups findings for categorical organization.
|
|
256
302
|
*
|
|
257
303
|
* Tags allow structuring the investigation into logical sections
|
|
258
304
|
* with aggregated scores and levels. Hierarchy is automatic based on
|
|
@@ -261,16 +307,16 @@ interface Tags {
|
|
|
261
307
|
interface Tag {
|
|
262
308
|
name: string;
|
|
263
309
|
description?: string;
|
|
264
|
-
|
|
310
|
+
findings: Findings1;
|
|
265
311
|
key: string;
|
|
266
312
|
/**
|
|
267
|
-
* Calculate the score from direct
|
|
313
|
+
* Calculate the score from direct findings only (no hierarchy).
|
|
268
314
|
*
|
|
269
315
|
* For hierarchical aggregation (including descendant tags), use
|
|
270
316
|
* Investigation.get_tag_aggregated_score() or TagProxy.get_aggregated_score().
|
|
271
317
|
*
|
|
272
318
|
* Returns:
|
|
273
|
-
* Total score from direct
|
|
319
|
+
* Total score from direct findings
|
|
274
320
|
*/
|
|
275
321
|
direct_score: number;
|
|
276
322
|
direct_level: Level;
|
|
@@ -288,9 +334,12 @@ interface StatisticsSchema {
|
|
|
288
334
|
observables_by_type?: ObservablesByType;
|
|
289
335
|
observables_by_level?: ObservablesByLevel;
|
|
290
336
|
observables_by_type_and_level?: ObservablesByTypeAndLevel;
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
337
|
+
total_findings: number;
|
|
338
|
+
applied_findings: number;
|
|
339
|
+
findings_by_level?: FindingsByLevel;
|
|
340
|
+
total_evidences: number;
|
|
341
|
+
evidences_by_type?: EvidencesByType;
|
|
342
|
+
evidences_by_source?: EvidencesBySource;
|
|
294
343
|
total_threat_intel: number;
|
|
295
344
|
threat_intel_by_source?: ThreatIntelBySource;
|
|
296
345
|
threat_intel_by_level?: ThreatIntelByLevel;
|
|
@@ -307,9 +356,15 @@ interface ObservablesByTypeAndLevel {
|
|
|
307
356
|
[k: string]: number;
|
|
308
357
|
};
|
|
309
358
|
}
|
|
310
|
-
interface
|
|
359
|
+
interface FindingsByLevel {
|
|
311
360
|
[k: string]: string[];
|
|
312
361
|
}
|
|
362
|
+
interface EvidencesByType {
|
|
363
|
+
[k: string]: number;
|
|
364
|
+
}
|
|
365
|
+
interface EvidencesBySource {
|
|
366
|
+
[k: string]: number;
|
|
367
|
+
}
|
|
313
368
|
interface ThreatIntelBySource {
|
|
314
369
|
[k: string]: number;
|
|
315
370
|
}
|
|
@@ -336,7 +391,7 @@ declare function isCyvest(json: unknown): json is CyvestInvestigation;
|
|
|
336
391
|
/**
|
|
337
392
|
* Key type prefixes used in Cyvest.
|
|
338
393
|
*/
|
|
339
|
-
type KeyType = "obs" | "
|
|
394
|
+
type KeyType = "obs" | "fnd" | "evd" | "ti" | "enr" | "tag";
|
|
340
395
|
/**
|
|
341
396
|
* Generate a unique key for an observable.
|
|
342
397
|
*
|
|
@@ -352,22 +407,22 @@ type KeyType = "obs" | "chk" | "ti" | "enr" | "tag";
|
|
|
352
407
|
* // => "obs:ipv4:192.168.1.1"
|
|
353
408
|
* ```
|
|
354
409
|
*/
|
|
355
|
-
declare function generateObservableKey(obsType: string, value: string): string;
|
|
410
|
+
declare function generateObservableKey(obsType: string, value: string, subtype?: string, namespace?: string): string;
|
|
356
411
|
/**
|
|
357
|
-
* Generate a unique key for a
|
|
412
|
+
* Generate a unique key for a finding.
|
|
358
413
|
*
|
|
359
|
-
* Format:
|
|
414
|
+
* Format: fnd:{finding_name}
|
|
360
415
|
*
|
|
361
|
-
* @param
|
|
362
|
-
* @returns Unique
|
|
416
|
+
* @param findingName - Name of the finding
|
|
417
|
+
* @returns Unique finding key
|
|
363
418
|
*
|
|
364
419
|
* @example
|
|
365
420
|
* ```ts
|
|
366
|
-
*
|
|
367
|
-
* // => "
|
|
421
|
+
* generateFindingKey("sender_verification")
|
|
422
|
+
* // => "fnd:sender_verification"
|
|
368
423
|
* ```
|
|
369
424
|
*/
|
|
370
|
-
declare function
|
|
425
|
+
declare function generateFindingKey(findingName: string): string;
|
|
371
426
|
/**
|
|
372
427
|
* Generate a unique key for threat intelligence.
|
|
373
428
|
*
|
|
@@ -463,7 +518,7 @@ declare function isTagDescendantOf(descendantName: string, ancestorName: string)
|
|
|
463
518
|
* Extract the type prefix from a key.
|
|
464
519
|
*
|
|
465
520
|
* @param key - The key to parse
|
|
466
|
-
* @returns Type prefix (obs,
|
|
521
|
+
* @returns Type prefix (obs, fnd, evd, ti, enr, tag) or null if invalid
|
|
467
522
|
*
|
|
468
523
|
* @example
|
|
469
524
|
* ```ts
|
|
@@ -473,7 +528,7 @@ declare function isTagDescendantOf(descendantName: string, ancestorName: string)
|
|
|
473
528
|
*/
|
|
474
529
|
declare function parseKeyType(key: string): KeyType | null;
|
|
475
530
|
/**
|
|
476
|
-
* Validate a key format and optionally
|
|
531
|
+
* Validate a key format and optionally finding its type.
|
|
477
532
|
*
|
|
478
533
|
* @param key - The key to validate
|
|
479
534
|
* @param expectedType - Optional expected type prefix
|
|
@@ -505,19 +560,19 @@ declare function parseObservableKey(key: string): {
|
|
|
505
560
|
value: string;
|
|
506
561
|
} | null;
|
|
507
562
|
/**
|
|
508
|
-
* Extract components from a
|
|
563
|
+
* Extract components from a finding key.
|
|
509
564
|
*
|
|
510
|
-
* @param key -
|
|
511
|
-
* @returns Object with
|
|
565
|
+
* @param key - Finding key to parse
|
|
566
|
+
* @returns Object with findingName, or null if invalid
|
|
512
567
|
*
|
|
513
568
|
* @example
|
|
514
569
|
* ```ts
|
|
515
|
-
*
|
|
516
|
-
* // => {
|
|
570
|
+
* parseFindingKey("fnd:sender_verification")
|
|
571
|
+
* // => { findingName: "sender_verification" }
|
|
517
572
|
* ```
|
|
518
573
|
*/
|
|
519
|
-
declare function
|
|
520
|
-
|
|
574
|
+
declare function parseFindingKey(key: string): {
|
|
575
|
+
findingName: string;
|
|
521
576
|
} | null;
|
|
522
577
|
/**
|
|
523
578
|
* Extract components from a threat intel key.
|
|
@@ -574,7 +629,7 @@ declare function normalizeLevel(level: string): Level;
|
|
|
574
629
|
/**
|
|
575
630
|
* Check if a string is a valid Level.
|
|
576
631
|
*
|
|
577
|
-
* @param level - String to
|
|
632
|
+
* @param level - String to finding
|
|
578
633
|
* @returns True if valid Level
|
|
579
634
|
*/
|
|
580
635
|
declare function isValidLevel(level: string): level is Level;
|
|
@@ -641,7 +696,7 @@ declare function isLevelLowerThan(a: Level, b: Level): boolean;
|
|
|
641
696
|
/**
|
|
642
697
|
* Check if level a is at least as severe as level b.
|
|
643
698
|
*
|
|
644
|
-
* @param a - Level to
|
|
699
|
+
* @param a - Level to finding
|
|
645
700
|
* @param minLevel - Minimum required level
|
|
646
701
|
* @returns True if a is at least minLevel
|
|
647
702
|
*
|
|
@@ -688,9 +743,9 @@ declare function hasLevel(obj: unknown): obj is {
|
|
|
688
743
|
level: Level;
|
|
689
744
|
};
|
|
690
745
|
/**
|
|
691
|
-
* Extract level from an entity (Observable,
|
|
746
|
+
* Extract level from an entity (Observable, Finding, ThreatIntel, Tag).
|
|
692
747
|
*/
|
|
693
|
-
declare function getEntityLevel(entity: Observable |
|
|
748
|
+
declare function getEntityLevel(entity: Observable | Finding | ThreatIntel | Tag): Level;
|
|
694
749
|
|
|
695
750
|
/**
|
|
696
751
|
* Get an observable by its key.
|
|
@@ -721,7 +776,7 @@ declare function getObservable(inv: CyvestInvestigation, key: string): Observabl
|
|
|
721
776
|
* const obs = getObservableByTypeValue(investigation, "ipv4", "192.168.1.1");
|
|
722
777
|
* ```
|
|
723
778
|
*/
|
|
724
|
-
declare function getObservableByTypeValue(inv: CyvestInvestigation, type: string, value: string): Observable | undefined;
|
|
779
|
+
declare function getObservableByTypeValue(inv: CyvestInvestigation, type: string, value: string, subtype?: string, namespace?: string): Observable | undefined;
|
|
725
780
|
/**
|
|
726
781
|
* Get the root observable of the investigation.
|
|
727
782
|
*
|
|
@@ -741,44 +796,46 @@ declare function getObservableByTypeValue(inv: CyvestInvestigation, type: string
|
|
|
741
796
|
*/
|
|
742
797
|
declare function getRootObservable(inv: CyvestInvestigation): Observable | undefined;
|
|
743
798
|
/**
|
|
744
|
-
* Get a
|
|
799
|
+
* Get a finding by its key.
|
|
745
800
|
*
|
|
746
801
|
* @param inv - The investigation to search
|
|
747
|
-
* @param key -
|
|
748
|
-
* @returns The
|
|
802
|
+
* @param key - Finding key (e.g., "fnd:sender_verification:email_headers")
|
|
803
|
+
* @returns The finding or undefined if not found
|
|
749
804
|
*
|
|
750
805
|
* @example
|
|
751
806
|
* ```ts
|
|
752
|
-
* const
|
|
807
|
+
* const finding = getFinding(investigation, "fnd:sender_verification:email_headers");
|
|
753
808
|
* ```
|
|
754
809
|
*/
|
|
755
|
-
declare function
|
|
810
|
+
declare function getFinding(inv: CyvestInvestigation, key: string): Finding | undefined;
|
|
756
811
|
/**
|
|
757
|
-
* Get a
|
|
812
|
+
* Get a finding by its name.
|
|
758
813
|
*
|
|
759
814
|
* @param inv - The investigation to search
|
|
760
|
-
* @param
|
|
761
|
-
* @returns The
|
|
815
|
+
* @param findingName - Finding name
|
|
816
|
+
* @returns The finding or undefined if not found
|
|
762
817
|
*
|
|
763
818
|
* @example
|
|
764
819
|
* ```ts
|
|
765
|
-
* const
|
|
820
|
+
* const finding = getFindingByName(investigation, "sender_verification");
|
|
766
821
|
* ```
|
|
767
822
|
*/
|
|
768
|
-
declare function
|
|
823
|
+
declare function getFindingByName(inv: CyvestInvestigation, findingName: string): Finding | undefined;
|
|
769
824
|
/**
|
|
770
|
-
* Get all
|
|
825
|
+
* Get all findings as an array.
|
|
771
826
|
*
|
|
772
827
|
* @param inv - The investigation
|
|
773
|
-
* @returns Array of all
|
|
828
|
+
* @returns Array of all findings
|
|
774
829
|
*
|
|
775
830
|
* @example
|
|
776
831
|
* ```ts
|
|
777
|
-
* const
|
|
778
|
-
* console.log(`Total
|
|
832
|
+
* const allFindings = getAllFindings(investigation);
|
|
833
|
+
* console.log(`Total findings: ${allFindings.length}`);
|
|
779
834
|
* ```
|
|
780
835
|
*/
|
|
781
|
-
declare function
|
|
836
|
+
declare function getAllFindings(inv: CyvestInvestigation): Finding[];
|
|
837
|
+
declare function getEvidence(inv: CyvestInvestigation, key: string): Evidence | undefined;
|
|
838
|
+
declare function getAllEvidences(inv: CyvestInvestigation): Evidence[];
|
|
782
839
|
/**
|
|
783
840
|
* Get a threat intel entry by its key.
|
|
784
841
|
*
|
|
@@ -901,7 +958,8 @@ declare function getDataExtraction(inv: CyvestInvestigation): DataExtractionSche
|
|
|
901
958
|
*/
|
|
902
959
|
interface InvestigationCounts {
|
|
903
960
|
observables: number;
|
|
904
|
-
|
|
961
|
+
findings: number;
|
|
962
|
+
evidences: number;
|
|
905
963
|
threatIntels: number;
|
|
906
964
|
enrichments: number;
|
|
907
965
|
tags: number;
|
|
@@ -963,7 +1021,7 @@ declare function getTagDescendants(inv: CyvestInvestigation, tagName: string): T
|
|
|
963
1021
|
* Get the aggregated score for a tag including all descendant tags.
|
|
964
1022
|
*
|
|
965
1023
|
* The aggregated score includes:
|
|
966
|
-
* - The tag's direct_score (from its direct
|
|
1024
|
+
* - The tag's direct_score (from its direct findings)
|
|
967
1025
|
* - Recursively, the aggregated scores of all child tags
|
|
968
1026
|
*
|
|
969
1027
|
* @param inv - The investigation
|
|
@@ -999,7 +1057,7 @@ declare function getTagAggregatedLevel(inv: CyvestInvestigation, tagName: string
|
|
|
999
1057
|
* Finder utilities for querying and filtering Cyvest Investigation data.
|
|
1000
1058
|
*
|
|
1001
1059
|
* These functions provide filtering, searching, and cross-referencing
|
|
1002
|
-
* capabilities for observables,
|
|
1060
|
+
* capabilities for observables, findings, and threat intel.
|
|
1003
1061
|
*/
|
|
1004
1062
|
|
|
1005
1063
|
/**
|
|
@@ -1098,29 +1156,29 @@ declare function findWhitelistedObservables(inv: CyvestInvestigation): Observabl
|
|
|
1098
1156
|
*/
|
|
1099
1157
|
declare function findObservablesWithThreatIntel(inv: CyvestInvestigation): Observable[];
|
|
1100
1158
|
/**
|
|
1101
|
-
* Find all
|
|
1159
|
+
* Find all findings at a specific level.
|
|
1102
1160
|
*
|
|
1103
1161
|
* @param inv - The investigation to search
|
|
1104
1162
|
* @param level - Security level to filter by
|
|
1105
|
-
* @returns Array of matching
|
|
1163
|
+
* @returns Array of matching findings
|
|
1106
1164
|
*/
|
|
1107
|
-
declare function
|
|
1165
|
+
declare function findFindingsByLevel(inv: CyvestInvestigation, level: Level): Finding[];
|
|
1108
1166
|
/**
|
|
1109
|
-
* Find all
|
|
1167
|
+
* Find all findings at or above a minimum level.
|
|
1110
1168
|
*
|
|
1111
1169
|
* @param inv - The investigation to search
|
|
1112
1170
|
* @param minLevel - Minimum security level
|
|
1113
|
-
* @returns Array of matching
|
|
1171
|
+
* @returns Array of matching findings
|
|
1114
1172
|
*/
|
|
1115
|
-
declare function
|
|
1173
|
+
declare function findFindingsAtLeast(inv: CyvestInvestigation, minLevel: Level): Finding[];
|
|
1116
1174
|
/**
|
|
1117
|
-
* Find
|
|
1175
|
+
* Find findings by finding name.
|
|
1118
1176
|
*
|
|
1119
1177
|
* @param inv - The investigation to search
|
|
1120
|
-
* @param
|
|
1121
|
-
* @returns The matching
|
|
1178
|
+
* @param findingName - Finding name to search for
|
|
1179
|
+
* @returns The matching finding or undefined
|
|
1122
1180
|
*/
|
|
1123
|
-
declare function
|
|
1181
|
+
declare function findFindingByName(inv: CyvestInvestigation, findingName: string): Finding | undefined;
|
|
1124
1182
|
/**
|
|
1125
1183
|
* Find all threat intel from a specific source.
|
|
1126
1184
|
*
|
|
@@ -1170,18 +1228,18 @@ declare function findTagsAtLeast(inv: CyvestInvestigation, minLevel: Level): Tag
|
|
|
1170
1228
|
*/
|
|
1171
1229
|
declare function findTagsByNamePattern(inv: CyvestInvestigation, pattern: RegExp): Tag[];
|
|
1172
1230
|
/**
|
|
1173
|
-
* Find all
|
|
1231
|
+
* Find all findings that generated or reference a specific observable.
|
|
1174
1232
|
*
|
|
1175
1233
|
* @param inv - The investigation to search
|
|
1176
1234
|
* @param observableKey - Key of the observable
|
|
1177
|
-
* @returns Array of
|
|
1235
|
+
* @returns Array of findings that reference this observable
|
|
1178
1236
|
*
|
|
1179
1237
|
* @example
|
|
1180
1238
|
* ```ts
|
|
1181
|
-
* const
|
|
1239
|
+
* const findings = findFindingsForObservable(investigation, "obs:ipv4:192.168.1.1");
|
|
1182
1240
|
* ```
|
|
1183
1241
|
*/
|
|
1184
|
-
declare function
|
|
1242
|
+
declare function findFindingsForObservable(inv: CyvestInvestigation, observableKey: string): Finding[];
|
|
1185
1243
|
/**
|
|
1186
1244
|
* Find all threat intel entries for a specific observable.
|
|
1187
1245
|
*
|
|
@@ -1191,22 +1249,22 @@ declare function findChecksForObservable(inv: CyvestInvestigation, observableKey
|
|
|
1191
1249
|
*/
|
|
1192
1250
|
declare function findThreatIntelsForObservable(inv: CyvestInvestigation, observableKey: string): ThreatIntel[];
|
|
1193
1251
|
/**
|
|
1194
|
-
* Find all observables referenced by a specific
|
|
1252
|
+
* Find all observables referenced by a specific finding.
|
|
1195
1253
|
*
|
|
1196
1254
|
* @param inv - The investigation to search
|
|
1197
|
-
* @param
|
|
1198
|
-
* @returns Array of observables referenced by this
|
|
1255
|
+
* @param findingKey - Key of the finding
|
|
1256
|
+
* @returns Array of observables referenced by this finding
|
|
1199
1257
|
*/
|
|
1200
|
-
declare function
|
|
1258
|
+
declare function findObservablesForFinding(inv: CyvestInvestigation, findingKey: string): Observable[];
|
|
1201
1259
|
/**
|
|
1202
|
-
* Find all
|
|
1260
|
+
* Find all findings for a specific tag.
|
|
1203
1261
|
*
|
|
1204
1262
|
* @param inv - The investigation to search
|
|
1205
1263
|
* @param tagKey - Key of the tag
|
|
1206
|
-
* @param recursive - Include
|
|
1207
|
-
* @returns Array of
|
|
1264
|
+
* @param recursive - Include findings from descendant tags (default: false)
|
|
1265
|
+
* @returns Array of findings in the tag
|
|
1208
1266
|
*/
|
|
1209
|
-
declare function
|
|
1267
|
+
declare function findFindingsForTag(inv: CyvestInvestigation, tagKey: string, recursive?: boolean): Finding[];
|
|
1210
1268
|
/**
|
|
1211
1269
|
* Sort observables by score (descending - highest first).
|
|
1212
1270
|
*
|
|
@@ -1215,12 +1273,12 @@ declare function findChecksForTag(inv: CyvestInvestigation, tagKey: string, recu
|
|
|
1215
1273
|
*/
|
|
1216
1274
|
declare function sortObservablesByScore(observables: Observable[]): Observable[];
|
|
1217
1275
|
/**
|
|
1218
|
-
* Sort
|
|
1276
|
+
* Sort findings by score (descending - highest first).
|
|
1219
1277
|
*
|
|
1220
|
-
* @param
|
|
1278
|
+
* @param findings - Array of findings to sort
|
|
1221
1279
|
* @returns Sorted array (new array, doesn't mutate input)
|
|
1222
1280
|
*/
|
|
1223
|
-
declare function
|
|
1281
|
+
declare function sortFindingsByScore(findings: Finding[]): Finding[];
|
|
1224
1282
|
/**
|
|
1225
1283
|
* Sort observables by level (descending - most severe first).
|
|
1226
1284
|
*
|
|
@@ -1229,12 +1287,12 @@ declare function sortChecksByScore(checks: Check[]): Check[];
|
|
|
1229
1287
|
*/
|
|
1230
1288
|
declare function sortObservablesByLevel(observables: Observable[]): Observable[];
|
|
1231
1289
|
/**
|
|
1232
|
-
* Sort
|
|
1290
|
+
* Sort findings by level (descending - most severe first).
|
|
1233
1291
|
*
|
|
1234
|
-
* @param
|
|
1292
|
+
* @param findings - Array of findings to sort
|
|
1235
1293
|
* @returns Sorted array (new array, doesn't mutate input)
|
|
1236
1294
|
*/
|
|
1237
|
-
declare function
|
|
1295
|
+
declare function sortFindingsByLevel(findings: Finding[]): Finding[];
|
|
1238
1296
|
/**
|
|
1239
1297
|
* Find the highest scoring observables.
|
|
1240
1298
|
*
|
|
@@ -1244,13 +1302,13 @@ declare function sortChecksByLevel(checks: Check[]): Check[];
|
|
|
1244
1302
|
*/
|
|
1245
1303
|
declare function findHighestScoringObservables(inv: CyvestInvestigation, n?: number): Observable[];
|
|
1246
1304
|
/**
|
|
1247
|
-
* Find the highest scoring
|
|
1305
|
+
* Find the highest scoring findings.
|
|
1248
1306
|
*
|
|
1249
1307
|
* @param inv - The investigation to search
|
|
1250
1308
|
* @param n - Number of results to return (default: 10)
|
|
1251
|
-
* @returns Array of highest scoring
|
|
1309
|
+
* @returns Array of highest scoring findings
|
|
1252
1310
|
*/
|
|
1253
|
-
declare function
|
|
1311
|
+
declare function findHighestScoringFindings(inv: CyvestInvestigation, n?: number): Finding[];
|
|
1254
1312
|
/**
|
|
1255
1313
|
* Find all malicious observables (convenience function).
|
|
1256
1314
|
*
|
|
@@ -1266,26 +1324,26 @@ declare function findMaliciousObservables(inv: CyvestInvestigation): Observable[
|
|
|
1266
1324
|
*/
|
|
1267
1325
|
declare function findSuspiciousObservables(inv: CyvestInvestigation): Observable[];
|
|
1268
1326
|
/**
|
|
1269
|
-
* Find all malicious
|
|
1327
|
+
* Find all malicious findings (convenience function).
|
|
1270
1328
|
*
|
|
1271
1329
|
* @param inv - The investigation to search
|
|
1272
|
-
* @returns Array of malicious
|
|
1330
|
+
* @returns Array of malicious findings
|
|
1273
1331
|
*/
|
|
1274
|
-
declare function
|
|
1332
|
+
declare function findMaliciousFindings(inv: CyvestInvestigation): Finding[];
|
|
1275
1333
|
/**
|
|
1276
|
-
* Find all suspicious
|
|
1334
|
+
* Find all suspicious findings (convenience function).
|
|
1277
1335
|
*
|
|
1278
1336
|
* @param inv - The investigation to search
|
|
1279
|
-
* @returns Array of suspicious
|
|
1337
|
+
* @returns Array of suspicious findings
|
|
1280
1338
|
*/
|
|
1281
|
-
declare function
|
|
1339
|
+
declare function findSuspiciousFindings(inv: CyvestInvestigation): Finding[];
|
|
1282
1340
|
/**
|
|
1283
|
-
* Get all
|
|
1341
|
+
* Get all finding keys in the investigation.
|
|
1284
1342
|
*
|
|
1285
1343
|
* @param inv - The investigation
|
|
1286
|
-
* @returns Array of
|
|
1344
|
+
* @returns Array of finding keys
|
|
1287
1345
|
*/
|
|
1288
|
-
declare function
|
|
1346
|
+
declare function getAllFindingKeys(inv: CyvestInvestigation): string[];
|
|
1289
1347
|
/**
|
|
1290
1348
|
* Get all observable types present in the investigation.
|
|
1291
1349
|
*
|
|
@@ -1502,4 +1560,4 @@ declare function getRelationshipsForObservable(inv: CyvestInvestigation, observa
|
|
|
1502
1560
|
}>;
|
|
1503
1561
|
};
|
|
1504
1562
|
|
|
1505
|
-
export { type Actor, type AuditEvent, type AuditLog, type
|
|
1563
|
+
export { type Actor, type AuditEvent, type AuditLog, type CyvestInvestigation, type Data, type DataExtractionSchema, type Details, type Enrichment, type Enrichments, type Evidence, type EvidenceLink, type EvidenceLinks, type Evidences, type EvidencesBySource, type EvidencesByType, type ExternalId, type Extra, type Extra1, type Extra2, type Extra3, type Finding, type FindingLinks, type FindingLinks1, type Findings, type Findings1, type FindingsByLevel, type GraphEdge, type GraphNode, type InvestigationCounts, type InvestigationGraph, type InvestigationName, type InvestigationWhitelist, type Justification, type KeyType, LEVEL_COLORS, LEVEL_ORDER, LEVEL_VALUES, type Level, type Namespace, type ObjectKey, type ObjectType, type Observable, type ObservableLink, type ObservableLinks, type Observables, type ObservablesByLevel, type ObservablesByType, type ObservablesByTypeAndLevel, type PropagationMode, type Reason, type Relationship, type RelationshipDirection, type Relationships, type RootType, type ScoreMode, type StatisticsSchema, type Subtype, type Tag, type Tags, type Taxonomies, type Taxonomy, type ThreatIntel, type ThreatIntelByLevel, type ThreatIntelBySource, type ThreatIntels, type ThreatIntels1, type Tool, type Uri, type Whitelists, areConnected, compareLevels, countRelationshipsByType, findExternalObservables, findFindingByName, findFindingsAtLeast, findFindingsByLevel, findFindingsForObservable, findFindingsForTag, findHighestScoringFindings, findHighestScoringObservables, findInternalObservables, findLeafObservables, findMaliciousFindings, findMaliciousObservables, findObservablesAtLeast, findObservablesByLevel, findObservablesByType, findObservablesByValue, findObservablesContaining, findObservablesForFinding, findObservablesMatching, findObservablesWithThreatIntel, findOrphanObservables, findPath, findSourceObservables, findSuspiciousFindings, findSuspiciousObservables, findTagsAtLeast, findTagsByLevel, findTagsByNamePattern, findThreatIntelAtLeast, findThreatIntelByLevel, findThreatIntelBySource, findThreatIntelsForObservable, findWhitelistedObservables, generateEnrichmentKey, generateFindingKey, generateObservableKey, generateTagKey, generateThreatIntelKey, getAllEnrichments, getAllEvidences, getAllFindingKeys, getAllFindings, getAllObservableTypes, getAllObservables, getAllRelationshipTypes, getAllTags, getAllThreatIntelSources, getAllThreatIntels, getColorForLevel, getColorForScore, getCounts, getDataExtraction, getEnrichment, getEnrichmentByName, getEntityLevel, getEvidence, getFinding, getFindingByName, getLevelFromScore, getObservable, getObservableByTypeValue, getObservableChildren, getObservableGraph, getObservableParents, getReachableObservables, getRelatedObservables, getRelatedObservablesByDirection, getRelatedObservablesByType, getRelationshipsForObservable, getRootObservable, getStartedAt, getStats, getTag, getTagAggregatedLevel, getTagAggregatedScore, getTagAncestors, getTagByName, getTagChildren, getTagDescendants, getThreatIntel, getThreatIntelBySourceObservable, getWhitelists, hasLevel, isCyvest, isLevelAtLeast, isLevelHigherThan, isLevelLowerThan, isTagChildOf, isTagDescendantOf, isValidLevel, maxLevel, minLevel, normalizeLevel, parseCyvest, parseFindingKey, parseKeyType, parseObservableKey, parseThreatIntelKey, sortFindingsByLevel, sortFindingsByScore, sortObservablesByLevel, sortObservablesByScore, validateKey };
|