Compare commits

...

3 Commits

Author SHA1 Message Date
pedrooot
bc736bafe6 feat(api): revert wrong changes 2025-10-22 11:16:59 -04:00
pedrooot
8eebde895b feat(s3): support threatscore reporting 2025-10-22 11:09:20 -04:00
pedrooot
699bcb2f13 fix(s3): support threatscore upload 2025-10-22 11:00:53 -04:00

View File

@@ -20,10 +20,10 @@ from prowler.lib.outputs.asff.asff import ASFF
from prowler.lib.outputs.compliance.aws_well_architected.aws_well_architected import (
AWSWellArchitected,
)
from prowler.lib.outputs.compliance.c5.c5_aws import AWSC5
from prowler.lib.outputs.compliance.ccc.ccc_aws import CCC_AWS
from prowler.lib.outputs.compliance.ccc.ccc_azure import CCC_Azure
from prowler.lib.outputs.compliance.ccc.ccc_gcp import CCC_GCP
from prowler.lib.outputs.compliance.c5.c5_aws import AWSC5
from prowler.lib.outputs.compliance.cis.cis_aws import AWSCIS
from prowler.lib.outputs.compliance.cis.cis_azure import AzureCIS
from prowler.lib.outputs.compliance.cis.cis_gcp import GCPCIS
@@ -206,7 +206,12 @@ def _upload_to_s3(tenant_id: str, zip_path: str, scan_id: str) -> str | None:
s3 = get_s3_client()
# Upload the ZIP file (outputs) to the S3 bucket
zip_key = f"{tenant_id}/{scan_id}/{os.path.basename(zip_path)}"
# Preserve directory structure for threatscore and compliance subdirectories
zip_dir = os.path.basename(os.path.dirname(zip_path))
if zip_dir in ("threatscore", "compliance"):
zip_key = f"{tenant_id}/{scan_id}/{zip_dir}/{os.path.basename(zip_path)}"
else:
zip_key = f"{tenant_id}/{scan_id}/{os.path.basename(zip_path)}"
s3.upload_file(
Filename=zip_path,
Bucket=bucket,