Closed ChanochShayner closed 2 years ago
I have confirmed this bug. The reason you see the same value is because all attack patterns are erroneously being returned, so item 0 is always the same item, with the same name. I have opened issue #525.
@chisholm Thank you! Did the patch go into version 3.0.0? If not, is it possible to insert it? This is really important to me, thank you very much.
We would not retroactively change version 3.0.0, we would release a new version. I think a new version would not be released until at least after Labor Day. I would also like to get PR #528 merged before then.
For the previous version of stix2, this Filter returned the correct value of the Attack Pattern -
attack_pattern_name = tc_source.query([ Filter("external_references.external_id", "=", attack_id), Filter("type", "=", "attack-pattern") ])[0]['name']
For the new version, the Filter always returns the same value -Code Signing Policy Modification
The code:
collection_id = f"stix/collections/{ENTERPRISE_COLLECTION_ID}/" collection_url = urljoin('https://cti-taxii.mitre.org', collection_id) collection_data = Collection(collection_url, verify=client.verify, proxies=client.proxies) tc_source = TAXIICollectionSource(collection_data) attack_pattern_name = tc_source.query([ Filter("external_references.external_id", "=", attack_id), Filter("type", "=", "attack-pattern") ])[0]['name']