Skip to content

Conversation

mohitjha-elastic
Copy link
Collaborator

@mohitjha-elastic mohitjha-elastic commented Apr 10, 2025

Proposed Commit Message

ti_recordedfuture: add support for playbook and triggered alerts as two new data streams

This adds support for the Playbook and Triggered Alerts event type as two new data streams to
enhance the overall visibility of threat data in the Recorded Future integration.

This changes also includes updating ecs version to 8.17.0 in all existing data streams.

Sanitized test case inputs were obtained from the Recorded Future API for Playbook Alerts[1]
and from the Recorded Future Connect API for Triggered Alerts[2].

[1] https://api.recordedfuture.com/playbook-alert
[2] https://api.recordedfuture.com/v2/#!/Alerts/Alert_Notification_Search

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.

How to test this PR locally

Clone integrations repo.
Install the elastic package locally.
Start the elastic stack using the elastic package.
Move to integrations/packages/ti_recordedfuture directory.
Run the following command to run tests.
elastic-package test -v

Related issues

Screenshots

playbook-alert-dashboard

trigg-alert-dashboard

@mohitjha-elastic mohitjha-elastic added enhancement New feature or request dashboard Relates to a Kibana dashboard bug, enhancement, or modification. Integration:ti_recordedfuture Recorded Future Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] Team:Sit-Crest Crest developers on the Security Integrations team [elastic/sit-crest-contractors] labels Apr 10, 2025
@mohitjha-elastic mohitjha-elastic self-assigned this Apr 10, 2025
@mohitjha-elastic mohitjha-elastic requested a review from a team as a code owner April 10, 2025 12:25
@elasticmachine
Copy link

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

@elastic-vault-github-plugin-prod

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

categories: ["security", "threat_intel"]
conditions:
kibana:
version: "^8.13.0 || ^9.0.0"
version: "^8.18.0 || ^9.0.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

Because we are coupling agentless update with the new datastreams, users before 8.18.0 wont be able to use these new datastreams. Is that fine @jamiehynds / @cpascale43 ?

Choose a reason for hiding this comment

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

@kcreddy I think that's ok, should we document it somewhere though?

Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason this could not be broken into two changes, one for the new data streams and one for the agentless update?

Copy link
Contributor

Choose a reason for hiding this comment

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

Same being done here #13680 (comment). Same clarification also applies there. cc: @janvi-elastic

I think we should decouple the agentless update and new datastream enhancements unless there is any strong reason not to.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@efd6 @kcreddy
The new data streams and dashboards have been implemented and tested on version 8.18. While downgrading to an earlier version is possible, it would require significant effort. Is there any key reason why we cannot proceed with the current implementation without decoupling?

Going forward, we will ensure that enhancement changes and agentless implementations are decoupled to avoid similar challenges.

Please let me know your thoughts.

Copy link
Contributor

@kcreddy kcreddy May 8, 2025

Choose a reason for hiding this comment

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

Is there any key reason why we cannot proceed with the current implementation without decoupling?

More users can benefit from the enhancement. Example

Going forward, we will ensure that enhancement changes and agentless implementations are decoupled to avoid similar challenges.

I'm okay with this, but please make sure to de-couple agentless update for future enhancement tasks.

cc: @piyush-elastic

@@ -10,15 +10,54 @@ from multiple entities, it's necessary to define one integration for each.
Alternatively, it's also possible to use the integration to fetch custom Fusion files
by supplying the URL to the CSV file as the _Custom_ _URL_ configuration option.

It also fetches [Playbook Alerts](https://api.recordedfuture.com/playbook-alert) from the Recorded Future API and [Legacy Alerts](https://api.recordedfuture.com/v2/#!/Alerts/Alert_Notification_Search) via the Recorded Future Connect API, ensuring comprehensive threat intelligence coverage.
Copy link
Contributor

@kcreddy kcreddy Apr 24, 2025

Choose a reason for hiding this comment

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

What was the reason for calling them Legacy Alerts? I don't see them as deprecated in the API doc (/v3).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In their Recorded Future APIs doc, under the description of connect api, its being written that this is the legacy alert. The same has been mentioned in the issue requirement.

Copy link
Contributor

Choose a reason for hiding this comment

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

@cpascale43 can you confirm if the alerts retrieved from Connect API should be called Legacy Alerts?
For example, the Microsoft connector for recorded future calls them Triggered Alerts just like the Connect API doc.

Choose a reason for hiding this comment

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

@kcreddy good catch, let's go with Triggered Alerts then

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks Carrie.
@mohitjha-elastic, please update the data_stream name.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@kcreddy Updated the PR with the changes. Can you please take a look?

Copy link
Contributor

Choose a reason for hiding this comment

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

1. Add uri_parts processor.
2. Update navigation link style in dashboard table of contents.
3. Remove blank space in readme.
4. Update dashboard image.
"note_author": null,
"note_date": "2025-03-31T04:03:56.425Z",
"status_date": "2025-03-31T04:03:56.425Z",
"triggered": "2026-03-31T04:03:56.425Z",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"triggered": "2026-03-31T04:03:56.425Z",
"triggered": "2500-03-31T04:03:56.425Z",

"note_author": null,
"note_date": "2025-03-31T04:03:56.425Z",
"status_date": "2025-03-31T04:03:56.425Z",
"triggered": "2027-03-31T04:03:56.425Z",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"triggered": "2027-03-31T04:03:56.425Z",
"triggered": "3000-03-31T04:03:56.425Z",

categories: ["security", "threat_intel"]
conditions:
kibana:
version: "^8.13.0 || ^9.0.0"
version: "^8.18.0 || ^9.0.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason this could not be broken into two changes, one for the new data streams and one for the agentless update?

1. Rename legacy alert to triggered alert everywhere.
2. Add more data in system test.
3. Fix indentation in CEL code.
@mohitjha-elastic mohitjha-elastic requested a review from efd6 May 8, 2025 09:42
Copy link
Contributor

@kcreddy kcreddy left a comment

Choose a reason for hiding this comment

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

@mohitjha-elastic, can you change legacy to triggered in following places as well?

  1. PR title
  2. commit message
  3. pipeline test file names

Rename pipeline test files from legacy to triggered alert.
@mohitjha-elastic mohitjha-elastic changed the title [ti_recordedfuture] Add Support for Legacy and Playbook Alerts [ti_recordedfuture] Add Support for Playbook and Triggered Alerts May 8, 2025
@mohitjha-elastic mohitjha-elastic requested a review from kcreddy May 8, 2025 10:24
Copy link
Contributor

@kcreddy kcreddy left a comment

Choose a reason for hiding this comment

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

LGTM for my comments

@mohitjha-elastic mohitjha-elastic requested a review from efd6 May 9, 2025 04:39
"error": {
"code": string(resp.StatusCode),
"id": string(resp.Status),
"message": "POST " + state.url.trim_right("/") + "/playbook-alert/search" +
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"message": "POST " + state.url.trim_right("/") + "/playbook-alert/search" +
"message": "POST " + state.url.trim_right("/") + "/playbook-alert/search: " +

Comment on lines 146 to 152
"message": "POST " + state.url.trim_right("/") + "/playbook-alert/" +
(string(state.worklist.data[state.next].category) == "cyber_vulnerability" ?
"vulnerability"
:
string(state.worklist.data[state.next].category))
+ "/" + string(state.worklist.data[state.next].playbook_alert_id) +
(
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure we need this much detail here; this is just to allow the user to see which part of the program the request failed in, not the exact request.

Suggested change
"message": "POST " + state.url.trim_right("/") + "/playbook-alert/" +
(string(state.worklist.data[state.next].category) == "cyber_vulnerability" ?
"vulnerability"
:
string(state.worklist.data[state.next].category))
+ "/" + string(state.worklist.data[state.next].playbook_alert_id) +
(
"message": "POST " + state.url.trim_right("/") + "/playbook-alert/:" + (

"error": {
"code": string(resp.StatusCode),
"id": string(resp.Status),
"message": "GET "+ state.url.trim_right("/") + "/v3/alerts:" + (
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"message": "GET "+ state.url.trim_right("/") + "/v3/alerts:" + (
"message": "GET "+ state.url.trim_right("/") + "/v3/alerts: " + (

Minor changes in the cel files, refactor the message in case of error.
@mohitjha-elastic mohitjha-elastic requested a review from efd6 May 12, 2025 07:12
Copy link

@elasticmachine
Copy link

💚 Build Succeeded

History

cc @mohitjha-elastic

@efd6 efd6 merged commit d8c91a6 into elastic:main May 12, 2025
7 checks passed
@elastic-vault-github-plugin-prod

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

@mohitjha-elastic mohitjha-elastic deleted the ti_recordedfuture-1.30.0 branch May 15, 2025 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dashboard Relates to a Kibana dashboard bug, enhancement, or modification. enhancement New feature or request Integration:ti_recordedfuture Recorded Future Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] Team:Sit-Crest Crest developers on the Security Integrations team [elastic/sit-crest-contractors]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[recorded_future] Add 2 alerts datastreams
5 participants