-
Notifications
You must be signed in to change notification settings - Fork 511
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
base: main
Are you sure you want to change the base?
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)
💚 Build Succeeded
History
|
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