Skip to content

trend_micro_vision_one: handle detection documents that have a requests array instead of a request field - #7951

Merged
efd6 merged 2 commits into
elastic:mainfrom
efd6:7871-trend_micro_vision_one
Sep 27, 2023
Merged

trend_micro_vision_one: handle detection documents that have a requests array instead of a request field#7951
efd6 merged 2 commits into
elastic:mainfrom
efd6:7871-trend_micro_vision_one

Conversation

@efd6

@efd6 efd6 commented Sep 25, 2023

Copy link
Copy Markdown
Contributor

What does this PR do?

The Trend Micro detections API documentation[1] states that the request field
is a scalar string holding a URL. Notwithstanding this, we have seen cases in
the wild where there is no request field, but rather a requests field that is
an array of strings, apparently holding URLs. This change splits documents that
have a requests field, and promotes each of the elements of the requests array
to be request unless there is a request field already present.

https://automation.trendmicro.com/xdr/api-v3#tag/Search/paths/~1v3.0~1search~1detections/get

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.

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Screenshots

@efd6 efd6 self-assigned this Sep 25, 2023
@efd6
efd6 force-pushed the 7871-trend_micro_vision_one branch from 8f6b773 to 2804457 Compare September 25, 2023 02:32
@elasticmachine

elasticmachine commented Sep 25, 2023

Copy link
Copy Markdown

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-09-27T08:55:51.829+0000

  • Duration: 16 min 56 sec

Test stats 🧪

Test Results
Failed 0
Passed 19
Skipped 0
Total 19

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@elasticmachine

elasticmachine commented Sep 25, 2023

Copy link
Copy Markdown

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (3/3) 💚
Files 100.0% (3/3) 💚
Classes 100.0% (3/3) 💚
Methods 95.652% (44/46) 👍 7.28
Lines 95.226% (1516/1592) 👍 0.981
Conditionals 100.0% (0/0) 💚
@efd6 efd6 changed the title trend_micro_vision: handle detection documents that have a requests array instead of a request field Sep 25, 2023
@efd6
efd6 force-pushed the 7871-trend_micro_vision_one branch from 2804457 to 3651191 Compare September 25, 2023 03:13
@efd6
efd6 marked this pull request as ready for review September 25, 2023 03:51
@efd6
efd6 requested a review from a team as a code owner September 25, 2023 03:51
@elasticmachine

Copy link
Copy Markdown

Pinging @elastic/security-external-integrations (Team:Security-External Integrations)

Comment thread packages/trend_micro_vision_one/_dev/deploy/docker/files/config.yml Outdated
…ts array instead of a request field

The Trend Micro detections API documentation[1] states that the request field
is a scalar string holding a URL. Notwithstanding this, we have seen cases in
the wild where there is no request field, but rather a requests field that is
an array of strings, apparently holding URLs. This change splits documents that
have a requests field, and promotes each of the elements of the requests array
to be request unless there is a request field already present.

https://automation.trendmicro.com/xdr/api-v3#tag/Search/paths/~1v3.0~1search~1detections/get
@efd6
efd6 force-pushed the 7871-trend_micro_vision_one branch from 3651191 to dd318ae Compare September 27, 2023 08:42
Add a test that includes an event that would have come from a set of
events that had an requests array instead of a request scalar.

@bhapas bhapas 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.

LGTM

@efd6
efd6 merged commit dfd6aa2 into elastic:main Sep 27, 2023
@elasticmachine

Copy link
Copy Markdown

Package trend_micro_vision_one - 1.11.0 containing this change is available at https://epr.elastic.co/search?package=trend_micro_vision_one

@efd6
efd6 deleted the 7871-trend_micro_vision_one branch February 5, 2025 22:04
orestisfl pushed a commit to orestisfl/integrations that referenced this pull request May 15, 2026
…ts array instead of a request field (elastic#7951)

The Trend Micro detections API documentation[1] states that the request field
is a scalar string holding a URL. Notwithstanding this, we have seen cases in
the wild where there is no request field, but rather a requests field that is
an array of strings, apparently holding URLs. This change splits documents that
have a requests field, and promotes each of the elements of the requests array
to be request unless there is a request field already present.

[1]https://automation.trendmicro.com/xdr/api-v3#tag/Search/paths/~1v3.0~1search~1detections/get
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:trend_micro_vision_one TrendAI Vision One

3 participants