mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-01-25 02:08:11 +00:00
fix(azure): remove resource_name inside the Check_Report (#7420)
(cherry picked from commit e4d234fe03)
# Conflicts:
# prowler/providers/azure/services/defender/defender_ensure_defender_for_databases_is_on/defender_ensure_defender_for_databases_is_on.py
# prowler/providers/gcp/services/compute/compute_project_os_login_enabled/compute_project_os_login_enabled.py
# prowler/providers/gcp/services/iam/iam_audit_logs_enabled/iam_audit_logs_enabled.py
# tests/providers/gcp/services/compute/compute_project_os_login_enabled/compute_project_os_login_enabled_test.py
# tests/providers/gcp/services/iam/iam_audit_logs_enabled/iam_audit_logs_enabled_test.py
This commit is contained in:
@@ -12,10 +12,17 @@ class defender_ensure_defender_for_databases_is_on(Check):
|
||||
and "OpenSourceRelationalDatabases" in pricings
|
||||
and "CosmosDbs" in pricings
|
||||
):
|
||||
<<<<<<< HEAD
|
||||
report = Check_Report_Azure(self.metadata())
|
||||
report.resource_name = "Defender plan Databases"
|
||||
report.subscription = subscription
|
||||
report.resource_id = pricings["SqlServers"].resource_id
|
||||
=======
|
||||
report = Check_Report_Azure(
|
||||
metadata=self.metadata(), resource=pricings["SqlServers"]
|
||||
)
|
||||
report.subscription = subscription
|
||||
>>>>>>> e4d234fe0 (fix(azure): remove `resource_name` inside the `Check_Report` (#7420))
|
||||
report.status = "PASS"
|
||||
report.status_extended = f"Defender plan Defender for Databases from subscription {subscription} is set to ON (pricing tier standard)."
|
||||
if (
|
||||
|
||||
@@ -5,11 +5,21 @@ from prowler.providers.gcp.services.compute.compute_client import compute_client
|
||||
class compute_project_os_login_enabled(Check):
|
||||
def execute(self) -> Check_Report_GCP:
|
||||
findings = []
|
||||
<<<<<<< HEAD
|
||||
for project in compute_client.projects:
|
||||
report = Check_Report_GCP(self.metadata())
|
||||
report.project_id = project.id
|
||||
report.resource_id = project.id
|
||||
report.location = "global"
|
||||
=======
|
||||
for project in compute_client.compute_projects:
|
||||
report = Check_Report_GCP(
|
||||
metadata=self.metadata(),
|
||||
resource=compute_client.projects[project.id],
|
||||
project_id=project.id,
|
||||
location=compute_client.region,
|
||||
)
|
||||
>>>>>>> e4d234fe0 (fix(azure): remove `resource_name` inside the `Check_Report` (#7420))
|
||||
report.status = "PASS"
|
||||
report.status_extended = f"Project {project.id} has OS Login enabled."
|
||||
if not project.enable_oslogin:
|
||||
|
||||
@@ -7,11 +7,21 @@ from prowler.providers.gcp.services.cloudresourcemanager.cloudresourcemanager_cl
|
||||
class iam_audit_logs_enabled(Check):
|
||||
def execute(self) -> Check_Report_GCP:
|
||||
findings = []
|
||||
<<<<<<< HEAD
|
||||
for project in cloudresourcemanager_client.projects:
|
||||
report = Check_Report_GCP(self.metadata())
|
||||
report.project_id = project.id
|
||||
report.location = cloudresourcemanager_client.region
|
||||
report.resource_id = project.id
|
||||
=======
|
||||
for project in cloudresourcemanager_client.cloud_resource_manager_projects:
|
||||
report = Check_Report_GCP(
|
||||
metadata=self.metadata(),
|
||||
resource=cloudresourcemanager_client.projects[project.id],
|
||||
project_id=project.id,
|
||||
location=cloudresourcemanager_client.region,
|
||||
)
|
||||
>>>>>>> e4d234fe0 (fix(azure): remove `resource_name` inside the `Check_Report` (#7420))
|
||||
report.status = "PASS"
|
||||
report.status_extended = f"Audit Logs are enabled for project {project.id}."
|
||||
if not project.audit_logging:
|
||||
|
||||
@@ -188,7 +188,7 @@ class Test_defender_ensure_defender_for_databases_is_on:
|
||||
== f"Defender plan Defender for Databases from subscription {AZURE_SUBSCRIPTION_ID} is set to ON (pricing tier standard)."
|
||||
)
|
||||
assert result[0].subscription == AZURE_SUBSCRIPTION_ID
|
||||
assert result[0].resource_name == "Defender plan Databases"
|
||||
assert result[0].resource_name == "Defender plan Servers"
|
||||
assert result[0].resource_id == resource_id
|
||||
|
||||
def test_defender_databases_cosmosdb_not_standard(self):
|
||||
@@ -239,5 +239,5 @@ class Test_defender_ensure_defender_for_databases_is_on:
|
||||
== f"Defender plan Defender for Databases from subscription {AZURE_SUBSCRIPTION_ID} is set to OFF (pricing tier not standard)."
|
||||
)
|
||||
assert result[0].subscription == AZURE_SUBSCRIPTION_ID
|
||||
assert result[0].resource_name == "Defender plan Databases"
|
||||
assert result[0].resource_name == "Defender plan Servers"
|
||||
assert result[0].resource_id == resource_id
|
||||
|
||||
@@ -58,6 +58,10 @@ class Test_compute_project_os_login_enabled:
|
||||
result[0].status_extended,
|
||||
)
|
||||
assert result[0].resource_id == project.id
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
assert result[0].resource_name == "test"
|
||||
>>>>>>> e4d234fe0 (fix(azure): remove `resource_name` inside the `Check_Report` (#7420))
|
||||
assert result[0].location == "global"
|
||||
assert result[0].project_id == GCP_PROJECT_ID
|
||||
|
||||
@@ -94,5 +98,9 @@ class Test_compute_project_os_login_enabled:
|
||||
result[0].status_extended,
|
||||
)
|
||||
assert result[0].resource_id == project.id
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
assert result[0].resource_name == "test"
|
||||
>>>>>>> e4d234fe0 (fix(azure): remove `resource_name` inside the `Check_Report` (#7420))
|
||||
assert result[0].location == "global"
|
||||
assert result[0].project_id == GCP_PROJECT_ID
|
||||
|
||||
@@ -60,6 +60,10 @@ class Test_iam_audit_logs_enabled:
|
||||
r.status_extended,
|
||||
)
|
||||
assert r.resource_id == GCP_PROJECT_ID
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
assert r.resource_name == "test"
|
||||
>>>>>>> e4d234fe0 (fix(azure): remove `resource_name` inside the `Check_Report` (#7420))
|
||||
assert r.project_id == GCP_PROJECT_ID
|
||||
assert r.location == cloudresourcemanager_client.region
|
||||
|
||||
@@ -97,5 +101,9 @@ class Test_iam_audit_logs_enabled:
|
||||
r.status_extended,
|
||||
)
|
||||
assert r.resource_id == GCP_PROJECT_ID
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
assert r.resource_name == "test"
|
||||
>>>>>>> e4d234fe0 (fix(azure): remove `resource_name` inside the `Check_Report` (#7420))
|
||||
assert r.project_id == GCP_PROJECT_ID
|
||||
assert r.location == cloudresourcemanager_client.region
|
||||
|
||||
Reference in New Issue
Block a user