Skip to content

Commit

Permalink
Bug - switch default TAXII protocol order (#29947)
Browse files Browse the repository at this point in the history
* added headers

* inverse taxii 2.0 and 2.1

* flip 2.0 and 2.1 protocols

* revertd yml

* CLOUD_API_KEYS

* validate

* fix test

* remove taxii feed fix

* rn

* di

* rn
  • Loading branch information
MLainer1 authored Nov 8, 2023
1 parent 2ef4586 commit ddc74b5
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 13 deletions.
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
4 changes: 3 additions & 1 deletion Packs/ApiModules/Scripts/TAXII2ApiModule/TAXII2ApiModule.yml
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

- Updated the default TAXII protocol to 2.1.
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

- Updated the default TAXII protocol to 2.1.
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
Expand Up @@ -227,7 +227,7 @@ script:
- 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.80190
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
- Updated the Docker image to: *demisto/taxii2:1.0.0.80190*.
- Updated the default TAXII protocol to 2.1.
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

0 comments on commit ddc74b5

Please sign in to comment.