diff --git a/LICENSE b/LICENSE index bc44b00..12536c5 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright (c) 2016-2023 Splunk Inc. + Copyright (c) 2016-2024 Splunk Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -198,4 +198,4 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and - limitations under the License. \ No newline at end of file + limitations under the License. diff --git a/README.md b/README.md index fa19397..2ade802 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,11 @@ # SMTP Publisher: Splunk -Connector Version: 3.1.0 +Connector Version: 3.1.1 Product Vendor: Generic Product Name: SMTP Product Version Supported (regex): ".\*" -Minimum Product Version: 6.1.0 +Minimum Product Version: 6.1.1 This app provides the ability to send email using SMTP diff --git a/__init__.py b/__init__.py index bc35686..d7d82bb 100644 --- a/__init__.py +++ b/__init__.py @@ -1,6 +1,6 @@ # File: __init__.py # -# Copyright (c) 2016-2023 Splunk Inc. +# Copyright (c) 2016-2024 Splunk Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/release_notes/3.1.1.md b/release_notes/3.1.1.md new file mode 100644 index 0000000..c95e1d1 --- /dev/null +++ b/release_notes/3.1.1.md @@ -0,0 +1 @@ +* Bug fix for accessing vault temp directory path [PAPP-32426] \ No newline at end of file diff --git a/request_handler.py b/request_handler.py index 3afcae7..68da0d7 100644 --- a/request_handler.py +++ b/request_handler.py @@ -1,6 +1,6 @@ # File: request_handler.py # -# Copyright (c) 2016-2023 Splunk Inc. +# Copyright (c) 2016-2024 Splunk Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/requirements.txt b/requirements.txt index 17cac1c..71f2680 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ beautifulsoup4==4.9.1 -bleach==6.0.0 +bleach==6.1.0 bleach-allowlist==1.0.3 bleach[css] diff --git a/smtp.json b/smtp.json index 030f4d9..91c4d39 100644 --- a/smtp.json +++ b/smtp.json @@ -5,15 +5,15 @@ "publisher": "Splunk", "type": "email", "main_module": "smtp_connector.py", - "app_version": "3.1.0", - "utctime_updated": "2023-01-23T18:26:04.000000Z", + "app_version": "3.1.1", + "utctime_updated": "2024-03-06T13:04:08.000000Z", "package_name": "phantom_smtp", "product_vendor": "Generic", "product_name": "SMTP", "product_version_regex": ".*", - "min_phantom_version": "6.1.0", + "min_phantom_version": "6.1.1", "rest_handler": "request_handler.handle_request", - "license": "Copyright (c) 2016-2023 Splunk Inc.", + "license": "Copyright (c) 2016-2024 Splunk Inc.", "logo": "logo_splunk.svg", "logo_dark": "logo_splunk_dark.svg", "python_version": "3", @@ -699,9 +699,6 @@ } } ], - "pip_dependencies": { - "wheel": [] - }, "pip39_dependencies": { "wheel": [ { @@ -710,7 +707,7 @@ }, { "module": "bleach", - "input_file": "wheels/py3/bleach-6.0.0-py3-none-any.whl" + "input_file": "wheels/py3/bleach-6.1.0-py3-none-any.whl" }, { "module": "bleach_allowlist", @@ -722,11 +719,11 @@ }, { "module": "soupsieve", - "input_file": "wheels/py3/soupsieve-2.4.1-py3-none-any.whl" + "input_file": "wheels/py3/soupsieve-2.5-py3-none-any.whl" }, { "module": "tinycss2", - "input_file": "wheels/py3/tinycss2-1.1.1-py3-none-any.whl" + "input_file": "wheels/py3/tinycss2-1.2.1-py3-none-any.whl" }, { "module": "webencodings", diff --git a/smtp_connector.py b/smtp_connector.py index af91e02..3b5ba87 100644 --- a/smtp_connector.py +++ b/smtp_connector.py @@ -1,6 +1,6 @@ # File: smtp_connector.py # -# Copyright (c) 2016-2023 Splunk Inc. +# Copyright (c) 2016-2024 Splunk Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -41,7 +41,6 @@ from bs4 import BeautifulSoup from phantom.action_result import ActionResult from phantom.base_connector import BaseConnector -from phantom.vault import Vault from request_handler import RequestStateHandler, _get_dir_name_from_app_name from smtp_consts import * @@ -693,23 +692,15 @@ def _add_attachments(self, outer, attachments, action_result, message_encoding): if '.pdf' not in attachment_vault_id: return action_result.set_status(phantom.APP_ERROR, SMTP_ERROR_SMTP_SEND_EMAIL) - if hasattr(Vault, "get_phantom_home"): - report_dir_pre_4_0 = '{0}/www/reports'.format(self.get_phantom_home()) - report_dir_post_4_0 = '{0}/vault/reports'.format(self.get_phantom_home()) - else: - report_dir_pre_4_0 = '/opt/phantom/www/reports' - report_dir_post_4_0 = '/opt/phantom/vault/reports' + phantom_home_path = self.get_phantom_home() + report_dir = os.path.join(phantom_home_path, "vault", "reports") - filename = '' - for report_dir in (report_dir_post_4_0, report_dir_pre_4_0): - test_filename = os.path.join(report_dir, attachment_vault_id) - test_filename = os.path.abspath(test_filename) + test_filename = os.path.join(report_dir, attachment_vault_id) + test_filename = os.path.abspath(test_filename) - if os.path.isfile(test_filename): - filename = test_filename - break + filename = test_filename if os.path.isfile(test_filename) else "" - is_valid_path = filename.startswith(report_dir_pre_4_0) or filename.startswith(report_dir_post_4_0) + is_valid_path = filename.startswith(report_dir) if not filename or not is_valid_path: return action_result.set_status(phantom.APP_ERROR, SMTP_ERROR_SMTP_SEND_EMAIL) diff --git a/smtp_consts.py b/smtp_consts.py index c1e4c9f..58a8e8c 100644 --- a/smtp_consts.py +++ b/smtp_consts.py @@ -1,6 +1,6 @@ # File: smtp_consts.py # -# Copyright (c) 2016-2023 Splunk Inc. +# Copyright (c) 2016-2024 Splunk Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/wheels/py3/bleach-6.0.0-py3-none-any.whl b/wheels/py3/bleach-6.1.0-py3-none-any.whl similarity index 79% rename from wheels/py3/bleach-6.0.0-py3-none-any.whl rename to wheels/py3/bleach-6.1.0-py3-none-any.whl index eb43e48..2a5053e 100644 Binary files a/wheels/py3/bleach-6.0.0-py3-none-any.whl and b/wheels/py3/bleach-6.1.0-py3-none-any.whl differ diff --git a/wheels/py3/soupsieve-2.4.1-py3-none-any.whl b/wheels/py3/soupsieve-2.4.1-py3-none-any.whl deleted file mode 100644 index 26a486c..0000000 Binary files a/wheels/py3/soupsieve-2.4.1-py3-none-any.whl and /dev/null differ diff --git a/wheels/py3/soupsieve-2.5-py3-none-any.whl b/wheels/py3/soupsieve-2.5-py3-none-any.whl new file mode 100644 index 0000000..e1be128 Binary files /dev/null and b/wheels/py3/soupsieve-2.5-py3-none-any.whl differ diff --git a/wheels/py3/tinycss2-1.1.1-py3-none-any.whl b/wheels/py3/tinycss2-1.2.1-py3-none-any.whl similarity index 62% rename from wheels/py3/tinycss2-1.1.1-py3-none-any.whl rename to wheels/py3/tinycss2-1.2.1-py3-none-any.whl index 9aac3bf..3e41dd4 100644 Binary files a/wheels/py3/tinycss2-1.1.1-py3-none-any.whl and b/wheels/py3/tinycss2-1.2.1-py3-none-any.whl differ