Skip to content

fix(gti-mcp): scope GTI response trimming for #327 - #337

Open
VISHNU0906 wants to merge 2 commits into
google:mainfrom
VISHNU0906:fix/327-gti-response-trimming
Open

VISHNU0906 wants to merge 2 commits into
google:mainfrom
VISHNU0906:fix/327-gti-response-trimming

Conversation

@VISHNU0906

Copy link
Copy Markdown
Contributor

Hi @dandye — follow-up to #335 with the scoped response trimming from #327, split out so we can discuss drop-vs-truncate tradeoffs here without blocking the bug fixes.

Depends on #335 (this branch is stacked on it). Until #335 merges, the diff also includes those three bug fixes; after merge + rebase this PR shrinks to trimming only.

Scope

  • search_vulnerabilities: extra vuln metadata exclusions via extra_excluded_attrs (VULNERABILITY_EXCLUDED_ATTRS).
  • get_entities_related_to_a_file: send exclude_attributes only for behaviours when descriptors_only is false (FILE_BEHAVIOUR_EXCLUDED_ATTRS). Drops bulky dumps (memory_dumps, registry/file open-write-delete noise); keeps processes_tree, command_executions, ip_traffic, attack_techniques, etc.
  • get_file_behavior_summary / get_collections_commonalities: client-side strip of low-signal bulk via utils.remove_fields (FILE_BEHAVIOR_SUMMARY_EXCLUDED_ATTRS, COLLECTION_COMMONALITIES_FILES_EXCLUDED_ATTRS). Keeps hunting pivots (imphash, vhash, tlshhash, crowdsourced_*, itw_urls, embedded_domains / embedded_ips, …).

Happy to adjust which fields are dropped vs truncated based on design discussion.

Tests

  • Behaviours exclude_attributes scoping, summary/commonalities keep/drop coverage, remove_fields unit test.
  • Full server/gti unit suite: 65 passed.

Part of #327

Fix the broken rule_types filter in get_collection_rules, widen the
get_entities_related_to_a_file return annotation so invalid relationships
return a clean error dict through FastMCP outputSchema validation, and
guard missing/non-dict data in get_collections_commonalities.

Signed-off-by: KVR Vishnu <46535652+VISHNU0906@users.noreply.github.com>
Drop bulky / low-signal fields from vulnerability search, file
behaviours, behavior summary, and collection commonalities while keeping
core hunting and behavioral pivots. Adds utils.remove_fields for nested
client-side stripping where the API exclude_attributes param is not
enough.

Signed-off-by: KVR Vishnu <46535652+VISHNU0906@users.noreply.github.com>

This branch has not been deployed

No deployments
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