Skip to content

ti_custom: Improve pagination options for TAXII servers#12084

Merged
chemamartinez merged 0 commit intoelastic:mainfrom
chemamartinez:ti_custom-pagination-enhancement
Dec 17, 2024
Merged

ti_custom: Improve pagination options for TAXII servers#12084
chemamartinez merged 0 commit intoelastic:mainfrom
chemamartinez:ti_custom-pagination-enhancement

Conversation

@chemamartinez
Copy link
Copy Markdown
Contributor

@chemamartinez chemamartinez commented Dec 12, 2024

Proposed commit message

This PR adds the following changes:

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

@chemamartinez chemamartinez added enhancement New feature or request Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] Integration:ti_custom Custom Threat Intelligence labels Dec 12, 2024
@chemamartinez chemamartinez self-assigned this Dec 12, 2024
@chemamartinez chemamartinez marked this pull request as ready for review December 12, 2024 19:07
@chemamartinez chemamartinez requested a review from a team as a code owner December 12, 2024 19:07
@elasticmachine
Copy link
Copy Markdown

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

@elastic-vault-github-plugin-prod
Copy link
Copy Markdown

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

@elasticmachine
Copy link
Copy Markdown

💚 Build Succeeded

cc @chemamartinez

Copy link
Copy Markdown
Contributor

@chrisberkhout chrisberkhout left a comment

Choose a reason for hiding this comment

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

The change is good.

You can use optMap, etc. to handle optional values in a more streamlined way.

I think that's better at least for the simpler examples. Maybe not worth it for the more complicated one.

Copy link
Copy Markdown
Contributor

@chrisberkhout chrisberkhout left a comment

Choose a reason for hiding this comment

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

one thing left in by mistake

@elastic-sonarqube
Copy link
Copy Markdown

@elasticmachine
Copy link
Copy Markdown

💚 Build Succeeded

History

  • 💚 Build #19558 succeeded b2083b6bea53f5cd973e1e1f418bbd862ed4eb59
  • 💚 Build #19423 succeeded d2c27c9854035d6cf31ee7d1a9d65aec1bdb9e6a

cc @chemamartinez

@chemamartinez chemamartinez merged commit 97ab6aa into elastic:main Dec 17, 2024
@elastic-vault-github-plugin-prod
Copy link
Copy Markdown

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

@AkodoGarou
Copy link
Copy Markdown

Good Morning.

I found your integration, and it fits perfect into our TI feed for hashes with another server we have. But I'm running into an issue, where I'm getting a CEL error:

failed eval: ERROR: :32:22: no such key: objects
| ).do_request().as(resp, (resp.StatusCode == 200 || resp.StatusCode == 206) ?
| .....................^,
Processor "conditional" with tag "" in pipeline "logs-ti_custom.indicator-0.6.0" failed with message "Error during CEL program evaluation"

Is this where I need to set my CEL url location? And would that be changing the code that was commented out in the "The CEL program to be run for each polling." in settings? Any help would be appreciated.

@efd6
Copy link
Copy Markdown
Contributor

efd6 commented Jan 30, 2025

@AkodoGarou From the error you have posted, you are likely using the built-in CEL program. What is happening is that the document being returned by the API endpoint does not contain a field "objects", which the program expects (you can see that here).

There is not enough information in your post to figure out what is going wrong for you, but this really should be a question in community slack or at https://discuss.elastic.co/. If you believe that it is a bug, please file an issue here.

harnish-crest-data pushed a commit to chavdaharnish/integrations that referenced this pull request Feb 4, 2025
Changes added:
- Add a limit parameter, that can be used to control the size of responses from TAXII servers (see https://docs.oasis-open.org/cti/taxii/v2.1/os/taxii-v2.1-os.html#_Toc31107517)
- To avoid fetching duplicate indicators every interval, now the response header X-Taxii-Date-Added-Last is stored in the cursor and used to populate the added_after parameter every iteration (see https://docs.oasis-open.org/cti/taxii/v2.1/os/taxii-v2.1-os.html#_Toc31107519)
harnish-crest-data pushed a commit to chavdaharnish/integrations that referenced this pull request Feb 5, 2025
Changes added:
- Add a limit parameter, that can be used to control the size of responses from TAXII servers (see https://docs.oasis-open.org/cti/taxii/v2.1/os/taxii-v2.1-os.html#_Toc31107517)
- To avoid fetching duplicate indicators every interval, now the response header X-Taxii-Date-Added-Last is stored in the cursor and used to populate the added_after parameter every iteration (see https://docs.oasis-open.org/cti/taxii/v2.1/os/taxii-v2.1-os.html#_Toc31107519)
@chemamartinez chemamartinez deleted the ti_custom-pagination-enhancement branch February 6, 2025 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Integration:ti_custom Custom Threat Intelligence Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants