[ti_eset] Add new feeds - #18709
Conversation
ReviewersBuildkite won't run for external contributors automatically; you need to add a comment:
NOTE: https://github.com/elastic/integrations/blob/main/.buildkite/pull-requests.json contains all those details. |
| - foreach: | ||
| field: eti._patterns | ||
| processor: | ||
| grok: | ||
| field: _ingest._value | ||
| patterns: | ||
| - "^\\[?file:hashes.'MD5'%{SPACE}=%{SPACE}'%{DATA:threat.indicator.file.hash.md5}'\\]?" | ||
| - "^\\[?file:hashes.'SHA-1'%{SPACE}=%{SPACE}'%{DATA:threat.indicator.file.hash.sha1}'\\]?" | ||
| - "^\\[?file:hashes.'SHA-256'%{SPACE}=%{SPACE}'%{DATA:threat.indicator.file.hash.sha256}'\\]?" | ||
| ignore_failure: true | ||
| - set: |
There was a problem hiding this comment.
🟡 Medium ingest_pipeline/default.yml:93
The foreach processor on eti._patterns at line 93 is missing an if condition. The preceding split processor has ignore_missing: true, so when eti.pattern is null, eti._patterns is never created. This causes the foreach to fail with a missing-field error, triggering on_failure and incorrectly marking the event as a pipeline error. Consider adding if: ctx.eti?._patterns != null to the foreach processor, matching the pattern used in the cc data stream.
- foreach:
+ foreach:
field: eti._patterns
processor:
grok:
field: _ingest._value
patterns:
- "^\\[?file:hashes.'MD5'%{SPACE}=%{SPACE}'%{DATA:threat.indicator.file.hash.md5}'\\]?"
- "^\\[?file:hashes.'SHA-1'%{SPACE}=%{SPACE}'%{DATA:threat.indicator.file.hash.sha1}'\\]?"
- "^\\[?file:hashes.'SHA-256'%{SPACE}=%{SPACE}'%{DATA:threat.indicator.file.hash.sha256}'\\]?"
ignore_failure: true
+ if: ctx.eti?._patterns != nullAlso found in 7 other location(s)
packages/ti_eset/data_stream/smishing/elasticsearch/ingest_pipeline/default.yml:93
The
foreachprocessor at line 93 operates oneti._patternswithout anifguard orignore_missing: true. Ifeti.patternis missing or null on an incoming document, thesplitat line 88 silently skips (due toignore_missing: true), leavingeti._patternsundefined. Theforeachprocessor then fails because the field doesn't exist, sending the document to theon_failurehandler and incorrectly marking it as a pipeline error. Other pipelines in the same integration (e.g.,cc,domains) correctly guard this withif: "ctx.eti?._patterns != null"on theforeach. This pipeline should add the same guard.
packages/ti_eset/data_stream/scamurl/elasticsearch/ingest_pipeline/default.yml:93
The
foreachprocessor at line 93 iterates overeti._patternsbut does not specifyignore_missing: true. Thesplitprocessor at line 88 that createseti._patternshasignore_missing: true, meaning ifeti.patternis absent,eti._patternswill not be created. When theforeachprocessor then tries to iterate over the non-existenteti._patternsfield, it will throw an error and trigger theon_failurehandler, marking the document as a pipeline error. Addingignore_missing: trueto theforeachprocessor would fix this.
packages/ti_eset/data_stream/ransomware/elasticsearch/ingest_pipeline/default.yml:93
The
foreachprocessor at line 93 iterating overeti._patternsis missing anifguard (e.g.,if: ctx.eti?._patterns != null). The precedingsplitprocessor at line 88 usesignore_missing: true, so ifeti.patternis absent,eti._patternswill not be created. Theforeachprocessor will then fail because the field does not exist, sending the document to theon_failurehandler. Other existing pipelines in this integration (e.g.,cc,domains) correctly includeif: "ctx.eti?._patterns != null"on their equivalentforeachprocessor. The fix is to addif: ctx.eti?._patterns != nullto theforeachprocessor.
packages/ti_eset/data_stream/androidthreats/elasticsearch/ingest_pipeline/default.yml:93
The
foreachprocessor at line 93 iterates overeti._patternsbut does not haveignore_missing: true. Ifeti.patternis missing/null, thesplitprocessor at line 88 (which hasignore_missing: true) will silently skip without creatingeti._patterns. The subsequentforeachwill then fail because the field does not exist, causing the pipeline'son_failurehandler to fire. Addignore_missing: trueto theforeachat line 93.
packages/ti_eset/data_stream/puadualapps/elasticsearch/ingest_pipeline/default.yml:93
The
foreachprocessor at line 93 iterating overeti._patternsdoes not haveignore_missing: true. Ifeti.patternis missing from the document, thesplitprocessor at line 88 will be a no-op (due to its ownignore_missing: true), meaningeti._patternswill not be created. The subsequentforeachon the non-existenteti._patternsfield will then fail, sending the document to theon_failurehandler. Anignore_missing: trueshould be added to theforeachat line 93.
packages/ti_eset/data_stream/puaadware/elasticsearch/ingest_pipeline/default.yml:93
The
foreachprocessor at line 93 iterating overeti._patternshas noifcondition and noignore_missing: true. If theeti.patternfield is missing from a document (thesplitprocessor at line 88 usesignore_missing: trueso it silently skips),eti._patternswill not exist. Theforeachprocessor will then fail because the field it is trying to iterate is missing, triggering the pipeline'son_failurehandler. Anif: ctx.eti?._patterns != nullcondition orignore_missing: trueshould be added to theforeach.
packages/ti_eset/data_stream/emailattachments/elasticsearch/ingest_pipeline/default.yml:93
The
foreachprocessor at line 93 iterating overeti._patternsdoes not specifyignore_missing: true. Thesplitprocessor at line 88 that createseti._patternshasignore_missing: true, meaning ifeti.patternis missing,eti._patternswill not be created. This causes theforeachto fail with an error for any document whereeti.patternis absent, sending it to theon_failurehandler. Addingignore_missing: trueto theforeachor adding anifcondition would fix this.
🤖 Copy this AI Prompt to have your agent fix this:
In file packages/ti_eset/data_stream/androidinfostealer/elasticsearch/ingest_pipeline/default.yml around lines 93-103:
The `foreach` processor on `eti._patterns` at line 93 is missing an `if` condition. The preceding `split` processor has `ignore_missing: true`, so when `eti.pattern` is null, `eti._patterns` is never created. This causes the `foreach` to fail with a missing-field error, triggering `on_failure` and incorrectly marking the event as a pipeline error. Consider adding `if: ctx.eti?._patterns != null` to the `foreach` processor, matching the pattern used in the `cc` data stream.
Also found in 7 other location(s):
- packages/ti_eset/data_stream/smishing/elasticsearch/ingest_pipeline/default.yml:93 -- The `foreach` processor at line 93 operates on `eti._patterns` without an `if` guard or `ignore_missing: true`. If `eti.pattern` is missing or null on an incoming document, the `split` at line 88 silently skips (due to `ignore_missing: true`), leaving `eti._patterns` undefined. The `foreach` processor then fails because the field doesn't exist, sending the document to the `on_failure` handler and incorrectly marking it as a pipeline error. Other pipelines in the same integration (e.g., `cc`, `domains`) correctly guard this with `if: "ctx.eti?._patterns != null"` on the `foreach`. This pipeline should add the same guard.
- packages/ti_eset/data_stream/scamurl/elasticsearch/ingest_pipeline/default.yml:93 -- The `foreach` processor at line 93 iterates over `eti._patterns` but does not specify `ignore_missing: true`. The `split` processor at line 88 that creates `eti._patterns` has `ignore_missing: true`, meaning if `eti.pattern` is absent, `eti._patterns` will not be created. When the `foreach` processor then tries to iterate over the non-existent `eti._patterns` field, it will throw an error and trigger the `on_failure` handler, marking the document as a pipeline error. Adding `ignore_missing: true` to the `foreach` processor would fix this.
- packages/ti_eset/data_stream/ransomware/elasticsearch/ingest_pipeline/default.yml:93 -- The `foreach` processor at line 93 iterating over `eti._patterns` is missing an `if` guard (e.g., `if: ctx.eti?._patterns != null`). The preceding `split` processor at line 88 uses `ignore_missing: true`, so if `eti.pattern` is absent, `eti._patterns` will not be created. The `foreach` processor will then fail because the field does not exist, sending the document to the `on_failure` handler. Other existing pipelines in this integration (e.g., `cc`, `domains`) correctly include `if: "ctx.eti?._patterns != null"` on their equivalent `foreach` processor. The fix is to add `if: ctx.eti?._patterns != null` to the `foreach` processor.
- packages/ti_eset/data_stream/androidthreats/elasticsearch/ingest_pipeline/default.yml:93 -- The `foreach` processor at line 93 iterates over `eti._patterns` but does not have `ignore_missing: true`. If `eti.pattern` is missing/null, the `split` processor at line 88 (which has `ignore_missing: true`) will silently skip without creating `eti._patterns`. The subsequent `foreach` will then fail because the field does not exist, causing the pipeline's `on_failure` handler to fire. Add `ignore_missing: true` to the `foreach` at line 93.
- packages/ti_eset/data_stream/puadualapps/elasticsearch/ingest_pipeline/default.yml:93 -- The `foreach` processor at line 93 iterating over `eti._patterns` does not have `ignore_missing: true`. If `eti.pattern` is missing from the document, the `split` processor at line 88 will be a no-op (due to its own `ignore_missing: true`), meaning `eti._patterns` will not be created. The subsequent `foreach` on the non-existent `eti._patterns` field will then fail, sending the document to the `on_failure` handler. An `ignore_missing: true` should be added to the `foreach` at line 93.
- packages/ti_eset/data_stream/puaadware/elasticsearch/ingest_pipeline/default.yml:93 -- The `foreach` processor at line 93 iterating over `eti._patterns` has no `if` condition and no `ignore_missing: true`. If the `eti.pattern` field is missing from a document (the `split` processor at line 88 uses `ignore_missing: true` so it silently skips), `eti._patterns` will not exist. The `foreach` processor will then fail because the field it is trying to iterate is missing, triggering the pipeline's `on_failure` handler. An `if: ctx.eti?._patterns != null` condition or `ignore_missing: true` should be added to the `foreach`.
- packages/ti_eset/data_stream/emailattachments/elasticsearch/ingest_pipeline/default.yml:93 -- The `foreach` processor at line 93 iterating over `eti._patterns` does not specify `ignore_missing: true`. The `split` processor at line 88 that creates `eti._patterns` has `ignore_missing: true`, meaning if `eti.pattern` is missing, `eti._patterns` will not be created. This causes the `foreach` to fail with an error for any document where `eti.pattern` is absent, sending it to the `on_failure` handler. Adding `ignore_missing: true` to the `foreach` or adding an `if` condition would fix this.
|
Pinging @elastic/security-service-integrations (Team:Security-Service Integrations) |
efd6
left a comment
There was a problem hiding this comment.
This PR is too large to reliably review. It would be better if you could send this in a sequence of PRs, possibly to a long lived feature branch. If you would like to use the feature branch approach, I can create the target for you.
Also, I see that you are using HTTP JSON. The current agent templates use httpjson, but generally we will use cel when adding new integrations/data streams.
|
@efd6 These data streams parses IoC with URLs or files. Differences between them are only in one grok processor and naming.
Should this be done in this PR or we can implement this in future version? Do you have any example integration? |
|
I have created a ti_set_polakovicp_enhancements branch that you can target.
In these additions; migrating is harder than starting with CEL from the outset.
Here's a CEL input agent configuration that will work. You will need to make the input in the data stream be |
Proposed commit message
PR add additional data streams to ti_eset integration: androidthreats, androidinfostealer, cryptoscam, emailattachments, phishingurl, puaadware, puadualapps, scamurl, smishing, smsscam, ransomware
Checklist
changelog.ymlfile.