• Published
  • Reading time13 min
  • Sections11
  • Byheap.page

Who must be unable to read the workload?

A sandbox review needs a named adversary. “Another container,” “the host kernel” and “the administrator controlling the parent instance” describe different trust boundaries. They require different mechanisms. CPU and memory limits contain resource consumption; a dedicated guest kernel contains a class of shared-kernel attacks; attestation can make sensitive key release conditional on the measured workload.

ECS Managed Instances now expose shared, isolated sandbox and confidential sandbox execution modes. These modes target ECS Managed Instances. They are not a flag you can add to an ECS Fargate task. Fargate remains a separate compute option with its own task isolation model. Verify current Region, instance and feature support before choosing a capacity provider.

Consider a service processing customer documents in an untrusted parser. First decide whether you trust the instance operator. If you do, isolation from other tasks may be enough. If the operator must not obtain plaintext from writable storage or a workload key, confidential execution and an externally enforced key-release policy become part of the design. Neither choice removes application authorization or makes a malicious parser safe to receive unrelated documents.

Three modes, three trust statements

Compare the boundary, not just the mode’s name.
ModeKernel & parentRemaining responsibility
SHAREDTasks share the host Linux kernel.Trust the host boundary; container configuration and least privilege still matter.
ISOLATED_SANDBOXA dedicated VM and kernel per task. The parent remains trusted.The parent can still use ECS Exec and read or modify writable storage. Do not claim operator confidentiality.
CONFIDENTIAL_SANDBOXA dedicated VM with the parent treated as untrusted; writable storage is encrypted.Constrain workload admission and bind KMS key release to verified attestation measurements.

The sandbox contains an untrusted container image, not an untrusted task definition. A caller allowed to replace the task definition may change its role, environment, command, logging and data destinations. Restrict RegisterTaskDefinition, RunTask, task overrides and iam:PassRole to the reviewed deployment path. Give tenants a narrow job API instead of letting them submit arbitrary ECS configuration.

Isolation is also not data authorization. If two customers’ documents are passed into one task, neither a VM nor an attestation report separates them inside that task. Assign the smallest useful workload identity and deliver only the current job’s authorized inputs.

Admission policy and observed execution answer different questions

The task definition’s trustedExecutionConfiguration selects the intended isolation mode. Confidential mode also requires an attestationPolicy: a base64-encoded policy envelope in AWS’s defined format. It is neither an IAM policy nor a KMS key-policy document. Its job is to describe the permitted sandbox configuration and its enforcement, while the KMS policy controls a protected key operation.

These modes require an ECS Managed Instances capacity provider with the documented Nitro prerequisites. They are not supported by the Fargate launch type or the ordinary EC2 launch type. Review Region, instance, networking and feature compatibility before treating a setting in a generated task definition as deployable.

Admission is about what a caller may request. Observation is about what ran. Inspect the running task’s trustedExecutionSummary for the actual isolation mode and attestation result, correlate it with the reviewed image and task revision, then prove the protected key path with both accepted and rejected measurements. A RUNNING state alone cannot establish that altered code is denied access to the key.

Keep tenant input below this boundary: a job’s authorized data and bounded parameters, not its role, image, log destination or arbitrary container command. An untrusted task definition can move sensitive data into a parent-visible field before confidential execution ever protects it.

Attestation turns a measurement into a key-release decision

Measure the workloadSign the attestationVerify accepted measurementsAllow the protected key operation

The sandbox agent measures the workload and configuration into platform configuration registers (PCRs). The Nitro Security Module produces a signed attestation document. A verifier can check that document and use its measurements in a key-release decision. A measurement printed in an application log is only an observation; it cannot stop an unauthorized principal from using a broadly accessible KMS key.

  1. Define accepted measurements. Pin the reviewed workload and policy. Decide which changes require a new approval, including image updates and configuration changes.
  2. Constrain the key operation. Configure the KMS key policy and relevant identity policies so the intended decrypt or key-release path requires the documented attestation conditions. Look for alternative principals, grants and policy paths that could release the same material without those conditions.
  3. Deliver only ciphertext before verification. Do not place a plaintext workload key in an environment variable, task override or parent-visible file. That would bypass the boundary you are trying to establish.
  4. Test a mismatched measurement. Change a fixture image or configuration without updating the allowed measurements. The key operation must fail even if the task launches successfully.

