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

Taxii2 fix #27348

Merged
merged 3 commits into from
Jun 14, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
11 changes: 4 additions & 7 deletions Packs/TAXIIServer/Integrations/TAXII2Server/TAXII2Server.py
Original file line number Diff line number Diff line change
Expand Up @@ -913,12 +913,9 @@ def create_extension_definition(object_type, extensions_dict, xsoar_type,
the updated Stix object, its extension and updated extensions_dict.
"""
extension_definition = {}
if object_type in extensions_dict:
extension_id = extensions_dict.get(object_type, {}).get('extension_id')
xsoar_indicator_to_return = extensions_dict.get(object_type, {}).get('xsoar_indicator_to_return')
else:
xsoar_indicator_to_return['extension_type'] = 'property_extension'
extension_id = f'extension-definition--{uuid.uuid4()}'
xsoar_indicator_to_return['extension_type'] = 'property_extension'
extension_id = f'extension-definition--{uuid.uuid4()}'
if object_type not in extensions_dict:
extension_definition = {
'id': extension_id,
'type': 'extension-definition',
Expand All @@ -934,7 +931,7 @@ def create_extension_definition(object_type, extensions_dict, xsoar_type,
'version': '1.0',
'extension_types': ['property-extension']
}
extensions_dict[object_type] = {'extension_id': extension_id, 'xsoar_indicator_to_return': xsoar_indicator_to_return}
extensions_dict[object_type] = True
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whats this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since I don't really need to keep track of the values, this is enough to assign a boolean value to flag that his object_type already has an extension definition.

stix_object['extensions'] = {
extension_id: xsoar_indicator_to_return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ script:
- contextPath: TAXIIServer.ServerInfo.description
description: The server description
type: String
dockerimage: demisto/flask-nginx:1.0.0.61723
dockerimage: demisto/flask-nginx:1.0.0.62970
feed: false
isfetch: false
longRunning: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,14 @@
"service": "Daily Threat Feed"
},
"aggregatedReliability": "A - Completely reliable",
"calculatedTime": "2021-12-08T09:32:24.104143+02:00",
"calculatedTime": "2021-12-08T09:32:24.102219+02:00",
"comments": [
{
"category": "Sighting",
"content": "Sighted",
"created": "2021-12-08T12:05:28.570995+02:00",
"created": "2021-12-08T12:05:28.566272+02:00",
"entryId": "",
"id": "f814296f-6dca-4c88-86ad-68fd3871ecfa",
"id": "ed12a2bf-8aea-4492-8181-975f456d303f",
"modified": "0001-01-01T00:00:00Z",
"sortValues": null,
"source": "Some Feed.Some Feed_instance_1",
Expand All @@ -135,19 +135,19 @@
"expirationPolicy": "indicatorType",
"instance": "Some Feed_instance_1",
"moduleId": "fd8269e7-5ffa-4888-8ca8-bfe5eae78e15",
"setTime": "2021-12-08T12:05:28.570985+02:00",
"setTime": "2021-12-08T12:05:28.566261+02:00",
"source": "indicatorType",
"user": ""
},
"expirationStatus": "active",
"extension_type": "property_extension",
"firstSeen": "0001-01-01T00:00:00Z",
"firstSeenEntryID": "API",
"id": "5188347",
"id": "5188266",
"indicator_type": "IP",
"lastSeen": "0001-01-01T00:00:00Z",
"lastSeenEntryID": "API",
"modified": "2021-12-08T12:05:28.617414+02:00",
"modified": "2021-12-08T12:05:28.615431+02:00",
"modifiedTime": "2021-12-08T12:05:11+02:00",
"moduleToFeedMap": {
"fd8269e7-5ffa-4888-8ca8-bfe5eae78e15": {
Expand All @@ -157,7 +157,7 @@
"expirationPolicy": "indicatorType",
"instance": "Some Feed_instance_1",
"moduleId": "fd8269e7-5ffa-4888-8ca8-bfe5eae78e15",
"setTime": "2021-12-08T12:05:28.570985+02:00",
"setTime": "2021-12-08T12:05:28.566261+02:00",
"source": "indicatorType",
"user": ""
},
Expand All @@ -182,22 +182,22 @@
"sourceInstance": "Some Feed_instance_1",
"timestamp": "0001-01-01T00:00:00Z",
"type": "IP",
"value": "8.8.8.8"
"value": "1.1.1.1"
}
},
"score": 3,
"sortValues": [
" \u0001\u0016_-f0\u000b\u0019Q\u0018",
"5188347"
" \u0001\u0016_-f0\n$\u0019x",
"5188266"
],
"sourceBrands": [
"Some Feed"
],
"sourceInstances": [
"Some Feed_instance_1"
],
"timestamp": "2021-12-08T09:32:24.104143+02:00",
"value": "8.8.8.8",
"timestamp": "2021-12-08T09:32:24.102219+02:00",
"value": "1.1.1.1",
"version": 15
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
"description": "",
"extensions": {
"extension-definition--1ffe4bee-95e7-4e36-9a17-f56dbab3c777": {
"calculatedTime": "2021-12-19T16:11:15.523598+02:00",
"calculatedTime": "2021-12-19T16:11:15.523761+02:00",
"comments": [
{
"category": "Sighting",
"content": "Created",
"created": "2021-12-19T16:11:15.41092+02:00",
"created": "2021-12-19T16:11:15.375887+02:00",
"entryId": "",
"id": "644e8ef8-de0a-45bd-8f48-41a88200982a",
"id": "c44a5b3b-e508-4ac6-8881-c5dd7d118946",
"modified": "0001-01-01T00:00:00Z",
"sortValues": null,
"source": "@DBot",
Expand All @@ -29,31 +29,31 @@
"expirationPolicy": "never",
"instance": "",
"moduleId": "",
"setTime": "2021-12-19T16:11:15.410878+02:00",
"setTime": "2021-12-19T16:11:15.375855+02:00",
"source": "indicatorType",
"user": ""
},
"expirationStatus": "active",
"extension_type": "property_extension",
"firstSeen": "2021-12-19T16:11:15.523598+02:00",
"firstSeen": "2021-12-19T16:11:15.523762+02:00",
"firstSeenEntryID": "8072@e99f97d1-7225-4c75-896c-3c960febbe8c",
"id": "5212677",
"id": "5212669",
"indicator_type": "Attack Pattern",
"investigationIDs": [
"e99f97d1-7225-4c75-896c-3c960febbe8c"
],
"lastReputationRun": "2021-12-19T16:11:15.410938+02:00",
"lastSeen": "2021-12-19T16:11:15.523598+02:00",
"lastReputationRun": "2021-12-19T16:11:15.375909+02:00",
"lastSeen": "2021-12-19T16:11:15.523761+02:00",
"lastSeenEntryID": "8072@e99f97d1-7225-4c75-896c-3c960febbe8c",
"modified": "2021-12-19T16:11:15.53072+02:00",
"modified": "2021-12-19T16:11:15.530455+02:00",
"score": 0,
"sortValues": [
" \u0001\u0016a\u000b+\u0013<3-0",
"5212677"
" \u0001\u0016a\u000b+\u0013<=&h",
"5212669"
],
"source": "DBot",
"timestamp": "2021-12-19T16:11:15.530719+02:00",
"value": "T1195",
"timestamp": "2021-12-19T16:11:15.530454+02:00",
"value": "T1071.004",
"version": 1
}
},
Expand All @@ -68,14 +68,14 @@
"description": "",
"extensions": {
"extension-definition--1ffe4bee-95e7-4e36-9a17-f56dbab3c777": {
"calculatedTime": "2021-12-19T16:11:15.523598+02:00",
"calculatedTime": "2021-12-19T16:11:15.523545+02:00",
"comments": [
{
"category": "Sighting",
"content": "Created",
"created": "2021-12-19T16:11:15.41092+02:00",
"created": "2021-12-19T16:11:15.382832+02:00",
"entryId": "",
"id": "644e8ef8-de0a-45bd-8f48-41a88200982a",
"id": "fcb648ae-cc62-4a62-8850-c41ef862d2d8",
"modified": "0001-01-01T00:00:00Z",
"sortValues": null,
"source": "@DBot",
Expand All @@ -90,31 +90,31 @@
"expirationPolicy": "never",
"instance": "",
"moduleId": "",
"setTime": "2021-12-19T16:11:15.410878+02:00",
"setTime": "2021-12-19T16:11:15.382816+02:00",
"source": "indicatorType",
"user": ""
},
"expirationStatus": "active",
"extension_type": "property_extension",
"firstSeen": "2021-12-19T16:11:15.523598+02:00",
"firstSeen": "2021-12-19T16:11:15.523545+02:00",
"firstSeenEntryID": "8072@e99f97d1-7225-4c75-896c-3c960febbe8c",
"id": "5212677",
"id": "5212676",
"indicator_type": "Attack Pattern",
"investigationIDs": [
"e99f97d1-7225-4c75-896c-3c960febbe8c"
],
"lastReputationRun": "2021-12-19T16:11:15.410938+02:00",
"lastSeen": "2021-12-19T16:11:15.523598+02:00",
"lastReputationRun": "2021-12-19T16:11:15.382836+02:00",
"lastSeen": "2021-12-19T16:11:15.523545+02:00",
"lastSeenEntryID": "8072@e99f97d1-7225-4c75-896c-3c960febbe8c",
"modified": "2021-12-19T16:11:15.53072+02:00",
"modified": "2021-12-19T16:11:15.530696+02:00",
"score": 0,
"sortValues": [
" \u0001\u0016a\u000b+\u0013<3-0",
"5212677"
" \u0001\u0016a\u000b+\u0013<0\u000f(",
"5212676"
],
"source": "DBot",
"timestamp": "2021-12-19T16:11:15.530719+02:00",
"value": "T1195",
"timestamp": "2021-12-19T16:11:15.530695+02:00",
"value": "T1105",
"version": 1
}
},
Expand Down
Loading