mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-10 14:55:00 +00:00
fix: Linter issues (#1471)
Co-authored-by: Sergio Garcia <38561120+sergargar@users.noreply.github.com>
This commit is contained in:
@@ -117,7 +117,7 @@ def print_checks(provider: str, check_list: set, bulk_checks_metadata: dict):
|
||||
# List available groups
|
||||
def list_groups(provider: str):
|
||||
groups = parse_groups_from_file(groups_file)
|
||||
print(f"Available Groups:")
|
||||
print("Available Groups:")
|
||||
|
||||
for group, value in groups[provider].items():
|
||||
group_description = value["description"]
|
||||
@@ -219,8 +219,3 @@ def run_check(check, audit_info, output_options):
|
||||
report(findings, output_options, audit_info)
|
||||
finally:
|
||||
pass
|
||||
|
||||
|
||||
def import_check(check_path: str) -> ModuleType:
|
||||
lib = importlib.import_module(f"{check_path}")
|
||||
return lib
|
||||
|
||||
@@ -273,7 +273,6 @@ def send_to_s3_bucket(
|
||||
):
|
||||
try:
|
||||
# Get only last part of the path
|
||||
output_directory = output_directory.split("/")[-1]
|
||||
if output_mode == "csv":
|
||||
filename = f"{output_filename}{csv_file_suffix}"
|
||||
elif output_mode == "json":
|
||||
|
||||
@@ -233,7 +233,7 @@ class Test_Outputs:
|
||||
|
||||
expected = Check_Output_JSON_ASFF()
|
||||
expected.Id = f"prowler-{finding.check_metadata.CheckID}-123456789012-eu-west-1-{hash_sha512('test-resource')}"
|
||||
expected.ProductArn = f"arn:aws:securityhub:eu-west-1::product/prowler/prowler"
|
||||
expected.ProductArn = "arn:aws:securityhub:eu-west-1::product/prowler/prowler"
|
||||
expected.ProductFields = ProductFields(
|
||||
ProviderVersion=prowler_version, ProwlerResourceName="test-resource"
|
||||
)
|
||||
@@ -291,15 +291,9 @@ class Test_Outputs:
|
||||
client = boto3.client("s3")
|
||||
client.create_bucket(Bucket=bucket_name)
|
||||
# Create mock csv output file
|
||||
output_directory = "."
|
||||
output_directory = f"{os.path.dirname(os.path.realpath(__file__))}/fixtures"
|
||||
output_mode = "csv"
|
||||
filename = (
|
||||
f"prowler-output-{input_audit_info.audited_account}-{output_file_timestamp}"
|
||||
)
|
||||
file_descriptor = open_file(
|
||||
f"{output_directory}/{filename}{csv_file_suffix}",
|
||||
"a",
|
||||
)
|
||||
filename = f"prowler-output-{input_audit_info.audited_account}"
|
||||
# Send mock csv file to mock S3 Bucket
|
||||
send_to_s3_bucket(
|
||||
filename,
|
||||
@@ -321,4 +315,3 @@ class Test_Outputs:
|
||||
)["ContentType"]
|
||||
== "binary/octet-stream"
|
||||
)
|
||||
remove(f"{output_directory}/{filename}{csv_file_suffix}")
|
||||
|
||||
Reference in New Issue
Block a user