---
title: >-
  Bedrock batch inference and model customization jobs should run in private
  subnets with no public egress
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Datadog Security > OOTB Rules > Bedrock batch inference and model
  customization jobs should run in private subnets with no public egress
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Bedrock batch inference and model customization jobs should run in private subnets with no public egress
 
## Description{% #description %}

Amazon Bedrock batch inference (model invocation) jobs and model customization jobs (fine-tuning, continued pre-training, and distillation) read and write data in Amazon S3, so they should run in private subnets with no public egress. This rule produces one finding per AWS account and fails when any job that has not finished lacks a VPC configuration, nonblank subnet and security-group IDs, or uses a subnet whose route table has an active default route (`0.0.0.0/0` or `::/0`) to an internet gateway, NAT gateway, or egress-only internet gateway. CIS names only internet and NAT gateways; egress-only internet gateways are included because they give a subnet outbound IPv6 internet access. Every non-blackhole route must have a nonblank schema-supported destination and target, and any other destination or target field it reports must also be nonblank, while blackhole routes do not require an active target. Default routes to a transit gateway, peering connection, or network interface such as a NAT instance, and split routes such as `0.0.0.0/1` with `128.0.0.0/1`, are not flagged. A job belongs to its account ID, or to the account in its ARN when the account ID is missing or blank, and it fails unless the two agree. Route tables are matched within the job's Region and the subnet owner account recorded on the job account's own subnet record (the job's account when no subnet record is collected, and a failure when a collected record has no owner, has conflicting valid owners, or when a same-ID record has neither a valid account ID nor Region, has the job's Region but no account ID, or has the job account but no Region), so for a shared VPC subnet only the owner account's route tables count, and a subnet or route table with the same ID in another account is ignored. A subnet without an active (`associating` or `associated`) explicit route table association uses the main route table of the one usable VPC established by every scoped subnet row, looked up in the owner account; conflicting, missing, or blank VPC identities fail. Explicit associations with missing or unknown states fail. On the main-table fallback path, every same-scope main association must have a known state; known inactive rows are ignored, while missing or unknown states fail. A subnet also fails when no collected route table applies or an applicable table has a missing or empty routes array. An account with a missing, empty, or whitespace-only account ID fails, and accounts without running jobs are skipped, where batch inference jobs in `Completed`, `PartiallyCompleted`, `Failed`, `Stopped`, or `Expired` and customization jobs in `Completed`, `Failed`, or `Stopped` are treated as finished; a job with no status is evaluated. The CIS control also covers custom model import jobs, which are not collected and are not evaluated by this rule.

## Remediation{% #remediation %}

In the affected account, identify jobs that do not meet these network requirements. A job's VPC configuration can only be set at creation time, so for each affected job:

1. Prepare isolated private subnets with a VPC endpoint for Amazon S3.
1. Resubmit the job with a VPC configuration that uses those subnets and a security group, as described in [Protect batch inference jobs using a VPC](https://docs.aws.amazon.com/bedrock/latest/userguide/batch-vpc.html) or [Model customization access and security](https://docs.aws.amazon.com/bedrock/latest/userguide/custom-model-job-access-security.html).

## References{% #references %}

- [Protect batch inference jobs using a VPC](https://docs.aws.amazon.com/bedrock/latest/userguide/batch-vpc.html)
- [Model customization access and security](https://docs.aws.amazon.com/bedrock/latest/userguide/custom-model-job-access-security.html)
- [CIS Amazon Web Services Benchmarks](https://www.cisecurity.org/benchmark/amazon_web_services)
