AWS Batch on EKS finally lets jobs drop privileges and pass Pod Security Standards
A batch job is often the least privileged workload in a cluster and the one most likely to run as root. It reads a file, transforms it, writes a result, and exits. It does not need a shell, a network listener, or a writable root filesystem. Yet for years, teams running AWS Batch on Amazon EKS had to choose between enforcing the Kubernetes Pod Security Standards restricted profile and using Batch in the same cluster. The Batch job definition exposed only a subset of the Kubernetes security context, so a job that needed a non-root user, dropped capabilities, or a seccomp profile could not express those settings through the Batch API.
On November 13, 2026, AWS closed part of that gap. AWS Batch on EKS now supports additional Kubernetes security context settings in job definitions: Linux capabilities, seccomp profiles, and pod-level settings. AWS explicitly frames the change around clusters that enforce the restricted Pod Security Standards profile, saying customers can now run Batch jobs with only the privileges and system calls they require. The settings are available through the console, CLI, SDKs, and CloudFormation, in all regions where AWS Batch is available.
The change is not glamorous. It is a compliance feature, and compliance features are often the ones that decide whether a platform is usable in a regulated environment. But it also reflects a broader shift in Kubernetes security: the defaults are tightening, and abstraction layers that hide the underlying controls become liabilities.
The compliance gap
The Kubernetes Pod Security Standards define three profiles: privileged, baseline, and restricted. The restricted profile is the strictest. It requires, among other things, that containers run as non-root, that privilege escalation is disabled, that all Linux capabilities are dropped, that a seccomp profile is set to RuntimeDefault or Localhost, and that only restricted volume types are used. It also restricts host namespaces, host ports, and privileged containers.
Those requirements are deliberately blunt. They are designed to be enforceable across a cluster, not tuned per workload. A team that adopts the restricted profile is making a statement: every pod in this namespace meets a baseline of least privilege. Exceptions are possible through Pod Security Admission exemptions, but exemptions weaken the guarantee. The cleaner path is to make the workloads comply.
AWS Batch on EKS is an abstraction over Kubernetes. You define a job definition, and Batch creates pods in an EKS cluster. Before this change, the job definition exposed some security context fields, but not the full set needed for the restricted profile. The result was a familiar platform problem: the security team wants one policy, the batch team needs to run jobs, and the compromise is an exemption, a separate cluster, or a job that runs with more privilege than it needs.
The new fields address the most common gaps. Linux capabilities can be added or dropped. Seccomp profiles can be selected. Pod-level settings such as fsGroup can be applied to all containers in the pod. Container-level settings override pod-level defaults, which mirrors Kubernetes semantics. That is enough to express the restricted profile for many batch workloads, provided the image and the runtime cooperate.
What AWS added
The entry point is the RegisterJobDefinition API. At the container level, you can set capabilities and seccompProfile in a container’s securityContext. The capabilities object has add and drop arrays, with up to 64 values each, and capability names are specified without the CAP_ prefix. The container security context also includes privileged, readOnlyRootFilesystem, runAsGroup, runAsNonRoot, and runAsUser. The seccompProfile has a type and profile details, and the container profile overrides the pod profile.
At the pod level, you can set securityContext in podProperties for pod-wide settings. The What’s New post highlights fsGroup as the example. AWS’s API change notes for November 9 list a broader set of pod-level fields, including fsGroup, runAsUser, runAsGroup, runAsNonRoot, and seccompProfile. The exact set matters for infrastructure-as-code: check the current API reference and the provider version you use, because a field that exists in the API may not yet be exposed by your Terraform provider or CDK construct.
The precedence rule is the Kubernetes rule: pod-level settings are defaults, and container-level settings override them. That is convenient, but it is also a source of mistakes. A job definition can look compliant at the pod level and still run a container as root because the container-level runAsUser overrides it. Auditing the effective security context, not just the top-level YAML, is the only reliable check.
The feature is supported in all regions where AWS Batch is available. That is a broader footprint than a regional preview, and it means the change is part of the general service rather than an opt-in add-on. The console support matters for operators who debug job definitions interactively; the CloudFormation support matters for teams that treat infrastructure as code. The CLI and SDK support matter for automation.
The timing is also worth noting. AWS added access entry authentication for Batch compute environments on October 5, 2026. The API changes for security context were listed on November 9. The What’s New post followed on November 13. The sequence suggests a deliberate build-out of EKS-native controls rather than a one-off feature.
Pod-level vs container-level precedence
The most practical way to understand the change is to walk through a restricted-profile job. The pod needs a non-root user, a group, a seccomp profile, and an fsGroup for any shared volume. The container needs to drop all capabilities, avoid privilege escalation, and use a read-only root filesystem. Some of those settings can be pod-wide defaults; others are container-specific.
A pod-level securityContext with runAsNonRoot: true, runAsUser: 1000, runAsGroup: 1000, fsGroup: 2000, and seccompProfile.type: RuntimeDefault sets a safe baseline. A container-level securityContext with allowPrivilegeEscalation: false, capabilities.drop: ["ALL"], readOnlyRootFilesystem: true, and the same seccomp profile makes the individual container comply. If a sidecar needs a different UID, it can override at the container level. If a job needs NET_BIND_SERVICE to bind a low port, it can add that single capability instead of running privileged.
The details matter. Dropping ALL and adding back one capability is the least-privilege pattern. Running as non-root means the image must have a non-root user, or the job must set a UID that exists in the image. A read-only root filesystem means the job cannot write to /tmp or the working directory unless those paths are mounted as writable volumes. A seccomp profile of RuntimeDefault is available on most nodes; a Localhost profile requires a profile file on every node and a job definition that references it. fsGroup changes volume ownership, which can break an application that expects a different group.
Those are not reasons to avoid the feature. They are reasons to test it. A batch job that has run as root for years may have hidden dependencies on root-owned files, a writable /tmp, or a capability it never declared. Turning on the restricted profile in audit mode first, then enforcing it, is the standard way to find those dependencies without breaking production.
A migration checklist
Start with an inventory. List every Batch job definition that targets EKS. For each one, record the image, the user, the command, the volumes, the environment, and the current security context. Identify jobs that run as root, jobs that set privileged: true, jobs that add capabilities, and jobs that write to the root filesystem. Those are the ones that will need work.
Next, build or choose a non-root image. A batch job does not need a shell, a package manager, or a home directory. A minimal image with a dedicated user and a clear entrypoint is easier to secure and smaller to pull. If the job needs a writable directory, mount an emptyDir or a persistent volume and set fsGroup so the non-root user can write to it.
Then, set the security context in the job definition. Use pod-level defaults for the settings that apply to every container, and container-level overrides only where necessary. Drop all capabilities, add back only what the job needs, set allowPrivilegeEscalation: false, and use RuntimeDefault seccomp unless you have a custom profile. Make the root filesystem read-only if the job can tolerate it. If it cannot, document why and scope the writable path.
After that, test in a non-production queue. Run a representative job with the restricted profile enforced in a test namespace. Check the logs, the exit code, and the output. If the job fails, the error usually points to a permission problem: a file owned by root, a missing writable directory, a capability that was dropped, or a seccomp rule that blocked a syscall. Fix the job, not the policy.
Finally, roll out gradually. Enforce the restricted profile in audit mode, review the violations, and then enforce it. Keep an exception process for jobs that genuinely need a capability, but make the exception narrow and time-bound. The goal is not zero exceptions; it is knowing why each exception exists.
What the feature does not solve
The new fields are necessary but not sufficient for a secure batch platform. They do not distribute custom seccomp profiles to nodes. They do not add AppArmor or SELinux support. They do not enforce network policies, image provenance, or least-privilege IAM. They do not stop a job from mounting a host path if the pod spec allows it. They do not replace Pod Security Admission; they give you the fields to satisfy it.
The shared responsibility model still applies. AWS provides the controls; the customer chooses the values. A job definition with privileged: true is still possible. A container that runs as root is still possible if the image or the job definition says so. The feature makes compliance possible, not automatic.
There is also an operational cost. A read-only root filesystem and a non-root user can break jobs that were written for a more permissive environment. A seccomp profile can block a syscall that a library needs. A dropped capability can break a network binding. The migration is work. The alternative, weakening the cluster policy or running a separate cluster, is also work, and it carries a security cost that is harder to see.
The feature also does not address the rest of the Batch surface: job queues, compute environments, instance types, spot interruption handling, and retry behavior. Those are separate concerns. A secure job definition on an insecure compute environment is still a risk. The security context is one layer.
Why this matters beyond Batch
The change is a small example of a larger pattern. Kubernetes security defaults are tightening. Pod Security Standards, seccomp, non-root users, read-only root filesystems, and dropped capabilities are becoming the baseline for regulated environments. Services that abstract Kubernetes must expose the underlying controls, or they become unusable in the clusters where security matters most.
AWS Batch is not the only service with this problem. Managed job runners, CI systems, and serverless container platforms all face the same tension: they want to hide Kubernetes complexity, but security teams need the knobs. The ones that expose the knobs, with safe defaults and clear precedence, will be easier to adopt. The ones that do not will be relegated to separate clusters with weaker policy.
For platform teams, the lesson is to treat the security context as part of the job definition, not an afterthought. A batch job that runs with the minimum privileges is easier to reason about, easier to audit, and easier to move between clusters. The new fields make that possible on AWS Batch. The work of using them is now a configuration exercise, not a platform limitation.
Sources
- Primary: AWS What’s New, “AWS Batch on Amazon EKS adds Linux capabilities, seccomp, and pod-level settings”
- AWS Batch User Guide: Job definition parameters
- AWS Batch API: RegisterJobDefinition
- Kubernetes: Pod Security Standards
- Kubernetes: Configure a Security Context for a Pod or Container