Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(azure): Status extended ends with a dot #2725

Merged
merged 1 commit into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ def execute(self) -> Check_Report_Azure:
report.subscription = subscription
report.resource_name = "Defender plan App Services"
report.resource_id = pricings["AppServices"].resource_id
report.status_extended = f"Defender plan Defender for App Services from subscription {subscription} is set to ON (pricing tier standard)"
report.status_extended = f"Defender plan Defender for App Services from subscription {subscription} is set to ON (pricing tier standard)."
if pricings["AppServices"].pricing_tier != "Standard":
report.status = "FAIL"
report.status_extended = f"Defender plan Defender for App Services from subscription {subscription} is set to OFF (pricing tier not standard)"
report.status_extended = f"Defender plan Defender for App Services from subscription {subscription} is set to OFF (pricing tier not standard)."

findings.append(report)
return findings
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ def execute(self) -> Check_Report_Azure:
report.subscription = subscription
report.resource_id = pricings["Arm"].resource_id
report.resource_name = "Defender plan ARM"
report.status_extended = f"Defender plan Defender for ARM from subscription {subscription} is set to ON (pricing tier standard)"
report.status_extended = f"Defender plan Defender for ARM from subscription {subscription} is set to ON (pricing tier standard)."
if pricings["Arm"].pricing_tier != "Standard":
report.status = "FAIL"
report.status_extended = f"Defender plan Defender for ARM from subscription {subscription} is set to OFF (pricing tier not standard)"
report.status_extended = f"Defender plan Defender for ARM from subscription {subscription} is set to OFF (pricing tier not standard)."

findings.append(report)
return findings
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ def execute(self) -> Check_Report_Azure:
report.subscription = subscription
report.resource_id = pricings["SqlServers"].resource_id
report.resource_name = "Defender plan Azure SQL DB Servers"
report.status_extended = f"Defender plan Defender for Azure SQL DB Servers from subscription {subscription} is set to ON (pricing tier standard)"
report.status_extended = f"Defender plan Defender for Azure SQL DB Servers from subscription {subscription} is set to ON (pricing tier standard)."
if pricings["SqlServers"].pricing_tier != "Standard":
report.status = "FAIL"
report.status_extended = f"Defender plan Defender for Azure SQL DB Servers from subscription {subscription} is set to OFF (pricing tier not standard)"
report.status_extended = f"Defender plan Defender for Azure SQL DB Servers from subscription {subscription} is set to OFF (pricing tier not standard)."

findings.append(report)
return findings
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ def execute(self) -> Check_Report_Azure:
report.subscription = subscription
report.resource_id = pricings["Containers"].resource_id
report.resource_name = "Defender plan Container Registries"
report.status_extended = f"Defender plan Defender for Containers from subscription {subscription} is set to ON (pricing tier standard)"
report.status_extended = f"Defender plan Defender for Containers from subscription {subscription} is set to ON (pricing tier standard)."
if pricings["Containers"].pricing_tier != "Standard":
report.status = "FAIL"
report.status_extended = f"Defender plan Defender for Containers from subscription {subscription} is set to OFF (pricing tier not standard)"
report.status_extended = f"Defender plan Defender for Containers from subscription {subscription} is set to OFF (pricing tier not standard)."

findings.append(report)
return findings
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ def execute(self) -> Check_Report_Azure:
report.subscription = subscription
report.resource_id = pricings["CosmosDbs"].resource_id
report.resource_name = "Defender plan Cosmos DB"
report.status_extended = f"Defender plan Defender for Cosmos DB from subscription {subscription} is set to ON (pricing tier standard)"
report.status_extended = f"Defender plan Defender for Cosmos DB from subscription {subscription} is set to ON (pricing tier standard)."
if pricings["CosmosDbs"].pricing_tier != "Standard":
report.status = "FAIL"
report.status_extended = f"Defender plan Defender for Cosmos DB from subscription {subscription} is set to OFF (pricing tier not standard)"
report.status_extended = f"Defender plan Defender for Cosmos DB from subscription {subscription} is set to OFF (pricing tier not standard)."

findings.append(report)
return findings
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def execute(self) -> Check_Report_Azure:
report.subscription = subscription
report.resource_id = pricings["SqlServers"].resource_id
report.status = "PASS"
report.status_extended = f"Defender plan Defender for Databases from subscription {subscription} is set to ON (pricing tier standard)"
report.status_extended = f"Defender plan Defender for Databases from subscription {subscription} is set to ON (pricing tier standard)."
if (
pricings["SqlServers"].pricing_tier != "Standard"
or pricings["SqlServerVirtualMachines"].pricing_tier != "Standard"
Expand All @@ -26,7 +26,7 @@ def execute(self) -> Check_Report_Azure:
or pricings["CosmosDbs"].pricing_tier != "Standard"
):
report.status = "FAIL"
report.status_extended = f"Defender plan Defender for Databases from subscription {subscription} is set to OFF (pricing tier not standard)"
report.status_extended = f"Defender plan Defender for Databases from subscription {subscription} is set to OFF (pricing tier not standard)."

