Repository navigation
Conversation
This was referenced Oct 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Issue dfir-iris/iris-web#1157: IrisMISP enriches IOCs only through the
MISP ReportHTML custom attribute. The IRIS 3 native enrichment panel (fed byioc.ioc_enrichment) therefore stays empty even when MISP returns matches — the backend and frontend already support the presentation, only the module never feeds it.What this PR does
Adds a normalisation layer (
iris_misp_module/misp_handler/enrichment.py) that turns the MISP search results already returned by the module into the payload rendered by the IRIS 3 enrichment panel, and writes it toioc.ioc_enrichmentfrom the existing hook handler. The three triggers the module already supports (manualGet MISP insight, on-create and on-update hooks) all go through that handler, so all of them populate the panel.The payload contains:
misp(rendered as the "MISP" source in the panel),Behaviour details:
ioc.ioc_enrichment: keys written by other modules stay untouched, only themispsource is replaced, and a new dict is assigned (the JSONB column is not aMutableDict, so in-place mutation would not be persisted).verdict; the threat level and tags are reported instead, and the verdict is left to modules that can classify the IOC.MISP Reportattribute and themisp:hittag logic are untouched. The newPopulate native IOC enrichmentsetting (misp_populate_enrichment, enabled by default) only controls the native enrichment; disabling it keeps the pre-IRIS-3 behaviour.domain|ipis aggregated. The previous code handled the domain and IP halves with two separate report calls, so the second call would erase the domain findings from the enrichment. The enrichment is now built once from the merged domain/IP reports. The IP half also usessearch_ip(IP attribute types) instead ofsearch_domain, which missed IP-only MISP attributes.eventsview is capped at 25 events soioc.ioc_enrichmentstays bounded (it is returned in IOC list/search responses); the complete raw results remain available in theMISP Reportattribute.Small robustness fixes on the touched paths: an invalid Jinja template now returns an
I2Errorstatus instead of raising out of the hook (enrichment is written before the legacy report rendering), and a MISP configuration that is valid JSON but not an object is rejected cleanly.Module version bumped to
1.5.0(IrisMISPConfig.pyandsetup.py). The module interface version is unchanged (1.2.0).Why this is module-only
No backend or frontend change is needed, as confirmed against IRIS 3 backend/frontend:
iris_interfacedefault); the backend Celery hook wrapper merges the IOC into the session, calls the module handler and then commits — with an explicit "Recommit the changes made by the module" — so assigningioc.ioc_enrichmentfrom the module persists.EnrichmentPanel/enrichment-viewalready renders any top-level source key withsummary,link,verdictand scalar/scalar-list fields, mappingmispto the "MISP" label; nested objects (instances/events) are shown in the raw JSON dialog.Tests
82 offline unit tests pass (
python -m pytest iris_misp_module/tests -q): 52 pure mapping tests and 30 handler integration tests. They cover matched/no-match/malformed reports, multiple instances, threat-level mapping and selection, URL building, tag/classification extraction, list bounds and deduplication, merge semantics,domain|ipaggregation, disabled option, legacy attribute/tag paths, invalid template handling and non-object MISP configuration. The pymisp client is mocked and the IRIS backend imports are stubbed (tests/conftest.py), so no network or IRIS deployment is required.The pre-existing tests were also repaired: they imported a top-level
misp_handlerpackage that only exists when the module is installed in the backend, and queried a real MISP instance, so they could not run outside an IRIS deployment.Compatibility / release notes
misp_populate_enrichmentkeep working: the handler falls back to the enabled default. IRIS stores module configuration at registration time, so upgraded deployments may not show the new setting until the module configuration is refreshed; the feature itself is active by default.iris_misp_module-1.3.0in iris-backend. Companion PRs so the feature is delivered end to end:iris_misp_module-1.5.0wheel and bumpssource/requirements.txt(default Docker deployments get the feature once both PRs are merged);PR base branch
The organisation CONTRIBUTING.md asks for PRs against
develop, but this repository only hasmaster(nodevelopbranch exists), so this PR targetsmaster. Maintainers may want to create the missingdevelopbranch for future contributions.Checklist