Skip to content

Commit

Permalink
PSAAS-20421 | dependencies updated
Browse files Browse the repository at this point in the history
  • Loading branch information
kczernik-splunk committed Dec 10, 2024
1 parent 5a66658 commit e4b7c88
Show file tree
Hide file tree
Showing 14 changed files with 200 additions and 202 deletions.
7 changes: 4 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
repos:
- repo: https://github.com/phantomcyber/dev-cicd-tools
rev: v1.16
rev: v1.24
hooks:
- id: org-hook
- id: package-app-dependencies
- id: readme-check
- repo: https://github.com/Yelp/detect-secrets
rev: v1.4.0
rev: v1.5.0
hooks:
- id: detect-secrets
args: ['--no-verify', '--exclude-files', '^awsinspector.json$']
args: ['--no-verify', '--exclude-files', '^(awsinspector.json|README.md)$']
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.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Connector Version: 2.2.11
Product Vendor: AWS
Product Name: Inspector
Product Version Supported (regex): ".\*"
Minimum Product Version: 5.2.0
Minimum Product Version: 6.3.0

This app integrates with AWS Inspector to perform security assessment actions

Expand Down
14 changes: 1 addition & 13 deletions awsinspector.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"utctime_updated": "2022-01-07T21:56:46.000000Z",
"package_name": "phantom_awsinspector",
"main_module": "awsinspector_connector.py",
"min_phantom_version": "5.2.0",
"min_phantom_version": "6.3.0",
"fips_compliant": true,
"latest_tested_versions": [
"Cloud tested on July 29th, 2021"
Expand All @@ -35,21 +35,9 @@
"module": "jmespath",
"input_file": "wheels/shared/jmespath-0.10.0-py2.py3-none-any.whl"
},
{
"module": "python_dateutil",
"input_file": "wheels/shared/python_dateutil-2.8.1-py2.py3-none-any.whl"
},
{
"module": "s3transfer",
"input_file": "wheels/shared/s3transfer-0.3.7-py2.py3-none-any.whl"
},
{
"module": "six",
"input_file": "wheels/shared/six-1.16.0-py2.py3-none-any.whl"
},
{
"module": "urllib3",
"input_file": "wheels/shared/urllib3-1.26.18-py2.py3-none-any.whl"
}
]
},
Expand Down
312 changes: 158 additions & 154 deletions awsinspector_connector.py

Large diffs are not rendered by default.

32 changes: 16 additions & 16 deletions awsinspector_consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@
#
#
# Define your constants here
AWSINSPECTOR_INVALID_LIMIT = 'Please provide non-zero positive integer in limit'
AWSINSPECTOR_INVALID_LIMIT = "Please provide non-zero positive integer in limit"
AWSINSPECTOR_MAX_PER_PAGE_LIMIT = 500
AWSINSPECTOR_JSON_REGION = "region"
AWSINSPECTOR_REGION_DICT = {
"US East (N. Virginia)": "us-east-1",
"US East (Ohio)": "us-east-2",
"US West (N. California)": "us-west-1",
"US West (Oregon)": "us-west-2",
"Asia Pacific (Mumbai)": "ap-south-1",
"Asia Pacific (Seoul)": "ap-northeast-2",
"Asia Pacific (Singapore)": "ap-southeast-1",
"Asia Pacific (Sydney)": "ap-southeast-2",
"Asia Pacific (Tokyo)": "ap-northeast-1",
"EU (Frankfurt)": "eu-central-1",
"EU (Ireland)": "eu-west-1",
"EU (London)": "eu-west-2",
}
AWSINSPECTOR_BAD_ASSET_CONFIG_MSG = 'Please provide access keys or select assume role check box in asset configuration'
AWSINSPECTOR_ROLE_CREDENTIALS_FAILURE_MSG = 'Failed to retrieve EC2 role credentials from instance'
"US East (N. Virginia)": "us-east-1",
"US East (Ohio)": "us-east-2",
"US West (N. California)": "us-west-1",
"US West (Oregon)": "us-west-2",
"Asia Pacific (Mumbai)": "ap-south-1",
"Asia Pacific (Seoul)": "ap-northeast-2",
"Asia Pacific (Singapore)": "ap-southeast-1",
"Asia Pacific (Sydney)": "ap-southeast-2",
"Asia Pacific (Tokyo)": "ap-northeast-1",
"EU (Frankfurt)": "eu-central-1",
"EU (Ireland)": "eu-west-1",
"EU (London)": "eu-west-2",
}
AWSINSPECTOR_BAD_ASSET_CONFIG_MSG = "Please provide access keys or select assume role check box in asset configuration"
AWSINSPECTOR_ROLE_CREDENTIALS_FAILURE_MSG = "Failed to retrieve EC2 role credentials from instance"
AWSINSPECTOR_DEFAULT_TIMEOUT = 30
18 changes: 9 additions & 9 deletions awsinspector_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# either express or implied. See the License for the specific language governing permissions
# and limitations under the License.
def get_ctx_result(provides, result):
""" Function that parses data.
"""Function that parses data.
:param result: result
:param provides: action name
Expand All @@ -26,30 +26,30 @@ def get_ctx_result(provides, result):
summary = result.get_summary()
data = result.get_data()

ctx_result['param'] = param
ctx_result["param"] = param

if summary:
ctx_result['summary'] = summary
ctx_result['action'] = provides
ctx_result["summary"] = summary
ctx_result["action"] = provides
if not data:
ctx_result['data'] = {}
ctx_result["data"] = {}
return ctx_result

ctx_result['data'] = data
ctx_result["data"] = data

return ctx_result


def display_view(provides, all_app_runs, context):
""" Function that displays view.
"""Function that displays view.
:param provides: action name
:param context: context
:param all_app_runs: all app runs
:return: html page
"""

context['results'] = results = []
context["results"] = results = []
for summary, action_results in all_app_runs:
for result in action_results:

Expand All @@ -59,7 +59,7 @@ def display_view(provides, all_app_runs, context):
results.append(ctx_result)

if provides == "run assessment":
return_page = "awsinspector_run_assessment.html"
return_page = "awsinspector_run_assessment.html"
elif provides == "list templates":
return_page = "awsinspector_list_templates.html"
elif provides == "get findings":
Expand Down
8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[tool.black]
line-length = 145
target-version = ['py39']
verbose = true

[tool.isort]
line_length = 145
profile = "black"
1 change: 1 addition & 0 deletions release_notes/unreleased.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
**Unreleased**
* [PSAAS-20421] update dependencies
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
boto3==1.17.30
botocore==1.20.30
python-dateutil==2.8.1
5 changes: 1 addition & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
[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
extend-ignore = F403,E128,E126,E121,E127,E731,E201,E202,E203,E701,F405,E722,D,W503
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.18-py2.py3-none-any.whl
Binary file not shown.

0 comments on commit e4b7c88

Please sign in to comment.