Skip to content

[ti_recordedfuture] Download threat data gzipped and only when new - #14159

Merged
chrisberkhout merged 15 commits into
elastic:mainfrom
chrisberkhout:ti_recordedfuture-gzip
Jun 12, 2025
Merged

[ti_recordedfuture] Download threat data gzipped and only when new#14159
chrisberkhout merged 15 commits into
elastic:mainfrom
chrisberkhout:ti_recordedfuture-gzip

Conversation

@chrisberkhout

@chrisberkhout chrisberkhout commented Jun 5, 2025

Copy link
Copy Markdown
Contributor

Proposed commit message

[ti_recordedfuture] Download threat data gzipped and only when new

Migrates from the HTTPJSON input to the CEL input so that we can
download threat intelligence data gzipped instead of uncompressed.

If the data received is not gzipped, it will still be successfully
parsed as CSV.

Data will only be downloaded when it has changed. A HEAD request is used
to check whether new data is available (whether it returns a new value
in the Etag header) before making a GET request to actually download the
data.

If a HEAD request is unsupported and returns a 4XX response code, the
GET request will proceed.

The `threat` data stream also supports setting a custom URL to download
custom fusion files. This will continue to work.

This is a breaking change, but users who had already activated the
playbook alert or triggered alert data streams will not need to reenter
an API key, they will only need to reactivate the threat intel item and
reenter any non-default settings they used.

This version has been tested against the live API.

Discussion

Can be read commit-by-commit.

See the screenshots below for details of manifest string changes and the upgrade UX.

I put a longer changelog description that should be helpful for users who have the upcoming breaking change callout functionality.

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

Related issues

Screenshots - manifest string improvements

This shows the improvements made the to manifest strings. In particular, it makes it clear that the risklist data is threat intelligence data (it goes in the threat data stream and related transform).

Screenshot 2025-06-05 at 14-31-58 changes

Screenshots - upgrade user experience

Users of the current version (1.30.0) will have the following experience when the new version (2.0.0 ) becomes available.

They will see this "Upgrade" button and press it:

Screenshot 2025-06-05 at 15-50-33 upgrade button

They will be taken to the configuration form. The HTTPJSON input is removed.

Screenshot 2025-06-05 at 15-50-48 httpjson removed

They will need to expand the "via API" section to see to see that threat intelligence is now deactivated. They can reactivate it, and reenter any non-default settings. They will not need to reenter an API key, as long as they were already collecting playbook alerts or triggered alerts. All three data streams now share the same top-level API key variable.

Screenshot 2025-06-05 at 15-51-13 in API section, threat intel deactivated (annotated)

After pressing "Upgrade integration", there will be one one more download of threat intel data (now gzipped), then future downloads will only happen new new data is available.

@chrisberkhout chrisberkhout self-assigned this Jun 5, 2025
@chrisberkhout chrisberkhout added enhancement New feature or request Integration:ti_recordedfuture Recorded Future Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] labels Jun 5, 2025
@chrisberkhout
chrisberkhout force-pushed the ti_recordedfuture-gzip branch from 1399aa8 to 3c4a138 Compare June 5, 2025 13:49
@elastic-vault-github-plugin-prod

elastic-vault-github-plugin-prod Bot commented Jun 5, 2025

Copy link
Copy Markdown
Contributor

🚀 Benchmarks report

Package ti_recordedfuture 👍(2) 💚(0) 💔(1)

Expand to view
Data stream Previous EPS New EPS Diff (%) Result
triggered_alert 8620.69 6535.95 -2084.74 (-24.18%) 💔

To see the full report comment with /test benchmark fullreport

@chrisberkhout
chrisberkhout force-pushed the ti_recordedfuture-gzip branch from 3c4a138 to 0ded9a9 Compare June 5, 2025 14:20
@chrisberkhout
chrisberkhout marked this pull request as ready for review June 5, 2025 14:50
@chrisberkhout
chrisberkhout requested a review from a team as a code owner June 5, 2025 14:50
@elasticmachine

Copy link
Copy Markdown

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

Comment thread packages/ti_recordedfuture/data_stream/threat/agent/stream/cel.yml.hbs Outdated
Comment thread packages/ti_recordedfuture/data_stream/threat/agent/stream/cel.yml.hbs Outdated
Comment thread packages/ti_recordedfuture/manifest.yml Outdated
Comment thread packages/ti_recordedfuture/data_stream/playbook_alert/manifest.yml
Comment thread packages/ti_recordedfuture/data_stream/threat/manifest.yml
Comment thread packages/ti_recordedfuture/data_stream/threat/manifest.yml Outdated

@andrewkroh andrewkroh left a comment

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.

I think we should update the README to explain 'how it works.' It's important to clarify that it uses the ETag to detect changes and will not fetch again until there is new data to download.

@chrisberkhout
chrisberkhout force-pushed the ti_recordedfuture-gzip branch from 0ded9a9 to 6de43fb Compare June 11, 2025 16:00
@chrisberkhout

Copy link
Copy Markdown
Contributor Author

I think we should update the README to explain 'how it works.' It's important to clarify that it uses the ETag to detect changes and will not fetch again until there is new data to download.

Done. I rewrote the top section of the README. I covered this point as follows:

The threat data stream will check whether the available data has changed before actually downloading it. A short interval setting will mean that it checks frequently, but each version of the data will only be ingested once.

@elasticmachine

Copy link
Copy Markdown

💚 Build Succeeded

History

cc @chrisberkhout

@kcreddy kcreddy left a comment

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.

Thank you! LGTM for my comments.

@chrisberkhout
chrisberkhout merged commit f060f4c into elastic:main Jun 12, 2025
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

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

@andrewkroh andrewkroh added the documentation Improvements or additions to documentation. Applied to PRs that modify *.md files. label Jul 1, 2025
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_recordedfuture Recorded Future Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations]

4 participants