The attestation policy also controls admission and configuration inside the sandbox, including operator execution, log streaming, instance metadata and task credentials. The sandbox agent enforces those controls against the parent. Review logs as an explicit data exit: an admitted application can still print sensitive plaintext if its logging policy allows it.

Plan image rollouts and rollback together with key policy changes. A routine image digest change can alter measurements and break decrypt. During a controlled transition, authorize only the measured versions you intend to support, observe the new version’s result, and retire the old authorization when rollback support ends. Avoid a wildcard that makes the rollout easy by accepting every measurement.

Isolation does not remove network dependencies

Sandbox tasks do not receive a public IP, even in a public subnet. The awslogs driver uses the task ENI to reach CloudWatch Logs. Provide the required private connectivity, such as an appropriate interface endpoint with private DNS and HTTPS access, or a deliberately reviewed NAT path. A created but empty log stream can mean the driver cannot reach the service; it does not establish that the application produced no errors.

Inventory every bootstrap dependency: image retrieval, logging, the attestation/KMS path and the application’s input/output services. Test DNS, routes, security groups, endpoint policies and identity policies independently. A private subnet plus a default NAT route still permits internet egress unless other controls restrict it.

Check feature exclusions before migrating an existing service. These sandbox modes do not support GPU/Neuron workloads, GPU sharing, FireLens, S3 Files or deployment-configured volumes. Confidential mode also excludes EFS and trace/metric collection. Replacing an unsupported telemetry path with plaintext application logging may create a new disclosure path; choose what may leave the sandbox before wiring the replacement.

Operational ownership remains necessary: bound task concurrency, runtime, output and retention. Keep a trusted external ledger so a workload cannot extend its own expiry. Confirm task termination and external-data cleanup separately. Attestation controls a trust decision; it is not a scheduler, a spending cap or a deletion mechanism.

Failure cases to prove

Use synthetic documents and test keys in a bounded test environment.
AttemptExpected evidence
Run a changed imageKMS rejects the protected key operation when measurements do not match the approved policy.
Use another principal or KMS grantNo alternative policy path releases the same protected key material without the intended conditions.
Change task role or commandThe tenant-facing API rejects arbitrary task definitions and overrides before the ECS call.
Remove the Logs endpoint pathThe test detects missing log delivery separately from task state; an empty stream is not reported as success.
Read another job’s inputApplication and storage authorization deny the unrelated object even from a valid sandbox.
Crash the controller at expiryAn independent reconciler stops the task; protected external data follows its own retention policy.

Retain the task ARN, task-definition revision, image digest, observed isolation mode, attestation result and a redacted key-operation result for each case. Record expected denials as successful negative tests. Investigate unexpected denials by caller, action and resource; adding broad permissions to quiet an error would invalidate the boundary being tested.

Worked example: releasing one customer’s document key

Suppose a document-analysis service must protect plaintext from an operator who controls the parent instance. The customer encrypts the document with a data key. A confidential workload requests that key only after producing attestation evidence accepted by a trusted verifier and the configured key-release policy. The essential question is not whether the task definition contains a confidential-mode setting. It is whether an unapproved workload can obtain the same plaintext key through another path.

Follow the key from storage to use. Restrict the approved measured workload, the intended key and the context in which the request is authorized. The attestation evidence must be validated according to the current service protocol; merely logging a measurement string is not verification. If an ordinary parent-side role can decrypt the same key without the attestation condition, the confidential execution path does not achieve the stated protection. Audit every principal and alternate decrypt route that can reach the key.

