Skip to content

fix: [network-traffic] type src_ip as ip-src - #614

Merged
adulau merged 1 commit into
MISP:mainfrom
GTosetti:fix-network-traffic-src-ip
Nov 29, 2026
Merged

adulau merged 1 commit into
MISP:mainfrom
GTosetti:fix-network-traffic-src-ip

Conversation

@GTosetti

Copy link
Copy Markdown
Contributor

In the network-traffic template, src_ip ("Source IP address of the network traffic") is typed ip-dst, the same as dst_ip (definition.json#L63-L67 at 4c30b90). It looks like a copy-paste slip:

  • every other template with a source-address relation types it ip-src (network-connection, network-socket, netflow, cowrie, http-request, ...);
  • misp-stix already writes this relation as ip-src when it imports a STIX Network Traffic object into this template (stix2mapping.py#L244-L246, used in stix2_observable_converter.py#L120-L131).

So today the same relation gets ip-dst when the object is made in the MISP form or with PyMISP (both take the type from the template) and ip-src when it comes from a STIX import.

Where the type makes a difference in MISP core (2.5 at d66fb5c; not an exhaustive list):

Where ip-dst (now) ip-src (proposed)
Snort/Suricata export (NidsExport.php#L161-L168) $HOME_NET any -> <ip>, "Outgoing To IP" (L329-L348) <ip> any -> $HOME_NET, "Incoming From IP" (L350-L369)
OpenIOC export (OpeniocExport.php#L19-L20) RouteEntryItem/Destination PortItem/remoteIP
Search or export filtered by type (e.g. the Kunai export only takes ip-dst) under ip-dst under ip-src

Correlation.php, BroExport.php and NetfilterExport.php list both types side by side, so nothing changes there.

Changes:

  • src_ip: ip-dst -> ip-src
  • src_hostname: the description said "Destination hostname of the network traffic"; now "Source hostname of the network traffic"
  • version: 1 -> 2

Existing objects are not touched: stored attributes keep their type and the objects stay on template version 1. Only objects created after the template update get ip-src; MISP moves an existing object to a newer template version only when a user asks for it in the edit form. On that upgrade core flags the old src_ip and src_hostname values as not mergeable automatically, as it does for any template element that changed (MispObject.php#L1736-L1791).

In the STIX 2 export, misp-stix has no dedicated handler for this object name (stix2_mapping.py#L343-L394), so that side does not depend on the type.

Checked: the file is byte-identical to the output of jq -S -j . (jq 1.7.1), it validates against schema_objects.json, and the UUID is unchanged. Not tested on a MISP instance: the behaviour above is from reading the code linked.

Prepared with Claude Code (AI-assisted).

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@adulau
adulau merged commit d489d27 into MISP:main Nov 29, 2026
6 checks passed
@adulau

adulau commented Nov 29, 2026

Copy link
Copy Markdown
Member

Thanks good finding indeed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants