feat(google-ti-feeds): add malware/threat actor filter (#7024)#7090
Open
throuxel wants to merge 1 commit into
Open
feat(google-ti-feeds): add malware/threat actor filter (#7024)#7090throuxel wants to merge 1 commit into
throuxel wants to merge 1 commit into
Conversation
…or Delta Sync indicator import (#7024)
|
🔴 Connector Linter errors detected
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds two optional association-based filters to the google-ti-feeds connector’s Delta Sync indicator ingestion so teams can restrict imported IOCs to those linked to a Malware Family and/or a Threat Actor, as requested in #7024.
Changes:
- Introduces two new boolean settings (
GTI_INDICATOR_REQUIRE_MALWARE_FAMILY,GTI_INDICATOR_REQUIRE_THREAT_ACTOR) with OR logic between them and AND logic with the existing minimum-score filter. - Implements association filtering in the IOC delta entry conversion path.
- Updates documentation, samples, generated config schema/docs, and adds/extends tests to cover the new filter behavior.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| external-import/google-ti-feeds/connector/src/custom/convert_to_stix/indicator/convert_to_stix_indicator.py | Adds association-based filtering logic and skip behavior during IOC conversion. |
| external-import/google-ti-feeds/connector/src/custom/configs/indicator/gti_config_indicator.py | Adds two new boolean config fields with documented combination logic. |
| external-import/google-ti-feeds/tests/custom/convert_to_stix/indicator/test_convert_to_stix_indicator.py | Adds unit tests validating association-filter combinations and interaction with min-score filtering. |
| external-import/google-ti-feeds/tests/custom/orchestrators/indicator/test_orchestrator_indicator.py | Extends dummy config to include the new indicator filter flags. |
| external-import/google-ti-feeds/README.md | Documents the new configuration options in the connector README. |
| external-import/google-ti-feeds/.env.sample | Adds example env vars for the new options. |
| external-import/google-ti-feeds/config.yml.sample | Adds example YAML config keys for the new options (and min score example line). |
| external-import/google-ti-feeds/metadata/connector_config_schema.json | Updates generated schema to include the two new boolean settings. |
| external-import/google-ti-feeds/metadata/CONNECTOR_CONFIG_DOC.md | Updates generated config documentation to include the two new settings. |
jabesq
approved these changes
Jul 23, 2026
| if require_threat_actor and not require_malware: | ||
| return not has_threat_actor | ||
| # Both required: OR logic — at least one must be present | ||
| return not (has_malware or has_threat_actor) |
Member
There was a problem hiding this comment.
suggestion: Purely personal, but I prefer this representation of boolean using De Morgan's Law:
return not has_malware and not has_threat_actor|
|
||
| return attrs.gti_assessment.threat_score.value < min_score | ||
|
|
||
| def _lacks_required_association(self, entry: IOCDeltaEntry) -> bool: |
Member
There was a problem hiding this comment.
suggestion: Maybe it could be easier to read if this method is checking the lack of association but the opposite, the presence of association:
def _has_required_association(self, entry: IOCDeltaEntry) -> bool:
"""Check whether an IOC entry has the required malware/threat actor associations.
The filter is disabled when both indicator_require_malware_family and
indicator_require_threat_actor are False (default), in which case this
always returns True. When one or both are enabled, the indicator must
have at least one matching association (OR logic between the two).
"""
require_malware = self.config.indicator_require_malware_family
require_threat_actor = self.config.indicator_require_threat_actor
if not require_malware and not require_threat_actor:
return True
rels = entry.relationships
has_malware = (
rels is not None
and rels.malware_families is not None
and len(rels.malware_families.data) > 0
)
has_threat_actor = (
rels is not None
and rels.threat_actors is not None
and len(rels.threat_actors.data) > 0
)
if require_malware and not require_threat_actor:
return has_malware
if require_threat_actor and not require_malware:
return has_threat_actor
# Both required: OR logic — at least one must be present
return has_malware or has_threat_actor
...
if not self._has_required_association(entry):
...
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.

Proposed changes
Related issues
Checklist
Further comments