findings.append(report)
return findings
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ def execute(self) -> Check_Report_Azure:
report.subscription = subscription
report.resource_name = "Defender plan DNS"
report.resource_id = pricings["Dns"].resource_id
report.status_extended = f"Defender plan Defender for DNS from subscription {subscription} is set to ON (pricing tier standard)"
report.status_extended = f"Defender plan Defender for DNS from subscription {subscription} is set to ON (pricing tier standard)."
if pricings["Dns"].pricing_tier != "Standard":
report.status = "FAIL"
report.status_extended = f"Defender plan Defender for DNS from subscription {subscription} is set to OFF (pricing tier not standard)"
report.status_extended = f"Defender plan Defender for DNS from subscription {subscription} is set to OFF (pricing tier not standard)."

findings.append(report)
return findings
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ def execute(self) -> Check_Report_Azure:
report.subscription = subscription
report.resource_name = "Defender plan KeyVaults"
report.resource_id = pricings["KeyVaults"].resource_id
report.status_extended = f"Defender plan Defender for KeyVaults from subscription {subscription} is set to ON (pricing tier standard)"
report.status_extended = f"Defender plan Defender for KeyVaults from subscription {subscription} is set to ON (pricing tier standard)."
if pricings["KeyVaults"].pricing_tier != "Standard":
report.status = "FAIL"
report.status_extended = f"Defender plan Defender for KeyVaults from subscription {subscription} is set to OFF (pricing tier not standard)"
report.status_extended = f"Defender plan Defender for KeyVaults from subscription {subscription} is set to OFF (pricing tier not standard)."

findings.append(report)
return findings
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ def execute(self) -> Check_Report_Azure:
report.resource_id = pricings[
"OpenSourceRelationalDatabases"
].resource_id
report.status_extended = f"Defender plan Defender for Open-Source Relational Databases from subscription {subscription} is set to ON (pricing tier standard)"
report.status_extended = f"Defender plan Defender for Open-Source Relational Databases from subscription {subscription} is set to ON (pricing tier standard)."
if pricings["OpenSourceRelationalDatabases"].pricing_tier != "Standard":
report.status = "FAIL"
report.status_extended = f"Defender plan Defender for Open-Source Relational Databases from subscription {subscription} is set to OFF (pricing tier not standard)"
report.status_extended = f"Defender plan Defender for Open-Source Relational Databases from subscription {subscription} is set to OFF (pricing tier not standard)."

findings.append(report)
return findings
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ def execute(self) -> Check_Report_Azure:
report.subscription = subscription
report.resource_name = "Defender plan Servers"
report.resource_id = pricings["VirtualMachines"].resource_id
report.status_extended = f"Defender plan Defender for Servers from subscription {subscription} is set to ON (pricing tier standard)"
report.status_extended = f"Defender plan Defender for Servers from subscription {subscription} is set to ON (pricing tier standard)."
if pricings["VirtualMachines"].pricing_tier != "Standard":
report.status = "FAIL"
report.status_extended = f"Defender plan Defender for Servers from subscription {subscription} is set to OFF (pricing tier not standard)"
report.status_extended = f"Defender plan Defender for Servers from subscription {subscription} is set to OFF (pricing tier not standard)."

findings.append(report)
return findings
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ def execute(self) -> Check_Report_Azure:
report.subscription = subscription
report.resource_name = "Defender plan SQL Server VMs"
report.resource_id = pricings["SqlServerVirtualMachines"].resource_id
report.status_extended = f"Defender plan Defender for SQL Server VMs from subscription {subscription} is set to ON (pricing tier standard)"
report.status_extended = f"Defender plan Defender for SQL Server VMs from subscription {subscription} is set to ON (pricing tier standard)."
if pricings["SqlServerVirtualMachines"].pricing_tier != "Standard":
report.status = "FAIL"
report.status_extended = f"Defender plan Defender for SQL Server VMs from subscription {subscription} is set to OFF (pricing tier not standard)"
report.status_extended = f"Defender plan Defender for SQL Server VMs from subscription {subscription} is set to OFF (pricing tier not standard)."

findings.append(report)
return findings
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ def execute(self) -> Check_Report_Azure:
report.subscription = subscription
report.resource_name = "Defender plan Storage Accounts"
report.resource_id = pricings["StorageAccounts"].resource_id
report.status_extended = f"Defender plan Defender for Storage Accounts from subscription {subscription} is set to ON (pricing tier standard)"
report.status_extended = f"Defender plan Defender for Storage Accounts from subscription {subscription} is set to ON (pricing tier standard)."
if pricings["StorageAccounts"].pricing_tier != "Standard":
report.status = "FAIL"
report.status_extended = f"Defender plan Defender for Storage Accounts from subscription {subscription} is set to OFF (pricing tier not standard)"
report.status_extended = f"Defender plan Defender for Storage Accounts from subscription {subscription} is set to OFF (pricing tier not standard)."

