@cyvest/cyvest-js 4.0.0 → 4.2.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/dist/index.d.mts +12 -21
- package/dist/index.d.ts +12 -21
- package/dist/index.js +23 -28
- package/dist/index.mjs +23 -27
- package/package.json +1 -1
- package/src/getters.ts +0 -10
- package/src/types.generated.ts +11 -13
- package/tests/getters-finders.test.ts +3 -7
- package/tests/graph.test.ts +2 -6
package/dist/index.d.mts
CHANGED
|
@@ -37,14 +37,12 @@ type CheckLinks = string[];
|
|
|
37
37
|
*/
|
|
38
38
|
type PropagationMode = "LOCAL_ONLY" | "GLOBAL";
|
|
39
39
|
type ObservableLinks = ObservableLink[];
|
|
40
|
-
type Taxonomies =
|
|
41
|
-
[k: string]: unknown;
|
|
42
|
-
}[];
|
|
40
|
+
type Taxonomies = Taxonomy[];
|
|
43
41
|
type Checks1 = string[];
|
|
44
42
|
/**
|
|
45
43
|
* Root observable type used during data extraction.
|
|
46
44
|
*/
|
|
47
|
-
type RootType =
|
|
45
|
+
type RootType = ("file" | "artifact") | null;
|
|
48
46
|
/**
|
|
49
47
|
* Score calculation mode for observables.
|
|
50
48
|
*/
|
|
@@ -87,7 +85,6 @@ interface CyvestInvestigation {
|
|
|
87
85
|
enrichments: Enrichments;
|
|
88
86
|
containers: Containers;
|
|
89
87
|
stats: StatisticsSchema;
|
|
90
|
-
stats_checks: StatsChecksSchema;
|
|
91
88
|
data_extraction: DataExtractionSchema;
|
|
92
89
|
/**
|
|
93
90
|
* Global investigation score formatted as fixed-point x.xx.
|
|
@@ -230,6 +227,14 @@ interface ThreatIntel {
|
|
|
230
227
|
interface Extra2 {
|
|
231
228
|
[k: string]: unknown;
|
|
232
229
|
}
|
|
230
|
+
/**
|
|
231
|
+
* Represents a structured taxonomy entry for threat intelligence.
|
|
232
|
+
*/
|
|
233
|
+
interface Taxonomy {
|
|
234
|
+
level: Level;
|
|
235
|
+
name: string;
|
|
236
|
+
value: string;
|
|
237
|
+
}
|
|
233
238
|
/**
|
|
234
239
|
* Enrichment entries keyed by their unique key.
|
|
235
240
|
*/
|
|
@@ -321,19 +326,12 @@ interface ThreatIntelBySource {
|
|
|
321
326
|
interface ThreatIntelByLevel {
|
|
322
327
|
[k: string]: number;
|
|
323
328
|
}
|
|
324
|
-
/**
|
|
325
|
-
* Schema for check statistics summary.
|
|
326
|
-
*/
|
|
327
|
-
interface StatsChecksSchema {
|
|
328
|
-
checks: number;
|
|
329
|
-
applied: number;
|
|
330
|
-
}
|
|
331
329
|
/**
|
|
332
330
|
* Schema for data extraction metadata.
|
|
333
331
|
*/
|
|
334
332
|
interface DataExtractionSchema {
|
|
335
333
|
root_type?: RootType;
|
|
336
|
-
|
|
334
|
+
score_mode_obs: ScoreMode;
|
|
337
335
|
}
|
|
338
336
|
|
|
339
337
|
declare function parseCyvest(json: unknown): CyvestInvestigation;
|
|
@@ -826,13 +824,6 @@ declare function getWhitelists(inv: CyvestInvestigation): Whitelists;
|
|
|
826
824
|
* @returns Statistics object
|
|
827
825
|
*/
|
|
828
826
|
declare function getStats(inv: CyvestInvestigation): StatisticsSchema;
|
|
829
|
-
/**
|
|
830
|
-
* Get the investigation check statistics.
|
|
831
|
-
*
|
|
832
|
-
* @param inv - The investigation
|
|
833
|
-
* @returns Check statistics object
|
|
834
|
-
*/
|
|
835
|
-
declare function getStatsChecks(inv: CyvestInvestigation): StatsChecksSchema;
|
|
836
827
|
/**
|
|
837
828
|
* Get the data extraction configuration.
|
|
838
829
|
*
|
|
@@ -1371,4 +1362,4 @@ declare function getRelationshipsForObservable(inv: CyvestInvestigation, observa
|
|
|
1371
1362
|
}>;
|
|
1372
1363
|
};
|
|
1373
1364
|
|
|
1374
|
-
export { type Actor, type AuditEvent, type Check, type CheckLinks, type Checks, type Checks1, type ChecksByLevel, type ChecksByLevel1, type ChecksByScope, type Container, type Containers, type CyvestInvestigation, type Data, type DataExtractionSchema, type Details, type Enrichment, type Enrichments, type EventLog, type Extra, type Extra1, type Extra2, 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 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
|
|
1365
|
+
export { type Actor, type AuditEvent, type Check, type CheckLinks, type Checks, type Checks1, type ChecksByLevel, type ChecksByLevel1, type ChecksByScope, type Container, type Containers, type CyvestInvestigation, type Data, type DataExtractionSchema, type Details, type Enrichment, type Enrichments, type EventLog, type Extra, type Extra1, type Extra2, 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 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 SubContainers, type Taxonomies, type Taxonomy, type ThreatIntel, type ThreatIntelByLevel, type ThreatIntelBySource, type ThreatIntels, type ThreatIntels1, type Tool, type Whitelists, areConnected, compareLevels, countRelationshipsByType, findChecksAtLeast, findChecksByCheckId, findChecksByLevel, findChecksByScope, findContainersAtLeast, findContainersByLevel, findExternalObservables, findInternalObservables, findLeafObservables, findObservablesAtLeast, findObservablesByLevel, findObservablesByType, findObservablesByValue, findObservablesContaining, findObservablesMatching, findObservablesWithThreatIntel, findOrphanObservables, findPath, findRootObservables, findThreatIntelAtLeast, findThreatIntelByLevel, findThreatIntelBySource, findWhitelistedObservables, generateCheckKey, generateContainerKey, generateEnrichmentKey, generateObservableKey, generateThreatIntelKey, getAllChecks, getAllContainers, getAllEnrichments, getAllObservableTypes, getAllObservables, getAllRelationshipTypes, getAllScopes, getAllThreatIntelSources, getAllThreatIntels, getCheck, getCheckByIdScope, getChecksForContainer, getChecksForObservable, getColorForLevel, getColorForScore, getContainer, getContainerByPath, getCounts, getDataExtraction, getEnrichment, getEnrichmentByName, getEntityLevel, getHighestScoringChecks, getHighestScoringObservables, getLevelFromScore, getMaliciousChecks, getMaliciousObservables, getObservable, getObservableByTypeValue, getObservableChildren, getObservableGraph, getObservableParents, getObservablesForCheck, getReachableObservables, getRelatedObservables, getRelatedObservablesByDirection, getRelatedObservablesByType, getRelationshipsForObservable, getStats, getSuspiciousChecks, getSuspiciousObservables, getThreatIntel, getThreatIntelBySourceObservable, getThreatIntelsForObservable, getWhitelists, hasLevel, isCyvest, isLevelAtLeast, isLevelHigherThan, isLevelLowerThan, isValidLevel, maxLevel, minLevel, normalizeLevel, parseCheckKey, parseCyvest, parseKeyType, parseObservableKey, parseThreatIntelKey, sortChecksByLevel, sortChecksByScore, sortObservablesByLevel, sortObservablesByScore, validateKey };
|
package/dist/index.d.ts
CHANGED
|
@@ -37,14 +37,12 @@ type CheckLinks = string[];
|
|
|
37
37
|
*/
|
|
38
38
|
type PropagationMode = "LOCAL_ONLY" | "GLOBAL";
|
|
39
39
|
type ObservableLinks = ObservableLink[];
|
|
40
|
-
type Taxonomies =
|
|
41
|
-
[k: string]: unknown;
|
|
42
|
-
}[];
|
|
40
|
+
type Taxonomies = Taxonomy[];
|
|
43
41
|
type Checks1 = string[];
|
|
44
42
|
/**
|
|
45
43
|
* Root observable type used during data extraction.
|
|
46
44
|
*/
|
|
47
|
-
type RootType =
|
|
45
|
+
type RootType = ("file" | "artifact") | null;
|
|
48
46
|
/**
|
|
49
47
|
* Score calculation mode for observables.
|
|
50
48
|
*/
|
|
@@ -87,7 +85,6 @@ interface CyvestInvestigation {
|
|
|
87
85
|
enrichments: Enrichments;
|
|
88
86
|
containers: Containers;
|
|
89
87
|
stats: StatisticsSchema;
|
|
90
|
-
stats_checks: StatsChecksSchema;
|
|
91
88
|
data_extraction: DataExtractionSchema;
|
|
92
89
|
/**
|
|
93
90
|
* Global investigation score formatted as fixed-point x.xx.
|
|
@@ -230,6 +227,14 @@ interface ThreatIntel {
|
|
|
230
227
|
interface Extra2 {
|
|
231
228
|
[k: string]: unknown;
|
|
232
229
|
}
|
|
230
|
+
/**
|
|
231
|
+
* Represents a structured taxonomy entry for threat intelligence.
|
|
232
|
+
*/
|
|
233
|
+
interface Taxonomy {
|
|
234
|
+
level: Level;
|
|
235
|
+
name: string;
|
|
236
|
+
value: string;
|
|
237
|
+
}
|
|
233
238
|
/**
|
|
234
239
|
* Enrichment entries keyed by their unique key.
|
|
235
240
|
*/
|
|
@@ -321,19 +326,12 @@ interface ThreatIntelBySource {
|
|
|
321
326
|
interface ThreatIntelByLevel {
|
|
322
327
|
[k: string]: number;
|
|
323
328
|
}
|
|
324
|
-
/**
|
|
325
|
-
* Schema for check statistics summary.
|
|
326
|
-
*/
|
|
327
|
-
interface StatsChecksSchema {
|
|
328
|
-
checks: number;
|
|
329
|
-
applied: number;
|
|
330
|
-
}
|
|
331
329
|
/**
|
|
332
330
|
* Schema for data extraction metadata.
|
|
333
331
|
*/
|
|
334
332
|
interface DataExtractionSchema {
|
|
335
333
|
root_type?: RootType;
|
|
336
|
-
|
|
334
|
+
score_mode_obs: ScoreMode;
|
|
337
335
|
}
|
|
338
336
|
|
|
339
337
|
declare function parseCyvest(json: unknown): CyvestInvestigation;
|
|
@@ -826,13 +824,6 @@ declare function getWhitelists(inv: CyvestInvestigation): Whitelists;
|
|
|
826
824
|
* @returns Statistics object
|
|
827
825
|
*/
|
|
828
826
|
declare function getStats(inv: CyvestInvestigation): StatisticsSchema;
|
|
829
|
-
/**
|
|
830
|
-
* Get the investigation check statistics.
|
|
831
|
-
*
|
|
832
|
-
* @param inv - The investigation
|
|
833
|
-
* @returns Check statistics object
|
|
834
|
-
*/
|
|
835
|
-
declare function getStatsChecks(inv: CyvestInvestigation): StatsChecksSchema;
|
|
836
827
|
/**
|
|
837
828
|
* Get the data extraction configuration.
|
|
838
829
|
*
|
|
@@ -1371,4 +1362,4 @@ declare function getRelationshipsForObservable(inv: CyvestInvestigation, observa
|
|
|
1371
1362
|
}>;
|
|
1372
1363
|
};
|
|
1373
1364
|
|
|
1374
|
-
export { type Actor, type AuditEvent, type Check, type CheckLinks, type Checks, type Checks1, type ChecksByLevel, type ChecksByLevel1, type ChecksByScope, type Container, type Containers, type CyvestInvestigation, type Data, type DataExtractionSchema, type Details, type Enrichment, type Enrichments, type EventLog, type Extra, type Extra1, type Extra2, 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 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
|
|
1365
|
+
export { type Actor, type AuditEvent, type Check, type CheckLinks, type Checks, type Checks1, type ChecksByLevel, type ChecksByLevel1, type ChecksByScope, type Container, type Containers, type CyvestInvestigation, type Data, type DataExtractionSchema, type Details, type Enrichment, type Enrichments, type EventLog, type Extra, type Extra1, type Extra2, 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 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 SubContainers, type Taxonomies, type Taxonomy, type ThreatIntel, type ThreatIntelByLevel, type ThreatIntelBySource, type ThreatIntels, type ThreatIntels1, type Tool, type Whitelists, areConnected, compareLevels, countRelationshipsByType, findChecksAtLeast, findChecksByCheckId, findChecksByLevel, findChecksByScope, findContainersAtLeast, findContainersByLevel, findExternalObservables, findInternalObservables, findLeafObservables, findObservablesAtLeast, findObservablesByLevel, findObservablesByType, findObservablesByValue, findObservablesContaining, findObservablesMatching, findObservablesWithThreatIntel, findOrphanObservables, findPath, findRootObservables, findThreatIntelAtLeast, findThreatIntelByLevel, findThreatIntelBySource, findWhitelistedObservables, generateCheckKey, generateContainerKey, generateEnrichmentKey, generateObservableKey, generateThreatIntelKey, getAllChecks, getAllContainers, getAllEnrichments, getAllObservableTypes, getAllObservables, getAllRelationshipTypes, getAllScopes, getAllThreatIntelSources, getAllThreatIntels, getCheck, getCheckByIdScope, getChecksForContainer, getChecksForObservable, getColorForLevel, getColorForScore, getContainer, getContainerByPath, getCounts, getDataExtraction, getEnrichment, getEnrichmentByName, getEntityLevel, getHighestScoringChecks, getHighestScoringObservables, getLevelFromScore, getMaliciousChecks, getMaliciousObservables, getObservable, getObservableByTypeValue, getObservableChildren, getObservableGraph, getObservableParents, getObservablesForCheck, getReachableObservables, getRelatedObservables, getRelatedObservablesByDirection, getRelatedObservablesByType, getRelationshipsForObservable, getStats, getSuspiciousChecks, getSuspiciousObservables, getThreatIntel, getThreatIntelBySourceObservable, getThreatIntelsForObservable, getWhitelists, hasLevel, isCyvest, isLevelAtLeast, isLevelHigherThan, isLevelLowerThan, isValidLevel, maxLevel, minLevel, normalizeLevel, parseCheckKey, parseCyvest, parseKeyType, parseObservableKey, parseThreatIntelKey, sortChecksByLevel, sortChecksByScore, sortObservablesByLevel, sortObservablesByScore, validateKey };
|
package/dist/index.js
CHANGED
|
@@ -103,7 +103,6 @@ __export(index_exports, {
|
|
|
103
103
|
getRelatedObservablesByType: () => getRelatedObservablesByType,
|
|
104
104
|
getRelationshipsForObservable: () => getRelationshipsForObservable,
|
|
105
105
|
getStats: () => getStats,
|
|
106
|
-
getStatsChecks: () => getStatsChecks,
|
|
107
106
|
getSuspiciousChecks: () => getSuspiciousChecks,
|
|
108
107
|
getSuspiciousObservables: () => getSuspiciousObservables,
|
|
109
108
|
getThreatIntel: () => getThreatIntel,
|
|
@@ -358,6 +357,10 @@ var cyvest_schema_default = {
|
|
|
358
357
|
root_type: {
|
|
359
358
|
anyOf: [
|
|
360
359
|
{
|
|
360
|
+
enum: [
|
|
361
|
+
"file",
|
|
362
|
+
"artifact"
|
|
363
|
+
],
|
|
361
364
|
type: "string"
|
|
362
365
|
},
|
|
363
366
|
{
|
|
@@ -368,13 +371,13 @@ var cyvest_schema_default = {
|
|
|
368
371
|
description: "Root observable type used during data extraction.",
|
|
369
372
|
title: "Root Type"
|
|
370
373
|
},
|
|
371
|
-
|
|
374
|
+
score_mode_obs: {
|
|
372
375
|
$ref: "#/$defs/ScoreMode",
|
|
373
|
-
description: "
|
|
376
|
+
description: "Observable score aggregation mode: 'max' takes highest score, 'sum' adds all scores."
|
|
374
377
|
}
|
|
375
378
|
},
|
|
376
379
|
required: [
|
|
377
|
-
"
|
|
380
|
+
"score_mode_obs"
|
|
378
381
|
],
|
|
379
382
|
title: "DataExtractionSchema",
|
|
380
383
|
type: "object"
|
|
@@ -727,26 +730,28 @@ var cyvest_schema_default = {
|
|
|
727
730
|
title: "StatisticsSchema",
|
|
728
731
|
type: "object"
|
|
729
732
|
},
|
|
730
|
-
|
|
733
|
+
Taxonomy: {
|
|
731
734
|
additionalProperties: false,
|
|
732
|
-
description: "
|
|
735
|
+
description: "Represents a structured taxonomy entry for threat intelligence.",
|
|
733
736
|
properties: {
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
title: "Checks",
|
|
737
|
-
type: "integer"
|
|
737
|
+
level: {
|
|
738
|
+
$ref: "#/$defs/Level"
|
|
738
739
|
},
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
740
|
+
name: {
|
|
741
|
+
title: "Name",
|
|
742
|
+
type: "string"
|
|
743
|
+
},
|
|
744
|
+
value: {
|
|
745
|
+
title: "Value",
|
|
746
|
+
type: "string"
|
|
743
747
|
}
|
|
744
748
|
},
|
|
745
749
|
required: [
|
|
746
|
-
"
|
|
747
|
-
"
|
|
750
|
+
"level",
|
|
751
|
+
"name",
|
|
752
|
+
"value"
|
|
748
753
|
],
|
|
749
|
-
title: "
|
|
754
|
+
title: "Taxonomy",
|
|
750
755
|
type: "object"
|
|
751
756
|
},
|
|
752
757
|
ThreatIntel: {
|
|
@@ -778,8 +783,7 @@ var cyvest_schema_default = {
|
|
|
778
783
|
},
|
|
779
784
|
taxonomies: {
|
|
780
785
|
items: {
|
|
781
|
-
|
|
782
|
-
type: "object"
|
|
786
|
+
$ref: "#/$defs/Taxonomy"
|
|
783
787
|
},
|
|
784
788
|
title: "Taxonomies",
|
|
785
789
|
type: "array"
|
|
@@ -926,10 +930,6 @@ var cyvest_schema_default = {
|
|
|
926
930
|
$ref: "#/$defs/StatisticsSchema",
|
|
927
931
|
description: "Investigation statistics summary."
|
|
928
932
|
},
|
|
929
|
-
stats_checks: {
|
|
930
|
-
$ref: "#/$defs/StatsChecksSchema",
|
|
931
|
-
description: "Check statistics summary."
|
|
932
|
-
},
|
|
933
933
|
data_extraction: {
|
|
934
934
|
$ref: "#/$defs/DataExtractionSchema",
|
|
935
935
|
description: "Data extraction metadata."
|
|
@@ -955,7 +955,6 @@ var cyvest_schema_default = {
|
|
|
955
955
|
"enrichments",
|
|
956
956
|
"containers",
|
|
957
957
|
"stats",
|
|
958
|
-
"stats_checks",
|
|
959
958
|
"data_extraction",
|
|
960
959
|
"score_display"
|
|
961
960
|
],
|
|
@@ -1328,9 +1327,6 @@ function getWhitelists(inv) {
|
|
|
1328
1327
|
function getStats(inv) {
|
|
1329
1328
|
return inv.stats;
|
|
1330
1329
|
}
|
|
1331
|
-
function getStatsChecks(inv) {
|
|
1332
|
-
return inv.stats_checks;
|
|
1333
|
-
}
|
|
1334
1330
|
function getDataExtraction(inv) {
|
|
1335
1331
|
return inv.data_extraction;
|
|
1336
1332
|
}
|
|
@@ -1955,7 +1951,6 @@ function getRelationshipsForObservable(inv, observableKey) {
|
|
|
1955
1951
|
getRelatedObservablesByType,
|
|
1956
1952
|
getRelationshipsForObservable,
|
|
1957
1953
|
getStats,
|
|
1958
|
-
getStatsChecks,
|
|
1959
1954
|
getSuspiciousChecks,
|
|
1960
1955
|
getSuspiciousObservables,
|
|
1961
1956
|
getThreatIntel,
|
package/dist/index.mjs
CHANGED
|
@@ -224,6 +224,10 @@ var cyvest_schema_default = {
|
|
|
224
224
|
root_type: {
|
|
225
225
|
anyOf: [
|
|
226
226
|
{
|
|
227
|
+
enum: [
|
|
228
|
+
"file",
|
|
229
|
+
"artifact"
|
|
230
|
+
],
|
|
227
231
|
type: "string"
|
|
228
232
|
},
|
|
229
233
|
{
|
|
@@ -234,13 +238,13 @@ var cyvest_schema_default = {
|
|
|
234
238
|
description: "Root observable type used during data extraction.",
|
|
235
239
|
title: "Root Type"
|
|
236
240
|
},
|
|
237
|
-
|
|
241
|
+
score_mode_obs: {
|
|
238
242
|
$ref: "#/$defs/ScoreMode",
|
|
239
|
-
description: "
|
|
243
|
+
description: "Observable score aggregation mode: 'max' takes highest score, 'sum' adds all scores."
|
|
240
244
|
}
|
|
241
245
|
},
|
|
242
246
|
required: [
|
|
243
|
-
"
|
|
247
|
+
"score_mode_obs"
|
|
244
248
|
],
|
|
245
249
|
title: "DataExtractionSchema",
|
|
246
250
|
type: "object"
|
|
@@ -593,26 +597,28 @@ var cyvest_schema_default = {
|
|
|
593
597
|
title: "StatisticsSchema",
|
|
594
598
|
type: "object"
|
|
595
599
|
},
|
|
596
|
-
|
|
600
|
+
Taxonomy: {
|
|
597
601
|
additionalProperties: false,
|
|
598
|
-
description: "
|
|
602
|
+
description: "Represents a structured taxonomy entry for threat intelligence.",
|
|
599
603
|
properties: {
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
title: "Checks",
|
|
603
|
-
type: "integer"
|
|
604
|
+
level: {
|
|
605
|
+
$ref: "#/$defs/Level"
|
|
604
606
|
},
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
607
|
+
name: {
|
|
608
|
+
title: "Name",
|
|
609
|
+
type: "string"
|
|
610
|
+
},
|
|
611
|
+
value: {
|
|
612
|
+
title: "Value",
|
|
613
|
+
type: "string"
|
|
609
614
|
}
|
|
610
615
|
},
|
|
611
616
|
required: [
|
|
612
|
-
"
|
|
613
|
-
"
|
|
617
|
+
"level",
|
|
618
|
+
"name",
|
|
619
|
+
"value"
|
|
614
620
|
],
|
|
615
|
-
title: "
|
|
621
|
+
title: "Taxonomy",
|
|
616
622
|
type: "object"
|
|
617
623
|
},
|
|
618
624
|
ThreatIntel: {
|
|
@@ -644,8 +650,7 @@ var cyvest_schema_default = {
|
|
|
644
650
|
},
|
|
645
651
|
taxonomies: {
|
|
646
652
|
items: {
|
|
647
|
-
|
|
648
|
-
type: "object"
|
|
653
|
+
$ref: "#/$defs/Taxonomy"
|
|
649
654
|
},
|
|
650
655
|
title: "Taxonomies",
|
|
651
656
|
type: "array"
|
|
@@ -792,10 +797,6 @@ var cyvest_schema_default = {
|
|
|
792
797
|
$ref: "#/$defs/StatisticsSchema",
|
|
793
798
|
description: "Investigation statistics summary."
|
|
794
799
|
},
|
|
795
|
-
stats_checks: {
|
|
796
|
-
$ref: "#/$defs/StatsChecksSchema",
|
|
797
|
-
description: "Check statistics summary."
|
|
798
|
-
},
|
|
799
800
|
data_extraction: {
|
|
800
801
|
$ref: "#/$defs/DataExtractionSchema",
|
|
801
802
|
description: "Data extraction metadata."
|
|
@@ -821,7 +822,6 @@ var cyvest_schema_default = {
|
|
|
821
822
|
"enrichments",
|
|
822
823
|
"containers",
|
|
823
824
|
"stats",
|
|
824
|
-
"stats_checks",
|
|
825
825
|
"data_extraction",
|
|
826
826
|
"score_display"
|
|
827
827
|
],
|
|
@@ -1194,9 +1194,6 @@ function getWhitelists(inv) {
|
|
|
1194
1194
|
function getStats(inv) {
|
|
1195
1195
|
return inv.stats;
|
|
1196
1196
|
}
|
|
1197
|
-
function getStatsChecks(inv) {
|
|
1198
|
-
return inv.stats_checks;
|
|
1199
|
-
}
|
|
1200
1197
|
function getDataExtraction(inv) {
|
|
1201
1198
|
return inv.data_extraction;
|
|
1202
1199
|
}
|
|
@@ -1820,7 +1817,6 @@ export {
|
|
|
1820
1817
|
getRelatedObservablesByType,
|
|
1821
1818
|
getRelationshipsForObservable,
|
|
1822
1819
|
getStats,
|
|
1823
|
-
getStatsChecks,
|
|
1824
1820
|
getSuspiciousChecks,
|
|
1825
1821
|
getSuspiciousObservables,
|
|
1826
1822
|
getThreatIntel,
|
package/package.json
CHANGED
package/src/getters.ts
CHANGED
|
@@ -359,16 +359,6 @@ export function getStats(inv: CyvestInvestigation) {
|
|
|
359
359
|
return inv.stats;
|
|
360
360
|
}
|
|
361
361
|
|
|
362
|
-
/**
|
|
363
|
-
* Get the investigation check statistics.
|
|
364
|
-
*
|
|
365
|
-
* @param inv - The investigation
|
|
366
|
-
* @returns Check statistics object
|
|
367
|
-
*/
|
|
368
|
-
export function getStatsChecks(inv: CyvestInvestigation) {
|
|
369
|
-
return inv.stats_checks;
|
|
370
|
-
}
|
|
371
|
-
|
|
372
362
|
/**
|
|
373
363
|
* Get the data extraction configuration.
|
|
374
364
|
*
|
package/src/types.generated.ts
CHANGED
|
@@ -39,14 +39,12 @@ export type CheckLinks = string[];
|
|
|
39
39
|
*/
|
|
40
40
|
export type PropagationMode = "LOCAL_ONLY" | "GLOBAL";
|
|
41
41
|
export type ObservableLinks = ObservableLink[];
|
|
42
|
-
export type Taxonomies =
|
|
43
|
-
[k: string]: unknown;
|
|
44
|
-
}[];
|
|
42
|
+
export type Taxonomies = Taxonomy[];
|
|
45
43
|
export type Checks1 = string[];
|
|
46
44
|
/**
|
|
47
45
|
* Root observable type used during data extraction.
|
|
48
46
|
*/
|
|
49
|
-
export type RootType =
|
|
47
|
+
export type RootType = ("file" | "artifact") | null;
|
|
50
48
|
/**
|
|
51
49
|
* Score calculation mode for observables.
|
|
52
50
|
*/
|
|
@@ -90,7 +88,6 @@ export interface CyvestInvestigation {
|
|
|
90
88
|
enrichments: Enrichments;
|
|
91
89
|
containers: Containers;
|
|
92
90
|
stats: StatisticsSchema;
|
|
93
|
-
stats_checks: StatsChecksSchema;
|
|
94
91
|
data_extraction: DataExtractionSchema;
|
|
95
92
|
/**
|
|
96
93
|
* Global investigation score formatted as fixed-point x.xx.
|
|
@@ -233,6 +230,14 @@ export interface ThreatIntel {
|
|
|
233
230
|
export interface Extra2 {
|
|
234
231
|
[k: string]: unknown;
|
|
235
232
|
}
|
|
233
|
+
/**
|
|
234
|
+
* Represents a structured taxonomy entry for threat intelligence.
|
|
235
|
+
*/
|
|
236
|
+
export interface Taxonomy {
|
|
237
|
+
level: Level;
|
|
238
|
+
name: string;
|
|
239
|
+
value: string;
|
|
240
|
+
}
|
|
236
241
|
/**
|
|
237
242
|
* Enrichment entries keyed by their unique key.
|
|
238
243
|
*/
|
|
@@ -324,17 +329,10 @@ export interface ThreatIntelBySource {
|
|
|
324
329
|
export interface ThreatIntelByLevel {
|
|
325
330
|
[k: string]: number;
|
|
326
331
|
}
|
|
327
|
-
/**
|
|
328
|
-
* Schema for check statistics summary.
|
|
329
|
-
*/
|
|
330
|
-
export interface StatsChecksSchema {
|
|
331
|
-
checks: number;
|
|
332
|
-
applied: number;
|
|
333
|
-
}
|
|
334
332
|
/**
|
|
335
333
|
* Schema for data extraction metadata.
|
|
336
334
|
*/
|
|
337
335
|
export interface DataExtractionSchema {
|
|
338
336
|
root_type?: RootType;
|
|
339
|
-
|
|
337
|
+
score_mode_obs: ScoreMode;
|
|
340
338
|
}
|
|
@@ -190,7 +190,7 @@ function createTestInvestigation(): CyvestInvestigation {
|
|
|
190
190
|
score: 5,
|
|
191
191
|
score_display: "5.00",
|
|
192
192
|
level: "MALICIOUS",
|
|
193
|
-
taxonomies: [{ verdict: "malicious" }],
|
|
193
|
+
taxonomies: [{ level: "MALICIOUS", name: "verdict", value: "malicious" }],
|
|
194
194
|
},
|
|
195
195
|
},
|
|
196
196
|
enrichments: {
|
|
@@ -239,13 +239,9 @@ function createTestInvestigation(): CyvestInvestigation {
|
|
|
239
239
|
threat_intel_by_level: { MALICIOUS: 1 },
|
|
240
240
|
total_containers: 2,
|
|
241
241
|
},
|
|
242
|
-
stats_checks: {
|
|
243
|
-
checks: 3,
|
|
244
|
-
applied: 2,
|
|
245
|
-
},
|
|
246
242
|
data_extraction: {
|
|
247
|
-
root_type: "
|
|
248
|
-
|
|
243
|
+
root_type: "file",
|
|
244
|
+
score_mode_obs: "max",
|
|
249
245
|
},
|
|
250
246
|
};
|
|
251
247
|
}
|
package/tests/graph.test.ts
CHANGED
|
@@ -144,13 +144,9 @@ function createGraphTestInvestigation(): CyvestInvestigation {
|
|
|
144
144
|
threat_intel_by_level: {},
|
|
145
145
|
total_containers: 0,
|
|
146
146
|
},
|
|
147
|
-
stats_checks: {
|
|
148
|
-
checks: 0,
|
|
149
|
-
applied: 0,
|
|
150
|
-
},
|
|
151
147
|
data_extraction: {
|
|
152
|
-
root_type: "
|
|
153
|
-
|
|
148
|
+
root_type: "file",
|
|
149
|
+
score_mode_obs: "max",
|
|
154
150
|
},
|
|
155
151
|
};
|
|
156
152
|
}
|