Skip to content

ti_*: Add missing fields in transform destination indices (2) - #10066

Merged
kcreddy merged 7 commits into
elastic:mainfrom
kcreddy:ti_packages-field-mapping-2
Jun 7, 2024
Merged

ti_*: Add missing fields in transform destination indices (2)#10066
kcreddy merged 7 commits into
elastic:mainfrom
kcreddy:ti_packages-field-mapping-2

Conversation

@kcreddy

@kcreddy kcreddy commented Jun 4, 2024

Copy link
Copy Markdown
Contributor

Proposed commit message

Add missing fields for detection rules.

Some fields such as event.module were missing from the 
destination index. In few packages, the field mappings are getting 
overwritten when same prefix exists in multiple files. To prevent this, 
all fields with same prefix are moved into single file, ecs.yml. 
This is only a temporary fix until kibana.version is updated to 
>= 8.14.0, in which the root issue is fixed.

  - Add comments inside ecs.yml describing the issue.

  - Add `threat.feed.name` field only if its not added inside 
    ingest pipelines.

  - Some packages have missing fields `event.module` and `event.dataset` 
    which are added to both source and destination.

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.

Author's Checklist

  • Manually verify destination mappings using system tests.

Following mappings validates that missing fields such as event.module are now mapped correctly in destination indices:
misp-threatattr-dest-8.13-1.33.1.json
misp-threatattr-source-8.13-1.33.1.json
opencti-indicator-dest-8.13-2.1.1.json
opencti-indicator-source-8.13-2.1.1.json
recordedfuture-threat-dest-8.13-1.25.1.json
recordedfuture-threat-source-8.13-1.25.1.json
threatconnect-indicator-dest-8.13-1.0.1.json
threatconnect-indicator-source-8.13-1.0.1.json
threatq-threat-dest-8.13-1.27.1.json
threatq-threat-source-8.13-1.27.1.json

How to test this PR locally

diff <(cat ~/misp-threatattr-source-8.13-1.33.1.json ) <(cat ~/misp-threatattr-dest-8.13-1.33.1.json )
Similarly for other files to find mapping diff between source and dest files. The diff shouldn't mainly contain event.module field which is required for detection rules.

  • Note that for packages threatconnect and opencti there is large diff between source and destination mappings because of import_mappings: true on source adding multiple dynamic templates.

Related issues

Screenshots

Before:
Screenshot 2024-06-05 at 12 04 21 PM

After:
Screenshot 2024-06-05 at 11 58 41 AM

@elasticmachine

elasticmachine commented Jun 4, 2024

Copy link
Copy Markdown

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

@kcreddy kcreddy self-assigned this Jun 5, 2024
@kcreddy kcreddy added the bugfix Pull request that fixes a bug issue label Jun 5, 2024
@elastic-sonarqube

Copy link
Copy Markdown

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@elasticmachine

Copy link
Copy Markdown

💚 Build Succeeded

History

cc @kcreddy

@kcreddy
kcreddy marked this pull request as ready for review June 5, 2024 09:29
@kcreddy
kcreddy requested a review from a team as a code owner June 5, 2024 09:29
@kcreddy
kcreddy requested a review from andrewkroh June 5, 2024 09:29
@kcreddy kcreddy added the Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] label Jun 5, 2024
@elasticmachine

Copy link
Copy Markdown

Pinging @elastic/security-service-integrations (Team:Security-Service Integrations)

@kcreddy
kcreddy merged commit dc251d2 into elastic:main Jun 7, 2024
@elasticmachine

Copy link
Copy Markdown

Package ti_misp - 1.33.1 containing this change is available at https://epr.elastic.co/search?package=ti_misp

@elasticmachine

Copy link
Copy Markdown

Package ti_opencti - 2.1.1 containing this change is available at https://epr.elastic.co/search?package=ti_opencti

@elasticmachine

Copy link
Copy Markdown

Package ti_recordedfuture - 1.25.1 containing this change is available at https://epr.elastic.co/search?package=ti_recordedfuture

@elasticmachine

Copy link
Copy Markdown

Package ti_threatconnect - 1.0.1 containing this change is available at https://epr.elastic.co/search?package=ti_threatconnect

@elasticmachine

Copy link
Copy Markdown

Package ti_threatq - 1.27.1 containing this change is available at https://epr.elastic.co/search?package=ti_threatq

@kcreddy
kcreddy deleted the ti_packages-field-mapping-2 branch February 7, 2025 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Pull request that fixes a bug issue Integration:ti_misp MISP Integration:ti_opencti OpenCTI Integration:ti_recordedfuture Recorded Future Integration:ti_threatconnect ThreatConnect Integration:ti_threatq ThreatQuotient (Partner supported) Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations]

4 participants