Skip to content

Commit

Permalink
Merge pull request #12 from splunk-soar-connectors/tcihak-PAPP-31092
Browse files Browse the repository at this point in the history
PAPP-31092 updating packages due to lxml vulnerability
  • Loading branch information
tonyc-phantom authored Jul 15, 2024
2 parents 0dfba91 + 935a76f commit 45ccb86
Show file tree
Hide file tree
Showing 39 changed files with 189 additions and 294 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Linting
on: [push, pull_request]
jobs:
lint:
lint:
# Run per push for internal contributers. This isn't possible for forked pull requests,
# so we'll need to run on PR events for external contributers.
# String comparison below is case insensitive.
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
repos:
- repo: https://github.com/phantomcyber/dev-cicd-tools
rev: v1.16
rev: v1.18
hooks:
- id: org-hook
- id: package-app-dependencies
- repo: https://github.com/Yelp/detect-secrets
rev: v1.4.0
rev: v1.5.0
hooks:
- id: detect-secrets
args: ['--no-verify', '--exclude-files', '^symantecdlp.json$']
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -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.
limitations under the License.
286 changes: 143 additions & 143 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# File: __init__.py
#
# Copyright (c) 2018-2022 Splunk Inc.
# Copyright (c) 2018-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.
Expand Down
2 changes: 1 addition & 1 deletion manual_readme_content.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[comment]: # " File: README.md"
[comment]: # " Copyright (c) 2018-2022 Splunk Inc."
[comment]: # " Copyright (c) 2018-2024 Splunk Inc."
[comment]: # ""
[comment]: # "Licensed under the Apache License, Version 2.0 (the 'License');"
[comment]: # "you may not use this file except in compliance with the License."
Expand Down
2 changes: 1 addition & 1 deletion parse_incidents.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# File: parse_incidents.py
#
# Copyright (c) 2018-2022 Splunk Inc.
# Copyright (c) 2018-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.
Expand Down
1 change: 1 addition & 0 deletions release_notes/unreleased.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
**Unreleased**
* Updated lxml package due to vulnerability [PAPP-31092]
9 changes: 4 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
beautifulsoup4==4.9.1
python-magic==0.4.18
pytz==2021.1
requests==2.25.0
zeep==3.4.0
beautifulsoup4==4.12.2
python-magic==0.4.24
pytz==2023.3
zeep==4.2.1
142 changes: 15 additions & 127 deletions symantecdlp.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
"publisher": "Splunk",
"type": "endpoint",
"main_module": "symantecdlp_connector.py",
"app_version": "2.1.9",
"app_version": "2.2.0",
"utctime_updated": "2022-02-04T16:40:17.000000Z",
"package_name": "phantom_symantecdlp",
"product_vendor": "Symantec",
"product_name": "Symantec DLP",
"product_version_regex": ".*",
"fips_compliant": true,
"min_phantom_version": "5.1.0",
"min_phantom_version": "6.2.1",
"python_version": "3",
"logo": "logo_symantec.svg",
"logo_dark": "logo_symantec_dark.svg",
"license": "Copyright (c) 2018-2022 Splunk Inc.",
"license": "Copyright (c) 2018-2024 Splunk Inc.",
"latest_tested_versions": [
"Symantec DLP version 15.8"
],
Expand Down Expand Up @@ -1003,156 +1003,44 @@
"versions": "EQ(*)"
}
],
"pip_dependencies": {
"pip39_dependencies": {
"wheel": [
{
"module": "appdirs",
"input_file": "wheels/shared/appdirs-1.4.4-py2.py3-none-any.whl"
},
{
"module": "attrs",
"input_file": "wheels/shared/attrs-21.4.0-py2.py3-none-any.whl"
},
{
"module": "beautifulsoup4",
"input_file": "wheels/py3/beautifulsoup4-4.9.1-py3-none-any.whl"
},
{
"module": "cached_property",
"input_file": "wheels/shared/cached_property-1.5.2-py2.py3-none-any.whl"
},
{
"module": "certifi",
"input_file": "wheels/shared/certifi-2021.10.8-py2.py3-none-any.whl"
},
{
"module": "chardet",
"input_file": "wheels/shared/chardet-3.0.4-py2.py3-none-any.whl"
},
{
"module": "defusedxml",
"input_file": "wheels/shared/defusedxml-0.7.1-py2.py3-none-any.whl"
},
{
"module": "idna",
"input_file": "wheels/shared/idna-2.10-py2.py3-none-any.whl"
"input_file": "wheels/py3/attrs-23.2.0-py3-none-any.whl"
},
{
"module": "isodate",
"input_file": "wheels/shared/isodate-0.6.1-py2.py3-none-any.whl"
},
{
"module": "lxml",
"input_file": "wheels/py36/lxml-4.7.1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl"
},
{
"module": "python_magic",
"input_file": "wheels/shared/python_magic-0.4.18-py2.py3-none-any.whl"
},
{
"module": "pytz",
"input_file": "wheels/shared/pytz-2021.1-py2.py3-none-any.whl"
},
{
"module": "requests",
"input_file": "wheels/shared/requests-2.25.0-py2.py3-none-any.whl"
},
{
"module": "requests_toolbelt",
"input_file": "wheels/shared/requests_toolbelt-0.9.1-py2.py3-none-any.whl"
"input_file": "wheels/py39/lxml-5.2.2-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.whl"
},
{
"module": "six",
"input_file": "wheels/shared/six-1.16.0-py2.py3-none-any.whl"
},
{
"module": "soupsieve",
"input_file": "wheels/py3/soupsieve-2.3.1-py3-none-any.whl"
},
{
"module": "urllib3",
"input_file": "wheels/shared/urllib3-1.26.8-py2.py3-none-any.whl"
},
{
"module": "zeep",
"input_file": "wheels/shared/zeep-3.4.0-py2.py3-none-any.whl"
}
]
},
"pip39_dependencies": {
"wheel": [
{
"module": "appdirs",
"input_file": "wheels/shared/appdirs-1.4.4-py2.py3-none-any.whl"
},
{
"module": "attrs",
"input_file": "wheels/shared/attrs-21.4.0-py2.py3-none-any.whl"
},
{
"module": "beautifulsoup4",
"input_file": "wheels/py3/beautifulsoup4-4.9.1-py3-none-any.whl"
},
{
"module": "cached_property",
"input_file": "wheels/shared/cached_property-1.5.2-py2.py3-none-any.whl"
},
{
"module": "certifi",
"input_file": "wheels/shared/certifi-2021.10.8-py2.py3-none-any.whl"
},
{
"module": "chardet",
"input_file": "wheels/shared/chardet-3.0.4-py2.py3-none-any.whl"
},
{
"module": "defusedxml",
"input_file": "wheels/shared/defusedxml-0.7.1-py2.py3-none-any.whl"
},
{
"module": "idna",
"input_file": "wheels/shared/idna-2.10-py2.py3-none-any.whl"
},
{
"module": "isodate",
"input_file": "wheels/shared/isodate-0.6.1-py2.py3-none-any.whl"
},
{
"module": "lxml",
"input_file": "wheels/py39/lxml-4.7.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl"
"module": "platformdirs",
"input_file": "wheels/py3/platformdirs-4.2.2-py3-none-any.whl"
},
{
"module": "python_magic",
"input_file": "wheels/shared/python_magic-0.4.18-py2.py3-none-any.whl"
"input_file": "wheels/shared/python_magic-0.4.24-py2.py3-none-any.whl"
},
{
"module": "pytz",
"input_file": "wheels/shared/pytz-2021.1-py2.py3-none-any.whl"
"input_file": "wheels/shared/pytz-2023.3-py2.py3-none-any.whl"
},
{
"module": "requests",
"input_file": "wheels/shared/requests-2.25.0-py2.py3-none-any.whl"
"module": "requests_file",
"input_file": "wheels/shared/requests_file-2.1.0-py2.py3-none-any.whl"
},
{
"module": "requests_toolbelt",
"input_file": "wheels/shared/requests_toolbelt-0.9.1-py2.py3-none-any.whl"
},
{
"module": "six",
"input_file": "wheels/shared/six-1.16.0-py2.py3-none-any.whl"
},
{
"module": "soupsieve",
"input_file": "wheels/py3/soupsieve-2.3.1-py3-none-any.whl"
},
{
"module": "urllib3",
"input_file": "wheels/shared/urllib3-1.26.8-py2.py3-none-any.whl"
"input_file": "wheels/shared/requests_toolbelt-1.0.0-py2.py3-none-any.whl"
},
{
"module": "zeep",
"input_file": "wheels/shared/zeep-3.4.0-py2.py3-none-any.whl"
"input_file": "wheels/py3/zeep-4.2.1-py3-none-any.whl"
}
]
}
}
}
16 changes: 8 additions & 8 deletions symantecdlp_connector.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# File: symantecdlp_connector.py
#
# Copyright (c) 2018-2022 Splunk Inc.
# Copyright (c) 2018-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.
Expand Down Expand Up @@ -200,20 +200,20 @@ def _get_error_message_from_exception(self, e):
:return: error message
"""

error_msg = DLP_ERR_MESSAGE
error_code = DLP_ERR_CODE_MESSAGE
error_message = DLP_ERROR_MESSAGE
error_code = DLP_ERROR_CODE_MESSAGE
try:
if hasattr(e, "args"):
if len(e.args) > 1:
error_code = e.args[0]
error_msg = e.args[1]
error_message = e.args[1]
elif len(e.args) == 1:
error_code = DLP_ERR_CODE_MESSAGE
error_msg = e.args[0]
error_code = DLP_ERROR_CODE_MESSAGE
error_message = e.args[0]
except:
pass

return "Error Code: {0}. Error Message: {1}".format(error_code, error_msg)
return "Error Code: {0}. Error Message: {1}".format(error_code, error_message)

def _cleanse_key_names(self, input_dict):

Expand Down Expand Up @@ -374,7 +374,7 @@ def _handle_list_incidents(self, param):

date_status = self._validate_date(creation_time_after)
if not date_status:
return action_result.set_status(phantom.APP_ERROR, DLP_TIMESTAMP_VALIDATION_FAILED_MSG)
return action_result.set_status(phantom.APP_ERROR, DLP_TIMESTAMP_VALIDATION_FAILED_MESSAGE)

try:
response = self._client.service.incidentList(report_id, creation_time_after)
Expand Down
8 changes: 4 additions & 4 deletions symantecdlp_consts.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# File: symantecdlp_consts.py
#
# Copyright (c) 2018-2022 Splunk Inc.
# Copyright (c) 2018-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.
Expand Down Expand Up @@ -37,13 +37,13 @@
DLP_JSON_INCLUDE_HISTORY = "include_history"
DLP_JSON_INCLUDE_VIOLATIONS = "include_violations"
DLP_TIME_FORMAT = "%Y-%m-%dT%H:%M:%S%z"
DLP_TIMESTAMP_VALIDATION_FAILED_MSG = 'Incorrect timestamp format, please enter in YYYY-MM-DD or valid ' \
DLP_TIMESTAMP_VALIDATION_FAILED_MESSAGE = 'Incorrect timestamp format, please enter in YYYY-MM-DD or valid ' \
'ISO 8601 timestamp format.'
DLP_VALID_TIME = 'Time validation successful'

DLP_VALIDATE_INTEGER_MESSAGE = "Please provide a valid integer value in the {key} parameter"
DLP_ERR_MESSAGE = "Unknown error occurred. Please check the asset configuration and|or action parameters."
DLP_ERR_CODE_MESSAGE = "Error code unavailable"
DLP_ERROR_MESSAGE = "Unknown error occurred. Please check the asset configuration and|or action parameters."
DLP_ERROR_CODE_MESSAGE = "Error code unavailable"
DLP_UNKNOWN_SEVERITY = 'Unknown severity found. Severity {key} is not defined in custom severity. Hence, we are setting it as medium.'

DLP_SEVERITY_DICT = {
Expand Down
7 changes: 7 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[flake8]
max-line-length = 145
max-complexity = 28
extend-ignore = F403,E128,E126,E111,E121,E127,E731,E201,E202,F405,E722,D,W292

[isort]
line_length = 145
Binary file added wheels/py3/attrs-23.2.0-py3-none-any.whl
Binary file not shown.
Binary file removed wheels/py3/beautifulsoup4-4.9.1-py3-none-any.whl
Binary file not shown.
Binary file added wheels/py3/platformdirs-4.2.2-py3-none-any.whl
Binary file not shown.
Binary file removed wheels/py3/soupsieve-2.3.1-py3-none-any.whl
Binary file not shown.
Binary file added wheels/py3/zeep-4.2.1-py3-none-any.whl
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed wheels/shared/appdirs-1.4.4-py2.py3-none-any.whl
Binary file not shown.
Binary file removed wheels/shared/attrs-21.4.0-py2.py3-none-any.whl
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed wheels/shared/chardet-3.0.4-py2.py3-none-any.whl
Binary file not shown.
Binary file not shown.
Binary file removed wheels/shared/idna-2.10-py2.py3-none-any.whl
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed wheels/shared/pytz-2021.1-py2.py3-none-any.whl
Binary file not shown.
Binary file added wheels/shared/pytz-2023.3-py2.py3-none-any.whl
Binary file not shown.
Binary file removed wheels/shared/requests-2.25.0-py2.py3-none-any.whl
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed wheels/shared/six-1.16.0-py2.py3-none-any.whl
Binary file not shown.
Binary file removed wheels/shared/urllib3-1.26.8-py2.py3-none-any.whl
Binary file not shown.
Binary file removed wheels/shared/zeep-3.4.0-py2.py3-none-any.whl
Binary file not shown.

0 comments on commit 45ccb86

Please sign in to comment.