mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-23 12:31:54 +00:00
Merge branch 'iac-poc' into PRWLR-7301-handle-iac-output
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user