mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-24 04:51:51 +00:00
chore: rename Check_Report to CheckReport
This commit is contained in:
@@ -399,7 +399,7 @@ class Check(ABC, CheckMetadata):
|
||||
|
||||
|
||||
@dataclass
|
||||
class Check_Report:
|
||||
class CheckReport:
|
||||
"""Contains the Check's finding information."""
|
||||
|
||||
status: str
|
||||
@@ -440,7 +440,7 @@ class Check_Report:
|
||||
|
||||
|
||||
@dataclass
|
||||
class Check_Report_AWS(Check_Report):
|
||||
class Check_Report_AWS(CheckReport):
|
||||
"""
|
||||
Contains the AWS Check's finding information.
|
||||
|
||||
@@ -470,7 +470,7 @@ class Check_Report_AWS(Check_Report):
|
||||
|
||||
|
||||
@dataclass
|
||||
class Check_Report_Azure(Check_Report):
|
||||
class Check_Report_Azure(CheckReport):
|
||||
"""Contains the Azure Check's finding information."""
|
||||
|
||||
resource_name: str
|
||||
@@ -502,7 +502,7 @@ class Check_Report_Azure(Check_Report):
|
||||
|
||||
|
||||
@dataclass
|
||||
class Check_Report_GCP(Check_Report):
|
||||
class Check_Report_GCP(CheckReport):
|
||||
"""Contains the GCP Check's finding information."""
|
||||
|
||||
resource_name: str
|
||||
@@ -537,7 +537,7 @@ class Check_Report_GCP(Check_Report):
|
||||
|
||||
|
||||
@dataclass
|
||||
class Check_Report_Kubernetes(Check_Report):
|
||||
class Check_Report_Kubernetes(CheckReport):
|
||||
# TODO change class name to CheckReportKubernetes
|
||||
"""Contains the Kubernetes Check's finding information."""
|
||||
|
||||
@@ -557,7 +557,7 @@ class Check_Report_Kubernetes(Check_Report):
|
||||
|
||||
|
||||
@dataclass
|
||||
class Check_Report_Microsoft365(Check_Report):
|
||||
class Check_Report_Microsoft365(CheckReport):
|
||||
"""Contains the Microsoft365 Check's finding information."""
|
||||
|
||||
resource_name: str
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import sys
|
||||
|
||||
from prowler.lib.check.models import Check_Report
|
||||
from prowler.lib.check.models import CheckReport
|
||||
from prowler.lib.logger import logger
|
||||
from prowler.lib.outputs.compliance.cis.cis import get_cis_table
|
||||
from prowler.lib.outputs.compliance.ens.ens import get_ens_table
|
||||
@@ -90,7 +90,7 @@ def display_compliance_table(
|
||||
|
||||
# TODO: this should be in the Check class
|
||||
def get_check_compliance(
|
||||
finding: Check_Report, provider_type: str, bulk_checks_metadata: dict
|
||||
finding: CheckReport, provider_type: str, bulk_checks_metadata: dict
|
||||
) -> dict:
|
||||
"""get_check_compliance returns a map with the compliance framework as key and the requirements where the finding's check is present.
|
||||
|
||||
@@ -102,7 +102,7 @@ def get_check_compliance(
|
||||
}
|
||||
|
||||
Args:
|
||||
finding (Any): The Check_Report finding
|
||||
finding (Any): The CheckReport finding
|
||||
provider_type (str): The provider type
|
||||
bulk_checks_metadata (dict): The bulk checks metadata
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ from typing import Optional, Union
|
||||
from pydantic import BaseModel, Field, ValidationError
|
||||
|
||||
from prowler.config.config import prowler_version
|
||||
from prowler.lib.check.models import Check_Report, CheckMetadata
|
||||
from prowler.lib.check.models import CheckMetadata, CheckReport
|
||||
from prowler.lib.logger import logger
|
||||
from prowler.lib.outputs.common import Status, fill_common_finding_data
|
||||
from prowler.lib.outputs.compliance.compliance import get_check_compliance
|
||||
@@ -91,13 +91,13 @@ class Finding(BaseModel):
|
||||
|
||||
@classmethod
|
||||
def generate_output(
|
||||
cls, provider: Provider, check_output: Check_Report, output_options
|
||||
cls, provider: Provider, check_output: CheckReport, output_options
|
||||
) -> "Finding":
|
||||
"""Generates the output for a finding based on the provider and output options
|
||||
|
||||
Args:
|
||||
provider (Provider): the provider object
|
||||
check_output (Check_Report): the check output object
|
||||
check_output (CheckReport): the check output object
|
||||
output_options: the output options object, depending on the provider
|
||||
Returns:
|
||||
finding_output (Finding): the finding output object
|
||||
|
||||
@@ -3,10 +3,10 @@ from unittest import mock
|
||||
import pytest
|
||||
|
||||
from prowler.lib.check.models import (
|
||||
Check_Report,
|
||||
Check_Report_AWS,
|
||||
Check_Report_Azure,
|
||||
CheckMetadata,
|
||||
CheckReport,
|
||||
)
|
||||
from tests.lib.check.compliance_check_test import custom_compliance_metadata
|
||||
|
||||
@@ -335,7 +335,7 @@ class TestCheckMetada:
|
||||
class TestCheckReport:
|
||||
def test_check_report_resource_dict(self):
|
||||
resource = {"id": "test_id"}
|
||||
check_report = Check_Report(metadata=mock_metadata.json(), resource=resource)
|
||||
check_report = CheckReport(metadata=mock_metadata.json(), resource=resource)
|
||||
assert check_report.status == ""
|
||||
assert check_report.check_metadata == mock_metadata
|
||||
assert check_report.resource == resource
|
||||
@@ -347,7 +347,7 @@ class TestCheckReport:
|
||||
# def test_check_report_resource_dict_method(self):
|
||||
# resource = mock.Mock()
|
||||
# resource.dict = lambda: {"id": "test_id"}
|
||||
# check_report = Check_Report(metadata=mock_metadata.json(), resource=resource)
|
||||
# check_report = CheckReport(metadata=mock_metadata.json(), resource=resource)
|
||||
# assert check_report.status == ""
|
||||
# assert check_report.check_metadata == mock_metadata
|
||||
# assert check_report.resource == {"id": "test_id"}
|
||||
|
||||
@@ -6,7 +6,7 @@ from prowler.lib.check.compliance_models import (
|
||||
Compliance,
|
||||
Compliance_Requirement,
|
||||
)
|
||||
from prowler.lib.check.models import Check_Report, load_check_metadata
|
||||
from prowler.lib.check.models import CheckReport, load_check_metadata
|
||||
from prowler.lib.outputs.compliance.compliance import get_check_compliance
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ class TestCompliance:
|
||||
),
|
||||
]
|
||||
|
||||
finding = Check_Report(
|
||||
finding = CheckReport(
|
||||
metadata=load_check_metadata(
|
||||
f"{path.dirname(path.realpath(__file__))}/../fixtures/metadata.json"
|
||||
).json(),
|
||||
@@ -149,7 +149,7 @@ class TestCompliance:
|
||||
),
|
||||
]
|
||||
|
||||
finding = Check_Report(
|
||||
finding = CheckReport(
|
||||
metadata=load_check_metadata(
|
||||
f"{path.dirname(path.realpath(__file__))}/../fixtures/metadata.json"
|
||||
).json(),
|
||||
@@ -229,7 +229,7 @@ class TestCompliance:
|
||||
),
|
||||
]
|
||||
|
||||
finding = Check_Report(
|
||||
finding = CheckReport(
|
||||
metadata=load_check_metadata(
|
||||
f"{path.dirname(path.realpath(__file__))}/../fixtures/metadata.json"
|
||||
).json(),
|
||||
@@ -309,7 +309,7 @@ class TestCompliance:
|
||||
),
|
||||
]
|
||||
|
||||
finding = Check_Report(
|
||||
finding = CheckReport(
|
||||
metadata=load_check_metadata(
|
||||
f"{path.dirname(path.realpath(__file__))}/../fixtures/metadata.json"
|
||||
).json(),
|
||||
|
||||
Reference in New Issue
Block a user