Now change the parser image. A digest change can alter the expected measurement, so a secure rollout needs a reviewed policy update rather than a wildcard that accepts any new image. Decide whether the old approved measurement remains valid during rollback, how long overlap lasts and who can authorize it. Test both the intended new image and an intentionally unapproved image with synthetic ciphertext. A successful approved decrypt without the corresponding denied case leaves the admission boundary untested.

Finally, inspect output. An approved but malicious parser can emit plaintext through a result, log or reachable service after receiving the key. Attestation establishes evidence about the environment and code identity under a verification policy; it does not prove the code’s business logic is safe. Give each job only its authorized document and bound the output channel. This original example explains the key-release reasoning; it is not a deployed attestation implementation or a claim that any particular measurement format is stable.

Isolation and confidentiality point in different directions

Ordinary workload isolation primarily protects the host and neighboring workloads from the guest. Confidential processing adds a different requirement: protect selected guest data from parts of the surrounding operator environment. Stronger isolation in the first direction does not establish the second. Naming the adversary makes this distinction actionable. A service that trusts its infrastructure operators but runs hostile parsers may need a different design from a service contractually required to keep document keys unavailable to those operators.

The VEE study of Firecracker and gVisor provides useful mechanism vocabulary: a guest-kernel and virtualization boundary differs from a userspace-kernel approach that mediates application system calls. Its 2020 measurements are not current performance claims or a universal security ranking. A benchmark of a specific implementation cannot prove every future workload safe. Use the paper to identify which interface is exposed, then evaluate the current managed service and the workload’s actual compatibility requirements.

The operation-forwarding research from USENIX supplies a second caution. A compact virtual machine monitor can still rely on surrounding host components that process guest requests. The cited study concerns an older, specific experimental stack, not managed Fargate or a demonstrated flaw in current ECS confidential execution. Its architectural lesson is that storage, device and lifecycle bridges belong in the trusted computing base. A diagram should include those bridges rather than drawing a reassuring rectangle around only the guest.

Managed-service boundaries also differ from software you install yourself. AWS owns parts of the Fargate runtime implementation; your application owns task admission, identity and job data. ECS Managed Instances’ sandbox execution modes are a separate product surface with explicit prerequisites. Do not migrate a Fargate task merely by adding a field copied from a Managed Instances example. Check the supported compute path, execution mode, Region and operational restrictions against current documentation before making a customer-facing confidentiality claim.

Operate the policy as carefully as the workload

A measurement allowlist is production authorization state. Changes need a reviewed artifact identity, a reason, expected lifetime and a recovery path. Avoid a break-glass procedure that grants the parent environment unrestricted decrypt access; that changes the trust promise precisely when the service is under pressure. If emergency access is part of the product, describe and audit it explicitly instead of presenting the design as excluding all operator access.

Availability failures need separate treatment from confidentiality failures. A key request can fail because attestation verification rejected the workload, the key policy denied it, the service endpoint was unreachable or a dependency was throttled. Record the stage and a redacted reason. An automatic fallback to a non-confidential mode might restore processing while violating the customer’s requirement. Fail closed for jobs that require the stronger mode, and let any weaker mode be an explicit, separately authorized product choice.

Retention remains a business decision. The encrypted input, wrapped keys, output objects and logs can outlive the task. Decide which material is retained for retry and which is deleted after acceptance. Deleting a task is not deleting its external data, and deleting one ciphertext object does not prove no copy exists in logs or outputs. Use synthetic data to test the complete lifecycle and retain the evidence needed to explain approved release, denied release and final cleanup.

Independent engineering & research

Original analysis by heap.page, informed by the references below. Historical research and vendor accounts are identified explicitly; current AWS behavior is checked against the service documentation.

Official sources & further study

Reviewed November 16, 2026. Check current support and the complete policy format before implementation.

Continue: Fargate isolation and lifecycle recovery →

Prepaid · USD

Top up balance

Available balance: $0.00

Your balance works across Heap tools. A failed lookup or generation releases its reserved amount.