dfir-iris / iris-web

Collaborative Incident Response platform
GNU Lesser General Public License v3.0
1.09k stars 187 forks source link

[BUG] Custom Attributes are not applied to escalated/merged Alert Assets and IOCs #477

Open StaSys846 opened 6 months ago

StaSys846 commented 6 months ago

Describe the bug When an IRIS Alert with asset/IOC information is merged to an existing case or escalated to a new case, Asset and IOCs included for import to the case don't include custom_attribute definitions (e.g. additional GUI elements like tabs/custom fields in the Asset/IOC modal view).

To Reproduce Steps to reproduce the behavior (prerequisite: custom_attributes are defined for IOCs/Assets):

  1. Go to Alerts view
  2. Click on Merge (into new or existing case)
  3. Select alert assets and/or IOCs to be imported in the the selected case
  4. Assets and IOCs are imported to the case, BUT custom attributes are not applied

Expected behavior After alert merging/escalation to a case including assets and/or IOCs, the asset/IOC data should include the defined custom_attributes

Desktop (please complete the following information):

Additional context In a manual modal view "add asset" the custom attributes are loaded by "get_default_custom_attributes" (e.g. #163 case_asset_routes.py) and provided as additional input to the modal view render template, so that custom attributes are rendered for the "add" modal view and added to the asset data. This default_custom_attribute handling is missing for assets/iocs included in alerts.

Noones47 commented 4 months ago

I am having this same issue, did you manage to solve this?

StaSys846 commented 4 months ago

Actually the code is missing the application of custom_attributes for assets included in alerts. My workaround is currently to use the 'on_postload_alert_create' hook in my custom IRIS module to check for missing custom_attributes. This is also the place to add data to asset.custom_attributes included as a potential customized enrichment in the alert data:

hope that helps