Skip to content

Commit

Permalink
Normalize/clean up various mappings files
Browse files Browse the repository at this point in the history
* Adds a wrapping "mappings.properties" around our extra mappings
* Spreads our other mappings similarly to ECS mappings
* Moves dynamic: false out of ECS mappings and into our main template
* Ensures we include 'threat.properties.indicator', since that's where
  our 'type: nested' declaration resides
  • Loading branch information
rylnd committed Apr 20, 2021
1 parent cf66c98 commit a4ee0dd
Show file tree
Hide file tree
Showing 2 changed files with 276 additions and 278 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,30 +42,24 @@ export const getSignalsTemplate = (index: string) => {
},
index_patterns: [`${index}-*`],
mappings: {
...ecsMapping.mappings,
dynamic: false,
properties: {
...ecsMapping.mappings.properties,
as: otherMapping.as,
code_signature: otherMapping.code_signature,
geo: otherMapping.geo,
hash: otherMapping.hash,
interface: otherMapping.interface,
os: otherMapping.os,
pe: otherMapping.pe,
...otherMapping.mappings.properties,
signal: signalsMapping.mappings.properties.signal,
threat: {
...ecsMapping.mappings.properties.threat,
properties: {
...ecsMapping.mappings.properties.threat.properties,
indicator: {
...otherMapping.mappings.properties.threat.properties.indicator,
properties: {
...otherMapping.threat.properties.indicator.properties,
...otherMapping.mappings.properties.threat.properties.indicator.properties,
event: ecsMapping.mappings.properties.event,
},
},
},
},
vlan: otherMapping.vlan,
},
_meta: {
version: SIGNALS_TEMPLATE_VERSION,
Expand Down
Loading

0 comments on commit a4ee0dd

Please sign in to comment.