mirror of
https://github.com/prowler-cloud/prowler.git
synced 2025-12-19 05:17:47 +00:00
Co-authored-by: Pepe Fagoaga <pepe@prowler.com> Co-authored-by: Adrián Jesús Peña Rodríguez <adrianjpr@gmail.com>
55 lines
1.4 KiB
HCL
55 lines
1.4 KiB
HCL
# S3 Integration Policy
|
|
###################################
|
|
resource "aws_iam_role_policy" "prowler_s3_integration" {
|
|
name = "ProwlerS3Integration"
|
|
role = var.prowler_role_name
|
|
|
|
policy = jsonencode({
|
|
Version = "2012-10-17"
|
|
Statement = [
|
|
{
|
|
Effect = "Allow"
|
|
Action = [
|
|
"s3:DeleteObject"
|
|
]
|
|
Resource = [
|
|
"arn:${data.aws_partition.current.partition}:s3:::${var.s3_integration_bucket_name}/*test-prowler-connection.txt"
|
|
]
|
|
Condition = {
|
|
StringEquals = {
|
|
"s3:ResourceAccount" = var.s3_integration_bucket_account_id
|
|
}
|
|
}
|
|
},
|
|
{
|
|
Effect = "Allow"
|
|
Action = [
|
|
"s3:PutObject"
|
|
]
|
|
Resource = [
|
|
"arn:${data.aws_partition.current.partition}:s3:::${var.s3_integration_bucket_name}/*"
|
|
]
|
|
Condition = {
|
|
StringEquals = {
|
|
"s3:ResourceAccount" = var.s3_integration_bucket_account_id
|
|
}
|
|
}
|
|
},
|
|
{
|
|
Effect = "Allow"
|
|
Action = [
|
|
"s3:ListBucket"
|
|
]
|
|
Resource = [
|
|
"arn:${data.aws_partition.current.partition}:s3:::${var.s3_integration_bucket_name}"
|
|
]
|
|
Condition = {
|
|
StringEquals = {
|
|
"s3:ResourceAccount" = var.s3_integration_bucket_account_id
|
|
}
|
|
}
|
|
}
|
|
]
|
|
})
|
|
}
|