From 659e1fd90d3f252beaf6815a75f08b1ffa670139 Mon Sep 17 00:00:00 2001 From: Michael Chisholm Date: Thu, 26 Aug 2021 20:55:35 -0400 Subject: [PATCH] Fix transform from Filter object to TAXII filter to look at the filter operator; TAXII filters only support equals. --- stix2/datastore/taxii.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stix2/datastore/taxii.py b/stix2/datastore/taxii.py index 04b3c83..f82f017 100644 --- a/stix2/datastore/taxii.py +++ b/stix2/datastore/taxii.py @@ -343,8 +343,8 @@ class TAXIICollectionSource(DataSource): For instance - "?match[type]=indicator,sighting" can be in a filter in any of these formats: - Filter("type", "", "indicator,sighting") - Filter("type", "", ["indicator", "sighting"]) + Filter("type", "=", "indicator,sighting") + Filter("type", "=", ["indicator", "sighting"]) Args: query (list): list of filters to extract which ones are TAXII @@ -357,7 +357,7 @@ class TAXIICollectionSource(DataSource): taxii_filters = [] for filter_ in query: - if filter_.property in TAXII_FILTERS: + if filter_.property in TAXII_FILTERS and filter_.op == "=": taxii_filters.append(filter_) return taxii_filters