findings.append(report)
return findings
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ def execute(self) -> Check_Report_Azure:
report.resource_id = role.id
report.resource_name = role.name
report.status = "PASS"
report.status_extended = f"Role {role.name} from subscription {subscription} is not a custom owner role"
report.status_extended = f"Role {role.name} from subscription {subscription} is not a custom owner role."
for scope in role.assignable_scopes:
if search("^/.*", scope):
for permission_item in role.permissions:
for action in permission_item.actions:
if action == "*":
report.status = "FAIL"
report.status_extended = f"Role {role.name} from subscription {subscription} is a custom owner role"
report.status_extended = f"Role {role.name} from subscription {subscription} is a custom owner role."
break

findings.append(report)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ def execute(self) -> Check_Report_Azure:
report = Check_Report_Azure(self.metadata())
report.subscription = subscription
report.status = "PASS"
report.status_extended = f"SQL Server {sql_server.name} from subscription {subscription} has a auditing policy configured"
report.status_extended = f"SQL Server {sql_server.name} from subscription {subscription} has a auditing policy configured."
report.resource_name = sql_server.name
report.resource_id = sql_server.id

for auditing_policy in sql_server.auditing_policies:
if auditing_policy.state == "Disabled":
report.status = "FAIL"
report.status_extended = f"SQL Server {sql_server.name} from subscription {subscription} does not have any auditing policy configured"
report.status_extended = f"SQL Server {sql_server.name} from subscription {subscription} does not have any auditing policy configured."
break

findings.append(report)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def execute(self) -> Check_Report_Azure:
report = Check_Report_Azure(self.metadata())
report.subscription = subscription
report.status = "PASS"
report.status_extended = f"SQL Server {sql_server.name} from subscription {subscription} has an Active Directory administrator"
report.status_extended = f"SQL Server {sql_server.name} from subscription {subscription} has an Active Directory administrator."
report.resource_name = sql_server.name
report.resource_id = sql_server.id

Expand All @@ -19,7 +19,7 @@ def execute(self) -> Check_Report_Azure:
or sql_server.administrators.administrator_type != "ActiveDirectory"
):
report.status = "FAIL"
report.status_extended = f"SQL Server {sql_server.name} from subscription {subscription} does not have an Active Directory administrator"
report.status_extended = f"SQL Server {sql_server.name} from subscription {subscription} does not have an Active Directory administrator."

findings.append(report)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def execute(self) -> Check_Report_Azure:
report = Check_Report_Azure(self.metadata())
report.subscription = subscription
report.status = "PASS"
report.status_extended = f"SQL Server {sql_server.name} from subscription {subscription} does not have firewall rules allowing 0.0.0.0-255.255.255.255"
report.status_extended = f"SQL Server {sql_server.name} from subscription {subscription} does not have firewall rules allowing 0.0.0.0-255.255.255.255."
report.resource_name = sql_server.name
report.resource_id = sql_server.id

Expand All @@ -20,7 +20,7 @@ def execute(self) -> Check_Report_Azure:
and firewall_rule.end_ip_address == "255.255.255.255"
):
report.status = "FAIL"
report.status_extended = f"SQL Server {sql_server.name} from subscription {subscription} has firewall rules allowing 0.0.0.0-255.255.255.255"
report.status_extended = f"SQL Server {sql_server.name} from subscription {subscription} has firewall rules allowing 0.0.0.0-255.255.255.255."
break

findings.append(report)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ def execute(self) -> Check_Report_Azure:
report = Check_Report_Azure(self.metadata())
report.subscription = subscription
report.status = "FAIL"
report.status_extended = f"Storage account {storage_account.name} from subscription {subscription} has allow blob public access enabled"
report.status_extended = f"Storage account {storage_account.name} from subscription {subscription} has allow blob public access enabled."
report.resource_name = storage_account.name
report.resource_id = storage_account.id
if not storage_account.allow_blob_public_access:
report.status = "PASS"
report.status_extended = f"Storage account {storage_account.name} from subscription {subscription} has allow blob public access disabled"
report.status_extended = f"Storage account {storage_account.name} from subscription {subscription} has allow blob public access disabled."

findings.append(report)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ def execute(self) -> Check_Report_Azure:
report = Check_Report_Azure(self.metadata())
report.subscription = subscription
report.status = "PASS"
report.status_extended = f"Storage account {storage_account.name} from subscription {subscription} has network access rule set to Deny"
report.status_extended = f"Storage account {storage_account.name} from subscription {subscription} has network access rule set to Deny."
report.resource_name = storage_account.name
report.resource_id = storage_account.id
if storage_account.network_rule_set.default_action == "Allow":
report.status = "FAIL"
report.status_extended = f"Storage account {storage_account.name} from subscription {subscription} has network access rule set to Allow"
report.status_extended = f"Storage account {storage_account.name} from subscription {subscription} has network access rule set to Allow."

findings.append(report)

Expand Down
Loading