mirror of
https://github.com/ghndrx/prowler.git
synced 2026-02-10 14:55:00 +00:00
chore: сhanged concatenation of strings to f-strings to improve readability (#3227)
This commit is contained in:
@@ -407,7 +407,7 @@ def get_azure_html_assessment_summary(audit_info):
|
|||||||
if isinstance(audit_info, Azure_Audit_Info):
|
if isinstance(audit_info, Azure_Audit_Info):
|
||||||
printed_subscriptions = []
|
printed_subscriptions = []
|
||||||
for key, value in audit_info.identity.subscriptions.items():
|
for key, value in audit_info.identity.subscriptions.items():
|
||||||
intermediate = key + " : " + value
|
intermediate = f"{key} : {value}"
|
||||||
printed_subscriptions.append(intermediate)
|
printed_subscriptions.append(intermediate)
|
||||||
|
|
||||||
# check if identity is str(coming from SP) or dict(coming from browser or)
|
# check if identity is str(coming from SP) or dict(coming from browser or)
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ def send_slack_message(token, channel, stats, provider, audit_info):
|
|||||||
response = client.chat_postMessage(
|
response = client.chat_postMessage(
|
||||||
username="Prowler",
|
username="Prowler",
|
||||||
icon_url=square_logo_img,
|
icon_url=square_logo_img,
|
||||||
channel="#" + channel,
|
channel=f"#{channel}",
|
||||||
blocks=create_message_blocks(identity, logo, stats),
|
blocks=create_message_blocks(identity, logo, stats),
|
||||||
)
|
)
|
||||||
return response
|
return response
|
||||||
@@ -35,7 +35,7 @@ def create_message_identity(provider, audit_info):
|
|||||||
elif provider == "azure":
|
elif provider == "azure":
|
||||||
printed_subscriptions = []
|
printed_subscriptions = []
|
||||||
for key, value in audit_info.identity.subscriptions.items():
|
for key, value in audit_info.identity.subscriptions.items():
|
||||||
intermediate = "- *" + key + ": " + value + "*\n"
|
intermediate = f"- *{key}: {value}*\n"
|
||||||
printed_subscriptions.append(intermediate)
|
printed_subscriptions.append(intermediate)
|
||||||
identity = f"Azure Subscriptions:\n{''.join(printed_subscriptions)}"
|
identity = f"Azure Subscriptions:\n{''.join(printed_subscriptions)}"
|
||||||
logo = azure_logo
|
logo = azure_logo
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class apigateway_restapi_authorizers_enabled(Check):
|
|||||||
if authorization_method == "NONE":
|
if authorization_method == "NONE":
|
||||||
all_methods_authorized = False
|
all_methods_authorized = False
|
||||||
unauthorized_method = (
|
unauthorized_method = (
|
||||||
resource.path + " -> " + http_method
|
f"{resource.path} -> {http_method}"
|
||||||
)
|
)
|
||||||
resource_paths_with_unathorized_methods.append(
|
resource_paths_with_unathorized_methods.append(
|
||||||
unauthorized_method
|
unauthorized_method
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ GCP Account: {Fore.YELLOW}[{profile}]{Style.RESET_ALL} GCP Project IDs: {Fore.Y
|
|||||||
def print_azure_credentials(self, audit_info: Azure_Audit_Info):
|
def print_azure_credentials(self, audit_info: Azure_Audit_Info):
|
||||||
printed_subscriptions = []
|
printed_subscriptions = []
|
||||||
for key, value in audit_info.identity.subscriptions.items():
|
for key, value in audit_info.identity.subscriptions.items():
|
||||||
intermediate = key + " : " + value
|
intermediate = f"{key} : {value}"
|
||||||
printed_subscriptions.append(intermediate)
|
printed_subscriptions.append(intermediate)
|
||||||
report = f"""
|
report = f"""
|
||||||
This report is being generated using the identity below:
|
This report is being generated using the identity below:
|
||||||
|
|||||||
@@ -281,7 +281,7 @@ class Test_Common_Output_Options:
|
|||||||
}
|
}
|
||||||
printed_subscriptions = []
|
printed_subscriptions = []
|
||||||
for key, value in audit_info.identity.subscriptions.items():
|
for key, value in audit_info.identity.subscriptions.items():
|
||||||
intermediate = key + " : " + value
|
intermediate = f"{key} : {value}"
|
||||||
printed_subscriptions.append(intermediate)
|
printed_subscriptions.append(intermediate)
|
||||||
assert (
|
assert (
|
||||||
get_assessment_summary(audit_info)
|
get_assessment_summary(audit_info)
|
||||||
|
|||||||
Reference in New Issue
Block a user