Skip to content

Commit 6cec6e9

Browse files
Merge pull request #10 from splunk-soar-connectors/next
Merging next to main for release 1.0.2
2 parents 53a9179 + b20ce88 commit 6cec6e9

File tree

8 files changed

+66
-27
lines changed

8 files changed

+66
-27
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright (c) 2024 Splunk Inc.
189+
Copyright (c) 2025 Splunk Inc.
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
# Cisco Talos Intelligence
33

44
Publisher: Splunk
5-
Connector Version: 1.0.1
5+
Connector Version: 1.0.2
66
Product Vendor: Cisco
77
Product Name: Talos Intelligence
88
Product Version Supported (regex): ".\*"
99
Minimum Product Version: 6.3.0
1010

11-
This app provides investigative actions for Cisco Talos Intelligence
11+
This app provides investigative actions for Cisco Talos Intelligence. It is only supported on Splunk SOAR Cloud
1212

1313
[comment]: # " File: README.md"
14-
[comment]: # "Copyright (c) 2024 Splunk Inc."
14+
[comment]: # "Copyright (c) 2025 Splunk Inc."
1515
[comment]: # ""
1616
[comment]: # "Licensed under the Apache License, Version 2.0 (the 'License');"
1717
[comment]: # "you may not use this file except in compliance with the License."

__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# File: __init__.py
22
#
3-
# Copyright (c) 2024 Splunk Inc.
3+
# Copyright (c) 2025 Splunk Inc.
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

ciscotalosintelligence.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"appid": "7c653487-22c8-4ec1-bca0-16a8b1513c86",
33
"name": "Cisco Talos Intelligence",
4-
"description": "This app provides investigative actions for Cisco Talos Intelligence",
4+
"description": "This app provides investigative actions for Cisco Talos Intelligence. It is only supported on Splunk SOAR Cloud",
55
"type": "information",
66
"product_vendor": "Cisco",
77
"logo": "ciscotalosintelligence.svg",
@@ -13,9 +13,9 @@
1313
],
1414
"product_version_regex": ".*",
1515
"publisher": "Splunk",
16-
"license": "Copyright (c) 2024 Splunk Inc.",
17-
"app_version": "1.0.1",
18-
"utctime_updated": "2024-06-21T18:40:03.685771Z",
16+
"license": "Copyright (c) 2025 Splunk Inc.",
17+
"app_version": "1.0.2",
18+
"utctime_updated": "2025-01-11T00:12:29.000000Z",
1919
"package_name": "phantom_ciscotalosintelligence",
2020
"fips_compliant": false,
2121
"main_module": "ciscotalosintelligence_connector.py",
@@ -403,4 +403,4 @@
403403
"executable": "spawn3",
404404
"disabled": false,
405405
"custom_made": true
406-
}
406+
}

ciscotalosintelligence_connector.py

Lines changed: 53 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# File: ciscotalosintelligence_connector.py
22
#
3-
# Copyright (c) 2024 Splunk Inc.
3+
# Copyright (c) 2025 Splunk Inc.
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -47,7 +47,6 @@ def __new__(cls, val1, val2=None):
4747

4848

4949
class TalosIntelligenceConnector(BaseConnector):
50-
5150
def __init__(self):
5251
super(TalosIntelligenceConnector, self).__init__()
5352

@@ -64,7 +63,10 @@ def _process_empty_response(self, response, action_result):
6463
if response.status_code == 200:
6564
return RetVal(phantom.APP_SUCCESS, {})
6665

67-
return RetVal(action_result.set_status(phantom.APP_ERROR, "Empty response and no information in the header"), None)
66+
return RetVal(
67+
action_result.set_status(phantom.APP_ERROR, "Empty response and no information in the header"),
68+
None,
69+
)
6870

6971
def _process_html_response(self, response, action_result):
7072
# An html response, treat it like an error
@@ -89,7 +91,13 @@ def _process_json_response(self, r, action_result):
8991
try:
9092
resp_json = r.json()
9193
except Exception as e:
92-
return RetVal(action_result.set_status(phantom.APP_ERROR, "Unable to parse JSON response. Error: {0}".format(str(e))), None)
94+
return RetVal(
95+
action_result.set_status(
96+
phantom.APP_ERROR,
97+
"Unable to parse JSON response. Error: {0}".format(str(e)),
98+
),
99+
None,
100+
)
93101

94102
# Please specify the status codes here
95103
if 200 <= r.status_code < 399:
@@ -114,13 +122,20 @@ def _process_response(self, r, action_result, retry=3):
114122
err_msg = r.headers.get("grpc-message", "Error")
115123
return (
116124
action_result.set_status(
117-
phantom.APP_ERROR, f"Got retryable grpc-status of {r.headers['grpc-status']} with message {err_msg}"
125+
phantom.APP_ERROR,
126+
f"Got retryable grpc-status of {r.headers['grpc-status']} with message {err_msg}",
118127
),
119128
r,
120129
)
121130

122131
if r.status_code == 503:
123-
return action_result.set_status(phantom.APP_ERROR, "Got retryable http status code {0}".format(r.status_code)), r
132+
return (
133+
action_result.set_status(
134+
phantom.APP_ERROR,
135+
"Got retryable http status code {0}".format(r.status_code),
136+
),
137+
r,
138+
)
124139

125140
# Process each 'Content-Type' of response separately
126141

