Skip to content

ti_opencti: support filtering of indicators and deduplication mechanism - #15876

Merged
chemamartinez merged 7 commits into
elastic:mainfrom
chemamartinez:25881-opencti-duplicate-data
Nov 12, 2025
Merged

ti_opencti: support filtering of indicators and deduplication mechanism#15876
chemamartinez merged 7 commits into
elastic:mainfrom
chemamartinez:25881-opencti-duplicate-data

Conversation

@chemamartinez

@chemamartinez chemamartinez commented Nov 5, 2025

Copy link
Copy Markdown
Contributor

Proposed commit message

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.

Note

This is a continuation of #15332

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.
  • I have verified that any added dashboard complies with Kibana's Dashboard good practices

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

opencti-config
@chemamartinez chemamartinez self-assigned this Nov 5, 2025
@chemamartinez chemamartinez added enhancement New feature or request Integration:ti_opencti OpenCTI Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] labels Nov 5, 2025
@chemamartinez
chemamartinez marked this pull request as ready for review November 5, 2025 14:39
@chemamartinez
chemamartinez requested a review from a team as a code owner November 5, 2025 14:39
@elasticmachine

Copy link
Copy Markdown

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

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

@andrewkroh andrewkroh added the documentation Improvements or additions to documentation. Applied to PRs that modify *.md files. label Nov 5, 2025
Comment on lines +156 to +158
.filter(f, f.condition)
// Map to create the final filter objects (removing the condition field)
.map(f, {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.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()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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: |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if: |
if: >-
Comment on lines +935 to +950
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;

Copy link
Copy Markdown
Contributor

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)

Copy link
Copy Markdown
Contributor Author

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.

@chemamartinez
chemamartinez requested a review from efd6 November 11, 2025 08:01
@elasticmachine

Copy link
Copy Markdown

💚 Build Succeeded

History

cc @chemamartinez

@chemamartinez
chemamartinez merged commit fa9f093 into elastic:main Nov 12, 2025
8 checks passed
@chemamartinez
chemamartinez deleted the 25881-opencti-duplicate-data branch November 12, 2025 10:21
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

Package ti_opencti - 2.10.0 containing this change is available at https://epr.elastic.co/package/ti_opencti/2.10.0/

tehbooom pushed a commit to tehbooom/integrations that referenced this pull request Nov 19, 2025
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation. Applied to PRs that modify *.md files. enhancement New feature or request Integration:ti_opencti OpenCTI Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations]

4 participants