Skip to content

Commit

Permalink
adds cti fieldmap
Browse files Browse the repository at this point in the history
  • Loading branch information
ecezalp committed Aug 9, 2021
1 parent 6929a58 commit 43e8732
Show file tree
Hide file tree
Showing 2 changed files with 159 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

export const ctiFieldMap = {
'threat.indicator': {
type: 'nested',
array: false,
required: false,
},
'threat.indicator.as.number': {
type: 'long',
array: false,
required: false,
},
'threat.indicator.as.organization.name': {
type: 'keyword',
array: false,
required: false,
},
'threat.indicator.confidence': {
type: 'keyword',
array: false,
required: false,
},
'threat.indicator.dataset': {
type: 'keyword',
array: false,
required: false,
},
'threat.indicator.description': {
type: 'keyword',
array: false,
required: false,
},
'threat.indicator.domain': {
type: 'keyword',
array: false,
required: false,
},
'threat.indicator.email.address': {
type: 'keyword',
array: false,
required: false,
},
'threat.indicator.first_seen': {
type: 'date',
array: false,
required: false,
},
'threat.indicator.geo.city_name': {
type: 'keyword',
array: false,
required: false,
},
'threat.indicator.geo.continent_name': {
type: 'keyword',
array: false,
required: false,
},
'threat.indicator.geo.country_iso_code': {
type: 'keyword',
array: false,
required: false,
},
'threat.indicator.geo.country_name': {
type: 'keyword',
array: false,
required: false,
},
'threat.indicator.geo.location': {
type: 'geo_point',
array: false,
required: false,
},
'threat.indicator.geo.name': {
type: 'keyword',
array: false,
required: false,
},
'threat.indicator.geo.region_iso_code': {
type: 'keyword',
array: false,
required: false,
},
'threat.indicator.geo.region_name': {
type: 'keyword',
array: false,
required: false,
},
'threat.indicator.ip': {
type: 'ip',
array: false,
required: false,
},
'threat.indicator.last_seen': {
type: 'date',
array: false,
required: false,
},
'threat.indicator.marking.tlp': {
type: 'keyword',
array: false,
required: false,
},
'threat.indicator.matched.atomic': {
type: 'keyword',
array: false,
required: false,
},
'threat.indicator.matched.field': {
type: 'keyword',
array: false,
required: false,
},
'threat.indicator.matched.type': {
type: 'keyword',
array: false,
required: false,
},
'threat.indicator.module': {
type: 'keyword',
array: false,
required: false,
},
'threat.indicator.port': {
type: 'long',
array: false,
required: false,
},
'threat.indicator.provider': {
type: 'keyword',
array: false,
required: false,
},
'threat.indicator.scanner_stats': {
type: 'long',
array: false,
required: false,
},
'threat.indicator.sightings': {
type: 'long',
array: false,
required: false,
},
'threat.indicator.type': {
type: 'keyword',
array: false,
required: false,
},
};
6 changes: 5 additions & 1 deletion x-pack/plugins/security_solution/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ import { getKibanaPrivilegesFeaturePrivileges } from './features';
import { EndpointMetadataService } from './endpoint/services/metadata';
import { createIndicatorMatchAlertType } from './lib/detection_engine/rule_types/indicator_match/create_indicator_match_alert_type';
import { CreateRuleOptions } from './lib/detection_engine/rule_types/types';
import { ctiFieldMap } from './lib/detection_engine/rule_types/field_maps/cti';

export interface SetupPlugins {
alerting: AlertingSetup;
Expand Down Expand Up @@ -234,7 +235,10 @@ export class Plugin implements IPlugin<PluginSetup, PluginStart, SetupPlugins, S
settings: {
number_of_shards: 1,
},
mappings: mappingFromFieldMap({ ...alertsFieldMap, ...rulesFieldMap }, false),
mappings: mappingFromFieldMap(
{ ...alertsFieldMap, ...rulesFieldMap, ...ctiFieldMap },
false
),
},
},
});
Expand Down

0 comments on commit 43e8732

Please sign in to comment.