Back to Checks
ECS Task Definitions with EFS volumes should use in-transit encryption
AWS-0035
Service: ecsSeverity: high
OfficialBuilt-inVerified
ECS task definitions that have volumes using EFS configuration should explicitly enable in transit encryption to prevent the risk of data loss due to interception.
Run this check with Prowler
Run in Prowler CloudRun
prowler iac --checks AWS-0035Recommendation
Enable in transit encryption when using efs
Check Code
# METADATA
# title: ECS Task Definitions with EFS volumes should use in-transit encryption
# description: |
# ECS task definitions that have volumes using EFS configuration should explicitly enable in transit encryption to prevent the risk of data loss due to interception.
# scope: package
# schemas:
# - input: schema["cloud"]
# related_resources:
# - https://docs.aws.amazon.com/AmazonECS/latest/userguide/efs-volumes.html
# - https://docs.aws.amazon.com/efs/latest/ug/encryption-in-transit.html
# custom:
# id: AWS-0035
# long_id: aws-ecs-enable-in-transit-encryption
# aliases:
# - AVD-AWS-0035
# - enable-in-transit-encryption
# - aws-ecs-enable-in-transit-encryption
# provider: aws
# service: ecs
# severity: HIGH
# recommended_action: Enable in transit encryption when using efs
# input:
# selector:
# - type: cloud
# subtypes:
# - service: ecs
# provider: aws
# examples: checks/cloud/aws/ecs/enable_in_transit_encryption.yaml
package builtin.aws.ecs.aws0035
import rego.v1
import data.lib.cloud.metadata
deny contains res if {
some task_definition in input.aws.ecs.taskdefinitions
some volume in task_definition.volumes
not volume.efsvolumeconfiguration.transitencryptionenabled.value
res := result.new(
"Task definition includes a volume which does not have in-transit-encryption enabled.",
metadata.obj_by_path(volume, ["efsvolumeconfiguration", "transitencryptionenabled"]),
)
}