mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-10-13 15:04:19 +00:00
feat(s3): support threatscore reporting
This commit is contained in:
1 parent
699bcb2f13
commit
8eebde895b
1 file changed
+6
-1
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user