diff --git a/prowler/lib/check/models.py b/prowler/lib/check/models.py index d0dab6ca59..a56ad9efc6 100644 --- a/prowler/lib/check/models.py +++ b/prowler/lib/check/models.py @@ -622,6 +622,10 @@ class CheckReportIAC(Check_Report): guideline: str resource: str severity: str + # TODO: comparing with the others, are all the above are necesary? review + resource_name: str + resource_id: str + location: str def __init__(self, metadata: dict = {}, finding: dict = {}) -> None: """ @@ -642,6 +646,10 @@ class CheckReportIAC(Check_Report): self.guideline = finding.get("guideline", "") self.resource = finding self.severity = finding.get("severity", "UNKNOWN") + # TODO: same question above + self.resource_name = getattr(finding, "resource", "") + self.resource_path = getattr(finding, "file_path", "") + self.resource_line_range = getattr(finding, "file_line_range", "") @dataclass diff --git a/prowler/lib/outputs/finding.py b/prowler/lib/outputs/finding.py index 2df79a954a..72cc6cd752 100644 --- a/prowler/lib/outputs/finding.py +++ b/prowler/lib/outputs/finding.py @@ -283,12 +283,21 @@ class Finding(BaseModel): output_data["region"] = check_output.location elif provider.type == "iac": - output_data["auth_method"] = "iac" + output_data["auth_method"] = "local" # Until we support remote repos output_data["account_uid"] = "iac" output_data["account_name"] = "iac" - output_data["resource_name"] = check_output.check_name - output_data["resource_uid"] = check_output.check_id - output_data["region"] = check_output.file_path + output_data["resource_name"] = check_output.resource_name + output_data["resource_uid"] = ( + check_output.check_id + ) # TODO: is this mandatory? + output_data["region"] = ( + check_output.file_path + ) # TODO: is this mandatory? + output_data["resource_path"] = check_output.resource_path + output_data["resource_line_range"] = check_output.resource_line_range + output_data["framework"] = ( + check_output.check_metadata.ServiceName + ) # TODO: can we get the framework from the check_output? # check_output Unique ID # TODO: move this to a function