Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug - switch default TAXII protocol order #29947

Merged
merged 23 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Packs/ApiModules/Scripts/TAXII2ApiModule/TAXII2ApiModule.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def __init__(
self.default_api_root = default_api_root
self.update_custom_fields = update_custom_fields

def init_server(self, version=TAXII_VER_2_0):
def init_server(self, version=TAXII_VER_2_1):
"""
Initializes a server in the requested version
:param version: taxii version key (either 2.0 or 2.1)
Expand Down Expand Up @@ -302,16 +302,16 @@ def init_roots(self):
if not self.server:
self.init_server()
try:
# disable logging as we might receive client error and try 2.1
# disable logging as we might receive client error and try 2.0
logging.disable(logging.ERROR)
# try TAXII 2.0
# try TAXII 2.1
self.set_api_root()
# (TAXIIServiceException, HTTPError) should suffice, but sometimes it raises another type of HTTPError
except Exception as e:
if "406 Client Error" not in str(e) and "version=2.1" not in str(e):
if "406 Client Error" not in str(e) and "version=2.0" not in str(e):
raise e
# switch to TAXII 2.1
self.init_server(version=TAXII_VER_2_1)
# switch to TAXII 2.0
self.init_server(version=TAXII_VER_2_0)
self.set_api_root()
finally:
# enable logging
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ subtype: python3
tags:
- infra
- server
comment: Common TAXII 2 code that will be appended into each TAXII 2 integration when it's deployed
comment: Common TAXII 2 code that will be appended into each TAXII 2 integration when it's deployed.
system: true
scripttarget: 0
dependson: {}
timeout: 0s
dockerimage: demisto/taxii2:1.0.0.23423
fromversion: 5.0.0
tests:
- No tests (auto formatted)
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def test_default_v20(self):
"""
mock_client = Taxii2FeedClient(url='', collection_to_fetch='', proxies=[], verify=False, objects_to_fetch=[])
mock_client.init_server()
assert isinstance(mock_client.server, v20.Server)
assert isinstance(mock_client.server, v21.Server)

def test_v21(self):
"""
Expand Down Expand Up @@ -259,7 +259,7 @@ def test_auth_key(self):
objects_to_fetch=[]
)
mock_client.init_server()
assert isinstance(mock_client.server, v20.Server)
assert isinstance(mock_client.server, v21.Server)
assert mock_auth_header_key in mock_client.server._conn.session.headers
assert mock_client.server._conn.session.headers.get(mock_auth_header_key) == mock_password

Expand Down
6 changes: 6 additions & 0 deletions Packs/FeedDHS/ReleaseNotes/2_0_24.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

#### Integrations

##### DHS Feed v2

- Fixed an issue where the default TAXII protocol was 2.0 and not 2.1
MLainer1 marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion Packs/FeedDHS/pack_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "DHS Feed",
"description": "Provides cyber threat indicators from the Cybersecurity and Infrastructure Security Agency’s (CISA’s) free Automated Indicator Sharing (AIS) by the Department of Homeland Security (DHS).",
"support": "xsoar",
"currentVersion": "2.0.23",
"currentVersion": "2.0.24",
"author": "Cortex XSOAR",
"url": "https://www.paloaltonetworks.com/cortex",
"email": "",
Expand Down
6 changes: 6 additions & 0 deletions Packs/FeedMitreAttackv2/ReleaseNotes/1_1_25.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

#### Integrations

##### MITRE ATT&CK

- Fixed an issue where the default TAXII protocol was 2.0 and not 2.1
MLainer1 marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion Packs/FeedMitreAttackv2/pack_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "MITRE ATT&CK",
"description": "Fetches indicators from MITRE ATT&CK.",
"support": "xsoar",
"currentVersion": "1.1.24",
"currentVersion": "1.1.25",
"author": "Cortex XSOAR",
"url": "https://www.paloaltonetworks.com/cortex",
"email": "",
Expand Down
2 changes: 1 addition & 1 deletion Packs/FeedTAXII/Integrations/FeedTAXII2/FeedTAXII2.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
category: Data Enrichment & Threat Intelligence

Check failure on line 1 in Packs/FeedTAXII/Integrations/FeedTAXII2/FeedTAXII2.yml

View workflow job for this annotation

GitHub Actions / pre-commit

Validation Error DO106

The docker image tag is not the latest numeric tag, please update it. The docker image tag in the yml file is: 1.0.0.79368 The latest docker image tag in docker hub is: 1.0.0.80190 You can check for the most updated version of demisto/taxii2 here: https://hub.docker.com/r/demisto/taxii2/tags To update the docker image run: demisto-sdk format -ud -i Packs/FeedTAXII/Integrations/FeedTAXII2/FeedTAXII2.yml
commonfields:
id: TAXII 2 Feed
version: -1
Expand Down Expand Up @@ -227,7 +227,7 @@
- deprecated: true
description: 'WARNING: This command will reset your fetch history.'
name: taxii2-reset-fetch-indicators
dockerimage: demisto/taxii2:1.0.0.68089
dockerimage: demisto/taxii2:1.0.0.79368
feed: true
runonce: false
script: '-'
Expand Down
6 changes: 6 additions & 0 deletions Packs/FeedTAXII/ReleaseNotes/1_2_1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

#### Integrations

##### TAXII 2 Feed

- Fixed an issue where the default TAXII protocol was 2.0 and not 2.1
MLainer1 marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion Packs/FeedTAXII/pack_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "TAXII Feed",
"description": "Ingest indicator feeds from TAXII 1 and TAXII 2 servers.",
"support": "xsoar",
"currentVersion": "1.2.0",
"currentVersion": "1.2.1",
"author": "Cortex XSOAR",
"url": "https://www.paloaltonetworks.com/cortex",
"email": "",
Expand Down
Loading