Skip to content

feat: expose the source of network rows - #8

Merged
batuhanisildak-malwation merged 2 commits into
mainfrom
feat/network-row-source
Oct 15, 2026
Merged

batuhanisildak-malwation merged 2 commits into
mainfrom
feat/network-row-source

Conversation

@batuhanisildak-malwation

Copy link
Copy Markdown
Contributor

Summary

The public API adds the source of each network row (platform PR Malwation/threatzone follow-up to #1875). This PR adds the same fields to the SDK. It is stacked on #7 (feat/windows-v2-score-scale), because both change types/network.py. Merge #7 first.

  • DnsQuery, HttpRequest, Connection and NetworkThreat add attribution, attribution_reason, process_id and process_image (new base model NetworkRowSource, new type NetworkAttribution).
  • DnsQuery adds status_text. NetworkSummary adds windows_background_count.
  • get_dns_queries, get_http_requests, get_tcp_connections, get_udp_connections and get_network_threats accept attribution=[...]. When it is unset, the request does not change, and the server omits windows_background rows.

Compatibility

  • All changes are additive. Existing fields, types and method calls do not change.
  • Each new field is None when an older server omits it. An unknown attribution value does not fail the call.
  • DnsQuery.status keeps its literal set; the server sends TIMEOUT and puts other sensor text in status_text.

Test evidence

  • pytest: 675 passed (7 new: older-server rows, rows with sources, unknown value, summary count, filter parameter sync and async, default request unchanged).
  • mypy src: no issues. ruff check .: all checks passed.

Submodule pin

The platform repository keeps its threatzone-python-sdk pin on main (SDK Submodule Sync Gate). Re-pin it after #7 and this PR merge to main.

Network rows add attribution, reason, and process fields. DNS rows add status_text, and the network summary adds windows_background_count. The network list methods accept an attribution filter. All fields are optional, so older servers still work.
@batuhanisildak-malwation
batuhanisildak-malwation changed the base branch from feat/windows-v2-score-scale to main October 15, 2026 14:09
@batuhanisildak-malwation
batuhanisildak-malwation merged commit 166ad64 into main Oct 15, 2026
7 checks passed
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.

1 participant