-
Notifications
You must be signed in to change notification settings - Fork 515
ti_opencti: support filtering of indicators and deduplication mechanism #15876
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_opencti: support filtering of indicators and deduplication mechanism #15876
Conversation
|
Pinging @elastic/security-service-integrations (Team:Security-Service Integrations) |
🚀 Benchmarks reportTo see the full report comment with |
| .filter(f, f.condition) | ||
| // Map to create the final filter objects (removing the condition field) | ||
| .map(f, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| .filter(f, f.condition) | |
| // Map to create the final filter objects (removing the condition field) | |
| .map(f, { | |
| // and map to create the final filter objects (removing the condition field) | |
| .map(f, f.condition, { |
| "want_more": body.data.indicators.pageInfo.hasNextPage, | ||
| "cursor": { "value": body.data.indicators.pageInfo.endCursor }, | ||
| "last_modified": has(body.data.indicators.edges) && body.data.indicators.edges.size() > 0 ? | ||
| body.data.indicators.edges.map(e, e.node.modified).max() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| body.data.indicators.edges.map(e, e.node.modified).max() | |
| body.data.indicators.edges.map(e, timestamp(e.node.modified)).max() |
The current code is returns the lexical match, which is accidentally correct when the precision is constant, but we don't know that that is always the case.
| - set: | ||
| field: opencti.indicator.rule_compatible | ||
| value: true | ||
| if: | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if: | | |
| if: >- |
| if (score >= 80) { | ||
| ctx.opencti.indicator.detection_rule.severity = 'critical'; | ||
| ctx.opencti.indicator.detection_rule.risk_score = 90; | ||
| } else if (score >= 60) { | ||
| ctx.opencti.indicator.detection_rule.severity = 'high'; | ||
| ctx.opencti.indicator.detection_rule.risk_score = 70; | ||
| } else if (score >= 40) { | ||
| ctx.opencti.indicator.detection_rule.severity = 'medium'; | ||
| ctx.opencti.indicator.detection_rule.risk_score = 50; | ||
| } else { | ||
| ctx.opencti.indicator.detection_rule.severity = 'low'; | ||
| ctx.opencti.indicator.detection_rule.risk_score = 30; | ||
| } | ||
| } else { | ||
| ctx.opencti.indicator.detection_rule.severity = 'medium'; | ||
| ctx.opencti.indicator.detection_rule.risk_score = 50; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where do these values come from? (this is probably more a question for @SamuelHassine)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we couldn't find where these assignments come from, we are removing them for now.
💚 Build Succeeded
History
|
|
Package ti_opencti - 2.10.0 containing this change is available at https://epr.elastic.co/package/ti_opencti/2.10.0/ |
…sm (elastic#15876) This PR contains changes listed below for the OpenCTI integration: - Added support for the following filters: - Pattern Types - Indicator Types - Revoked Status - Valid From - Valid Until - Label IDs (UUIDs) - Minimum Confidence Level - Author IDs (UUIDs) - Creator User IDs (UUIDs) - Created After - Modified After - Marking Definition IDs (UUIDs) - Added tracking of the last modified timestamp in state to prevent re-fetching already processed indicators. - Added fingerprint processor to prevent duplicate indicators. - Added useful fields to events for the creation of detection rules. - Updated OpenCTI logo.
Proposed commit message
Note
This is a continuation of #15332
Checklist
changelog.ymlfile.How to test this PR locally
A free demo account for an OpenCTI platform with sample data can be created at https://filigran.io/filigran-account-creation/. I can provide mine if necessary.
Manual testing have been conducted to verify filters work and no duplicates indicators are ingested.
Related issues
Screenshots