@@ -171,20 +186,32 @@ def _make_rest_call(self, retry, endpoint, action_result, method="get", **kwargs
171186

172187
with tempfile.NamedTemporaryFile(mode="w+", delete=False, suffix="test") as temp_file:
173188
cert_string = f"-----BEGIN CERTIFICATE-----\n{self._cert}\n-----END CERTIFICATE-----"
174-
cert = f"{cert_string}\n-----BEGIN RSA PRIVATE KEY-----\n{self._key}\n-----END RSA PRIVATE KEY-----\n"
189+
cert = (
190+
f"{cert_string}\n"
191+
"-----BEGIN RSA PRIVATE KEY-----\n" # pragma: allowlist secret
192+
f"{self._key}\n"
193+
"-----END RSA PRIVATE KEY-----\n" # pragma: allowlist secret
194+
)
175195
temp_file.write(cert)
176196
temp_file.seek(0) # Move the file pointer to the beginning for reading
177197
temp_file_path = temp_file.name # Get the name of the temporary file
178198
self.client = httpx.Client(
179-
http2=True, verify=config.get("verify_server_cert", False), cert=temp_file_path, timeout=MAX_REQUEST_TIMEOUT
199+
http2=True,
200+
verify=config.get("verify_server_cert", False),
201+
cert=temp_file_path,
202+
timeout=MAX_REQUEST_TIMEOUT,
180203
)
181204

182205
if os.path.exists(temp_file_path):
183206
os.remove(temp_file_path)
184207

185208
if i == MAX_CONNECTION_RETIRIES - 1:
186209
return RetVal(
187-
action_result.set_status(phantom.APP_ERROR, "Error Connecting to server. Details: {0}".format(str(e))), resp_json
210+
action_result.set_status(
211+
phantom.APP_ERROR,
212+
"Error Connecting to server. Details: {0}".format(str(e)),
213+
),
214+
resp_json,
188215
)
189216

190217
return self._process_response(r, action_result, retry)
@@ -195,7 +222,13 @@ def _make_rest_call_helper(self, *args, **kwargs):
195222
for i in range(MAX_REQUEST_RETRIES + 1):
196223
if time.time() > max_processing_time:
197224
action_result = args[1]
198-
return action_result.set_status(phantom.APP_ERROR, f"Max request timeout of {MAX_REQUEST_TIMEOUT}s exceeded"), None
225+
return (
226+
action_result.set_status(
227+
phantom.APP_ERROR,
228+
f"Max request timeout of {MAX_REQUEST_TIMEOUT}s exceeded",
229+
),
230+
None,
231+
)
199232

200233
ret_val, response = self._make_rest_call(i, *args, **kwargs)
201234
if phantom.is_fail(ret_val) and response:
@@ -313,7 +346,6 @@ def _handle_url_reputation(self, param):
313346
return action_result.set_status(phantom.APP_SUCCESS)
314347

315348
def _query_reputation(self, action_result, payload, observable=None):
316-
317349
taxonomy_ret_val, taxonomy = self._fetch_taxonomy(action_result)
318350

319351
if phantom.is_fail(taxonomy_ret_val):
@@ -368,7 +400,6 @@ def _query_reputation(self, action_result, payload, observable=None):
368400
return phantom.APP_SUCCESS
369401

370402
def _fetch_taxonomy(self, action_result, allow_cache=True):
371-
372403
payload = {"app_info": self._appinfo}
373404

374405
if "taxonomy" in self._state and allow_cache:
@@ -473,7 +504,12 @@ def insert_newlines(string, every=64):
473504
self._appinfo["perf_testing"] = True
474505

475506
with tempfile.NamedTemporaryFile(mode="w+", delete=False, suffix="test") as temp_file:
476-
cert = f"{cert_string}\n-----BEGIN RSA PRIVATE KEY-----\n{textwrap.fill(self._key, 64)}\n-----END RSA PRIVATE KEY-----\n"
507+
cert = (
508+
f"{cert_string}\n"
509+
"-----BEGIN RSA PRIVATE KEY-----\n" # pragma: allowlist secret
510+
f"{textwrap.fill(self._key, 64)}\n"
511+
"-----END RSA PRIVATE KEY-----\n" # pragma: allowlist secret
512+
)
477513

478514
temp_file.write(cert)
479515
temp_file.seek(0) # Move the file pointer to the beginning for reading
@@ -482,7 +518,10 @@ def insert_newlines(string, every=64):
482518
# exceptions shouldn't really be thrown here because most network related disconnections will happen when a request is sent
483519
try:
484520
self.client = httpx.Client(
485-
http2=True, verify=config.get("verify_server_cert", False), cert=temp_file_path, timeout=MAX_REQUEST_TIMEOUT
521+
http2=True,
522+
verify=config.get("verify_server_cert", False),
523+
cert=temp_file_path,
524+
timeout=MAX_REQUEST_TIMEOUT,
486525
)
487526
except Exception as e:
488527
self.debug_print(f"Could not connect to server because of {e}")
@@ -515,7 +554,6 @@ def main():
515554
password = args.password
516555

517556
if username is not None and password is None:
518-
519557
# User specified a username but not a password, so ask
520558
import getpass
521559

ciscotalosintelligence_consts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# File: ciscotalosintelligence_consts.py
22
#
3-
# Copyright (c) 2024 Splunk Inc.
3+
# Copyright (c) 2025 Splunk Inc.
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

manual_readme_content.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[comment]: # " File: README.md"
2-
[comment]: # "Copyright (c) 2024 Splunk Inc."
2+
[comment]: # "Copyright (c) 2025 Splunk Inc."
33
[comment]: # ""
44
[comment]: # "Licensed under the Apache License, Version 2.0 (the 'License');"
55
[comment]: # "you may not use this file except in compliance with the License."

release_notes/1.0.2.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* Add documentation indicating that this app is only supported for SOAR Cloud.

0 commit comments

Comments
 (0)