SageMaker monitoring schedules should have network isolation enabled
Flags Amazon SageMaker monitoring schedules whose job definition, inline or named, has NetworkConfig.EnableNetworkIsolation disabled; without isolation the containers can reach external networks. A schedule naming a job definition the scan could not find or read also fails.
- service
- SageMaker
- severity
- Medium
- scope
- evaluated in every region
How to fix it
- Replaces the resource: A named job definition cannot be updated: create a corrected copy under a new name, repoint the schedule to it, then delete the old one; if updating an inline one is refused, recreate the schedule.
- Can break clients: The container gets no network access and no AWS credentials, so anything it fetches for itself stops; SageMaker's own S3 input and output transfers still work.
Settings
- NetworkConfig.
EnableNetworkIsolation - true, on the inline MonitoringJobDefinition or on the job definition the schedule names
With Terraform
resource "aws_sagemaker_monitoring_schedule" "this" {
monitoring_schedule_config {
monitoring_type = var.monitoring_type
monitoring_job_definition {
role_arn = var.role_arn
monitoring_app_specification {
image_uri = var.monitor_image_uri
}
monitoring_inputs {
endpoint_input {
endpoint_name = var.endpoint_name
local_path = var.input_local_path
}
}
monitoring_output_config {
monitoring_outputs {
s3_output {
local_path = var.output_local_path
s3_uri = var.report_s3_uri
}
}
}
monitoring_resources {
cluster_config {
instance_count = var.instance_count
instance_type = var.instance_type
volume_size_in_gb = var.volume_size_in_gb
}
}
network_config {
enable_network_isolation = true
}
}
}
}
See which of your accounts this check is failing on.
Book a live scan