Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 7 commits into from
Jun 7, 2024

Conversation

kcreddy
Copy link
Contributor

@kcreddy kcreddy commented Jun 4, 2024

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
Copy link

elasticmachine commented Jun 4, 2024

🚀 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
Copy link

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

💚 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

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

@kcreddy kcreddy merged commit dc251d2 into elastic:main Jun 7, 2024
5 checks passed
@elasticmachine
Copy link

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

@elasticmachine
Copy link

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

@elasticmachine
Copy link

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

@elasticmachine
Copy link

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

@elasticmachine
Copy link

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

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 Team:Security-Service Integrations Security Service Integrations Team [elastic/security-service-integrations]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants