Skip to content

Fix: domain/url enrichment KeyError on case-mismatched indicator values#44332

Merged
dantavori merged 31 commits into
masterfrom
enrichment-bug-fix-XSUP-69120
May 26, 2026
Merged

Fix: domain/url enrichment KeyError on case-mismatched indicator values#44332
dantavori merged 31 commits into
masterfrom
enrichment-bug-fix-XSUP-69120

Conversation

@almog2296
Copy link
Copy Markdown
Contributor

@almog2296 almog2296 commented May 18, 2026

Related Issues

fixes: XSUP-69120

Description

Aggregated enrichment commands, such as !domain-enrichment and !url-enrichment, raised a KeyError when the input casing did not match the casing of the indicator stored in TIM.

For example, an indicator created as Test1.com could later be queried as test1.com or tesT1.com. TIM returns the existing indicator using its original casing, but the aggregation logic tried to map it back using the exact input casing, causing the lookup to fail.

Root Cause

The input-to-indicator mapping in AggregatedCommandApiModule was case-sensitive and supported only a single value per normalized key.

Fix

Updated the mapping to be case-insensitive and multi-valued:

dict[str, list[IndicatorInstance]]

This ensures all case variants of the same indicator receive the correct TIM enrichment result.

Additional fixes in this PR:

  • Removed the IPEnrichment TPB dependency on CrowdStrike Falcon.
  • Replaced AlienVault v2 in the IPEnrichment TPB with Palo Alto Networks Threat Vault v2 due to frequent rate-limit issues.
  • Replaced AlienVault v2 in the DomainEnrichment TPB with CrowdStrike Falcon Intel v2 due to frequent rate-limit issues.

@almog2296 almog2296 requested a review from JudahSchwartz as a code owner May 18, 2026 08:57
@content-bot
Copy link
Copy Markdown
Contributor

🤖 AI-Powered Code Review Available

You can leverage AI-powered code review to assist with this PR!

Available Commands:

  • @marketplace-ai-reviewer start review - Initiate a full AI code review
  • @marketplace-ai-reviewer re-review - Incremental review for new commits

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 18, 2026

Coverage

Coverage Report
FileStmtsMissCoverMissing
Packs/AggregatedScripts/Scripts/CVEEnrichment
   CVEEnrichment.py140100% 
Packs/AggregatedScripts/Scripts/DomainEnrichment
   DomainEnrichment.py280100% 
Packs/AggregatedScripts/Scripts/FileEnrichment
   FileEnrichment.py220100% 
Packs/AggregatedScripts/Scripts/IPEnrichment
   IPEnrichment.py441272%136–143, 145–148
Packs/AggregatedScripts/Scripts/IndicatorEnrichment
   IndicatorEnrichment.py243697%217, 221, 254, 394, 542–543
Packs/AggregatedScripts/Scripts/URLEnrichment
   URLEnrichment.py220100% 
Packs/ApiModules/Scripts/AggregatedCommandApiModule
   AggregatedCommandApiModule.py74111584%150–153, 311–314, 316–317, 355–359, 362–363, 366–367, 391–394, 398–401, 404–405, 437–445, 622, 722, 769–770, 884–887, 889–892, 895–898, 901–902, 904, 906–908, 910–914, 916–917, 946, 951, 1130–1131, 1196–1198, 1200–1207, 1209, 1211–1214, 1216, 1218, 1321–1323, 1326, 1328–1331, 1334–1340, 1342, 1349, 1386–1387, 1407, 1522, 1536, 1765, 1805, 1925, 1927
TOTAL111413388% 

Tests Skipped Failures Errors Time
163 0 💤 0 ❌ 0 🔥 4.913s ⏱️

@almog2296 almog2296 added ready-for-pipeline-running Whether the pr is ready for running the whole pipeline, including testing on SAAS machines ready-for-ai-review The PR is ready for reviewing the PR with the AI Reviewer. labels May 18, 2026
@marketplace-ai-reviewer marketplace-ai-reviewer removed the ready-for-ai-review The PR is ready for reviewing the PR with the AI Reviewer. label May 18, 2026
@marketplace-ai-reviewer
Copy link
Copy Markdown
Contributor

🤖 Analysis started. Please wait for results...

@marketplace-ai-reviewer
Copy link
Copy Markdown
Contributor

🤖 AI Review Disclaimer

This review was generated by an AI-powered tool and may contain inaccuracies. Please be advised, and we extend our sincere apologies for any inconvenience this may cause.

Copy link
Copy Markdown
Contributor

@marketplace-ai-reviewer marketplace-ai-reviewer left a comment

Choose a reason for hiding this comment

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

Hi! Thanks for your contribution. I've reviewed the changes and have a few minor adjustments regarding metadata and release notes.

Please ensure the keywords lists in the pack metadata files include a vendor name (e.g., 'Cortex' or 'XSOAR'), and add a mandatory category to the ApiModules pack. Also, since there are no functional changes in AggregatedScripts, the release notes should be simplified to the standard metadata template.

Thanks again for your work on this!

Additionally, please address the following file-level notes:

  • Packs/AggregatedScripts/pack_metadata.json: The keywords list is empty. Please add the vendor name (e.g., 'Cortex' or 'XSOAR') to the keywords list.
  • Packs/ApiModules/pack_metadata.json: - The categories list is empty. Please ensure this mandatory key is populated with at least one category.
  • The keywords list is empty. Please add the vendor name (e.g., 'Cortex' or 'XSOAR') to the keywords list.
  • Packs/AggregatedScripts/ReleaseNotes/1_3_40.md: Since there are no functional code changes in the AggregatedScripts pack (only a version bump), the release notes should be at the pack level and use the standard metadata template. Please replace the entire contents of this file with the following:
## Aggregated Scripts
- Documentation and metadata improvements.

@JudahSchwartz, @almog2296 please review and approve the results generated by the AI Reviewer by responding 👍 on this comment.

@content-bot

This comment has been minimized.

@content-bot
Copy link
Copy Markdown
Contributor

This PR was automatically updated by a GitHub Action

  • AggregatedScripts pack version was bumped to 1.3.41.

To stop automatic version bumps, add the ignore-auto-bump-version label to the github PR.

@content-bot

This comment has been minimized.

@content-bot
Copy link
Copy Markdown
Contributor

This PR was automatically updated by a GitHub Action

  • ApiModules pack version was bumped to 2.4.18.

To stop automatic version bumps, add the ignore-auto-bump-version label to the github PR.

@almog2296 almog2296 requested a review from merit-maita as a code owner May 19, 2026 08:13
@content-bot

This comment has been minimized.

@content-bot
Copy link
Copy Markdown
Contributor

This PR was automatically updated by a GitHub Action

  • ApiModules pack version was bumped to 2.4.20.

To stop automatic version bumps, add the ignore-auto-bump-version label to the github PR.

@content-bot

This comment has been minimized.

Copy link
Copy Markdown
Contributor

@Shellyber Shellyber left a comment

Choose a reason for hiding this comment

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

Great work.

@almog2296 almog2296 added the ForceMerge Forcing the merge of the PR despite the build status label May 20, 2026
@almog2296
Copy link
Copy Markdown
Contributor Author

Requesting Force Merge for this PR.

Only the IPEnrichment TPB is failing. The failure is caused by a known issue in our build tenants, where an IP address can sometimes be extracted by !extractIndicators as both Domain and IP. This causes the ip-enrichment script to treat the input as invalid.

The PR itself changes only a small part of the module. All other TPBs are passing successfully, and the updated command was tested manually on a working tenant (the TPB also passed succesfully).

This PR also updates the IPEnrichment TPB to replace the usage of CrowdStrike Falcon, so future CrowdStrike-related PRs will not fail on this TPB unnecessarily.

@content-bot

This comment has been minimized.

@content-bot
Copy link
Copy Markdown
Contributor

This PR was automatically updated by a GitHub Action

  • ApiModules pack version was bumped to 2.4.21.

To stop automatic version bumps, add the ignore-auto-bump-version label to the github PR.

@content-bot

This comment has been minimized.

@content-bot
Copy link
Copy Markdown
Contributor

Validate summary
The following errors were reported as warnings: MC101.
The following errors were thrown as a part of this pr: .
If the AG100 validation in the pre-commit GitHub Action fails, the pull request cannot be force-merged.

Verdict: PR can be force merged from validate perspective? ✅

@content-bot
Copy link
Copy Markdown
Contributor

🔍 AI Triage Report Available

An automated triage report has been generated for this pipeline.

Status: failed
Report ID: b6207b25e337782c

📋 Triage Report
💡 Resolutions are available in the full report.

⚠️ AI-generated triage. Validate before acting.

@almog2296
Copy link
Copy Markdown
Contributor Author

Requesting Force Merge for this PR.

Only the IPEnrichment TPB is failing. The failure is caused by a known issue in our build tenants, where an IP address can sometimes be extracted by !extractIndicators as both Domain and IP. This causes the ip-enrichment script to treat the input as invalid.

The PR itself changes only a small part of the module. All other TPBs are passing successfully, and the updated command was tested manually on a working tenant (the TPB also passed succesfully).

This PR also updates the IPEnrichment TPB to replace the usage of CrowdStrike Falcon, so future CrowdStrike-related PRs will not fail on this TPB unnecessarily.

@dantavori dantavori merged commit 9dd6a8d into master May 26, 2026
22 of 23 checks passed
@dantavori dantavori deleted the enrichment-bug-fix-XSUP-69120 branch May 26, 2026 14:05
eepstain pushed a commit that referenced this pull request May 26, 2026
…es (#44332)

* fixes

* fixes

* fixes

* Bump pack from version AggregatedScripts to 1.3.41.

* fixes

* fixes

* Bump pack from version ApiModules to 2.4.18.

* fixes

* fixes

* Bump pack from version AggregatedScripts to 1.3.42.

* fixes

* Bump pack from version ApiModules to 2.4.19.

* Bump pack from version ApiModules to 2.4.20.

* fixes

* Trigger GitHub pipeline (user-created PR)

* Trigger GitHub pipeline (user-created PR)

* Trigger GitHub pipeline (user-created PR)

* Bump pack from version ApiModules to 2.4.21.

* Trigger GitHub pipeline (user-created PR)

---------

Co-authored-by: Content Bot <bot@demisto.com>
Co-authored-by: CI Bot <ci@demisto.com>
nbensalm-palo pushed a commit that referenced this pull request Jun 1, 2026
…es (#44332)

* fixes

* fixes

* fixes

* Bump pack from version AggregatedScripts to 1.3.41.

* fixes

* fixes

* Bump pack from version ApiModules to 2.4.18.

* fixes

* fixes

* Bump pack from version AggregatedScripts to 1.3.42.

* fixes

* Bump pack from version ApiModules to 2.4.19.

* Bump pack from version ApiModules to 2.4.20.

* fixes

* Trigger GitHub pipeline (user-created PR)

* Trigger GitHub pipeline (user-created PR)

* Trigger GitHub pipeline (user-created PR)

* Bump pack from version ApiModules to 2.4.21.

* Trigger GitHub pipeline (user-created PR)

---------

Co-authored-by: Content Bot <bot@demisto.com>
Co-authored-by: CI Bot <ci@demisto.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-approved ForceMerge Forcing the merge of the PR despite the build status ready-for-pipeline-running Whether the pr is ready for running the whole pipeline, including testing on SAAS machines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants