Join our Newsletter — 33% off our NHI Course
Home› Guides› Kubernetes Windows Nodes Security: HostProcess Pods, gMSA and…
Guide Cloud Security

Kubernetes Windows Nodes Security: HostProcess Pods, gMSA and Node Hardening

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 27 November 2026 14 min read
On this page

Most Kubernetes hardening advice assumes Linux nodes, so teams that add Windows worker nodes often carry over controls that silently do nothing on Windows and miss the ones that matter there. Seccomp, AppArmor, SELinux and Linux capabilities have no effect on Windows pods, Secrets land on the node disk in clear text, privileged access comes through HostProcess containers, and Active Directory identity arrives through group Managed Service Accounts (gMSA). This guide covers what changes on Windows nodes and how to secure each part: pod security, HostProcess admission, gMSA credential specs, node hardening and patching, and monitoring. It is for platform engineers and security teams running Windows workloads on Kubernetes. Feature states are as shown in the Kubernetes v1.37 documentation, checked in November 2026. For cluster-wide controls that apply to every node, see the Kubernetes Security Guide.

Key takeaways

  • Many securityContext fields do nothing on Windows. Seccomp, AppArmor, SELinux, capabilities, readOnlyRootFilesystem and runAsGroup are not supported, so the Windows controls are runAsUserName, the default container user, admission policy and the node itself.
  • HostProcess is the privileged container of Windows. Stable since v1.26, it runs as a host process with access to host network, storage and devices; Pod Security Standards Baseline and Restricted both disallow it, so allow it only in tightly controlled system namespaces.
  • gMSA access is an authorisation decision. The credential spec holds no secrets, but the validating webhook and an RBAC "use" grant decide which service accounts can act as which Active Directory identity.
  • Secrets on Windows nodes are written to disk. Kubernetes documents that Secret data is stored in clear text on local storage, and recommends file ACLs and BitLocker volume encryption.
  • Patching is tied to image versions. The host OS version must match the container base image version, so node and image updates need planning together.

How Windows nodes differ

Kubernetes requires the control plane to run on Linux; only worker nodes can run Windows. Windows nodes must run Windows Server 2022 or Windows Server 2025 (Windows Server 2019 and later for the Mirantis Container Runtime), and Kubernetes supports only process isolation, not Hyper-V isolation. A pod cannot mix Windows and Linux containers.

Control areaLinux nodesWindows nodesWhat to do on Windows
Privileged access to hostprivileged: true, hostPID, hostIPC, hostNetworkPrivileged containers are not supported; HostProcess containers provide host accessRestrict windowsOptions.hostProcess through admission
Kernel attack surface filteringSeccomp, AppArmor, SELinuxNot supportedRely on process isolation, least-privilege user and node hardening
CapabilitiesDrop ALL, add specific POSIX capabilitiesNot supportedRun as ContainerUser where the image allows
Run as userrunAsUser, runAsGroup, runAsNonRootwindowsOptions.runAsUserName; runAsGroup not supportedSet runAsUserName explicitly; know the base image default
Read-only root filesystemSupportedNot supportedUse file ACLs in the image and immutable deployment
Secrets on the nodetmpfs (in memory)Written to local storage in clear textFile ACLs on the Secret location, BitLocker volume encryption
Workload identity to Active DirectoryUsually keytabs or external brokersgMSA via credential specWebhooks plus RBAC "use" grants per credential spec
Isolation modelNamespaces and cgroupsProcess isolation onlyTreat node as the boundary; separate node pools by trust level
Image compatibilityKernel generally backwards compatibleHost OS version must match the base image versionPin images to node build; plan patches together

The API server rejects pods that set certain Linux-only fields (for example spec.hostPID, seLinuxOptions or privileged) when spec.os.name is windows. That is useful: setting spec.os.name: windows on every Windows pod turns some silent no-ops into explicit errors.

Keep Windows and Linux workloads apart

The Kubernetes Windows user guide notes that spec.os.name does not affect scheduling. Use a nodeSelector on kubernetes.io/os: windows, which the guide calls the best practice, and optionally taint Windows nodes (for example registering the kubelet with os=windows:NoSchedule) so Linux pods without a selector cannot land there. The node.kubernetes.io/windows-build label (10.0.20348 for Windows Server 2022, 10.0.26100 for Windows Server 2025) pins pods to a matching OS build, and a RuntimeClass can bundle the selector and toleration for application teams.

HostProcess containers and their risk

HostProcess containers run as normal processes on the Windows host, with access to the host network namespace, storage and devices according to the user account they run as. Kubernetes lists their purpose as deploying network plugins, storage configuration, device plugins, kube-proxy and similar node components. There is no filesystem or Hyper-V isolation: they are constrained only by resource limits and the permissions of their user account. Treat any HostProcess pod as equivalent to administrator access on that node.

How HostProcess is configured

SettingValue required for HostProcessSecurity note
securityContext.windowsOptions.hostProcesstrueThe field admission policy must control
hostNetworktruePod shares the node's network identity
windowsOptions.runAsUserNameNT AUTHORITY\SYSTEM, NT AUTHORITY\Local service, NT AUTHORITY\NetworkService or a local usergroup nameKubernetes advises LocalService (least privileged) where possible and LocalSystem only when absolutely necessary
runAsNonRootUnset or falseCannot be true, because HostProcess has privileged host access
Containers in the podAll must be HostProcessA pod cannot mix HostProcess and normal Windows containers
Runtimecontainerd v1.6 or later (v1.7 recommended; v1.7 needed for local user accounts)Check runtime version across all Windows node pools
  • Prefer local usergroups: with containerd v1.7 or later, setting runAsUserName to a local group creates an ephemeral local user in that group for each run, so no local passwords need managing. Grant the group only the node resources the component needs.
  • Restrict through admission: enforce Pod Security Standards Baseline or Restricted on every application namespace, which rejects hostProcess: true on the pod and on every container, init container and ephemeral container. Label only the specific system namespaces that host node agents as Privileged.
  • Add a precise policy: namespace-level Privileged is broad. Use a ValidatingAdmissionPolicy (stable since v1.30) or a policy engine to allow HostProcess only for named service accounts and approved image digests in those namespaces. See the Kubernetes Admission Control Guide.
  • Lock down who can create pods there: RBAC rights to create pods, DaemonSets or ephemeral containers in a Privileged namespace are node administrator rights. Review them like domain admin rights. See the Kubernetes RBAC Guide.
  • Protect service account tokens: HostProcess containers can read tokens through the mount paths Kubernetes documents (including c:\var\run\secrets\kubernetes.io\serviceaccount with containerd v1.7). Give node agents their own service accounts with minimal RBAC. See the Kubernetes Service Account Token Guide.

gMSA for Windows workloads

Windows containers cannot be domain joined, but applications inside them can use Active Directory authentication by running as a gMSA, a shared AD identity whose password is managed by the domain. Kubernetes support has been stable since v1.18. For gMSA fundamentals outside containers, see the Group Managed Service Accounts (gMSA) Guide.

How the pieces fit

  1. CRD: the GMSACredentialSpec custom resource (API group windows.k8s.io) stores each credential spec cluster-wide.
  2. Mutating webhook: expands a gMSA reference by name in the pod spec into the full JSON credential spec.
  3. Validating webhook: checks that the pod's service account is authorised to use the referenced credential spec.
  4. RBAC: a ClusterRole grants the use verb on gmsacredentialspecs, limited by resourceNames to one spec, and a RoleBinding attaches it to a specific service account.
  5. Pod reference: securityContext.windowsOptions.gmsaCredentialSpecName at pod or container level.
  6. Node retrieval: on domain-joined nodes the node's computer account retrieves the gMSA password; on non-domain-joined nodes the ccg.exe plug-in uses a portable user identity from a secret store (supported from Windows Server 2019).

Handling credential specs securely

  • The spec is not a secret, the grant is: the credential spec contains no password, but whoever can reference it gets that AD identity. Bind use per spec and per service account, never with wildcards, and never to the default service account in production.
  • Keep the webhooks healthy: the validating webhook is the authorisation check. Monitor it, protect its namespace and TLS certificates, and test what happens to gMSA pods if it is unavailable.
  • Scope password retrieval in AD: Microsoft recommends a dedicated security group per gMSA in PrincipalsAllowedToRetrieveManagedPassword, containing only the hosts (or, for non-domain-joined setups, the portable user account) that need it.
  • Separate environments: Microsoft recommends separate gMSAs for development, test and production.
  • Protect the portable identity: for non-domain-joined nodes, the portable account's credentials sit in the plug-in's secret store. Use a long, random, machine-generated password, restrict who can read that secret and rotate it. See the Kubernetes Secrets Security Guide.
  • Register SPNs deliberately: containers do not register SPNs automatically; register the names clients actually use, such as the load balancer name.

Where identity fits

Windows nodes put three non-human identities side by side: Kubernetes service accounts, gMSAs and node computer or portable accounts. The risky chain is a service account that can reference a gMSA that has broad rights in AD. Inventory which service accounts can use which credential specs, what each gMSA can reach in the domain, and who can create pods with those service accounts. The Kubernetes NHI Security Guide covers the wider cluster identity model.

Pod security on Windows

Pod Security Admission works for Windows pods, with differences. Since v1.25 the Restricted profile reads spec.os.name: the Privilege Escalation, Seccomp and Linux Capabilities controls are only required when spec.os.name is not windows. Kubernetes notes that kubelets older than v1.24 do not enforce the pod OS field, so clusters with such nodes should pin Restricted to a version before v1.25. See the Kubernetes Pod Security Standards and Pod Security Admission Guide.

  • Set spec.os.name: windows: on every Windows pod template, so Restricted is evaluated correctly and Linux-only fields are rejected.
  • Know the default user: Windows containers have two default accounts. Nano Server images run as ContainerUser by default, Server Core images as ContainerAdministrator. Set runAsUserName: ContainerUser where the application allows.
  • Enforce Baseline at minimum: on every Windows application namespace, with Restricted where workloads permit. Start in warn and audit mode, then move to enforce.
  • Network policy: confirm your CNI enforces NetworkPolicy on Windows nodes before relying on it. See the Kubernetes Network Policy Guide.

Node hardening and patching

  • Encrypt and restrict Secret storage: enable BitLocker on the volumes where the kubelet writes pod data and apply file ACLs to the Secret location, as the Kubernetes Windows security page recommends.
  • Harden the OS baseline: apply a Windows Server baseline suited to container hosts, remove interactive logon for administrators except through break-glass, and manage the built-in local administrator with LAPS. See the Windows Endpoint Hardening Guide and the Local Administrator Password Solution (LAPS) Guide.
  • Run containerd as a service account: Kubernetes documents that containerd must run as LocalSystem or LocalService for HostProcess logon tokens to work; do not work around errors by running it as an interactive user.
  • Use signed pause images in production: the Windows documentation recommends mcr.microsoft.com/oss/kubernetes/pause:3.6 where signed binaries are required.
  • Patch by replacing nodes: because the host OS version must match the base image version, build new node images with monthly updates, rebuild application images on the matching base, then roll node pools. Treat in-place patching of long-lived nodes as the exception.
  • Separate node pools by trust: process isolation means a container escape reaches the node. Keep internet-facing and sensitive workloads on separate pools.

Phased rollout

  1. Inventory: list Windows node pools, OS builds, containerd versions, HostProcess pods, credential specs and their RBAC bindings.
  2. Label and audit: apply Pod Security labels in audit and warn mode on Windows namespaces; set spec.os.name on templates.
  3. Contain HostProcess: move node agents into dedicated Privileged namespaces with an allow-list policy; enforce Baseline everywhere else.
  4. Tighten gMSA: replace broad use grants with per-spec, per-service-account bindings and dedicated AD retrieval groups.
  5. Harden nodes: BitLocker, ACLs, baseline, LAPS, rebuilt images on a monthly cadence.
  6. Enforce and verify: switch to enforce one namespace at a time. Roll back by removing the enforce label, which reverts to audit without redeploying workloads.

Monitoring and logging

SignalSourceWhy it matters
Pod create or update with hostProcess: trueKubernetes audit logNew host-level access to a node; ATT&CK T1610 Deploy Container and T1611 Escape to Host
Changes to gmsacredentialspecs and their RoleBindingsKubernetes audit logSomeone granting a workload a new AD identity
Pod Security audit and warn annotationsKubernetes audit log and API responsesWorkloads that would fail enforcement
exec and ephemeral containers on Windows podsKubernetes audit logInteractive access to workloads; ATT&CK T1609 Container Administration Command
gMSA logons from unexpected hostsDomain controller security logsMisuse of a gMSA identity; ATT&CK T1078.002 Domain Accounts
Kerberos ticket anomalies for gMSA accountsDomain controller security logsPossible ticket theft; ATT&CK T1558 Steal or Forge Kerberos Tickets
Process creation and service changes on nodesWindows event logs and endpoint telemetry on the nodeActivity from HostProcess containers appears as host processes

See the Kubernetes Audit Log Detection Guide for audit policy and detection rules.

Metrics

  • HostProcess footprint: number of HostProcess workloads, and percentage running in allow-listed namespaces with approved service accounts (target 100%).
  • Pod Security coverage: percentage of Windows namespaces enforcing Baseline or Restricted.
  • gMSA grant hygiene: number of credential specs with more than one bound service account, or bound to default.
  • Node age: median age of Windows nodes since last image rebuild.
  • Encryption coverage: percentage of Windows nodes with BitLocker enabled on pod data volumes.

Framework mapping

Control on Windows nodesNIST SP 800-53 Rev. 5NIST CSF 2.0
HostProcess admission and least-privilege run-as accountsAC-6 Least Privilege, CM-7 Least FunctionalityPR.AA-05
Pod Security labels, node baselinesCM-6 Configuration SettingsPR.PS-01
Node image rebuild and patchingSI-2 Flaw RemediationPR.PS-02
gMSA and portable account credentialsIA-5 Authenticator ManagementPR.AA-05
Audit logging and node telemetryAU-12 Audit Record GenerationDE.CM-09

Common failure patterns

  • Copying Linux pod specs: seccomp profiles, dropped capabilities and read-only root filesystems that have no effect on Windows give a false sense of hardening.
  • Privileged namespace sprawl: labelling a whole shared namespace Privileged to run one node agent, which lets any workload there request HostProcess.
  • Running HostProcess as SYSTEM by habit: using LocalSystem when LocalService or a scoped local group would do.
  • Wildcard gMSA grants: giving many service accounts use on all credential specs, so any compromised workload can act as any AD identity.
  • Unencrypted Secret storage: forgetting that Secrets are written to the node disk and leaving volumes unencrypted.
  • Stale nodes: long-lived Windows nodes left unpatched because image version matching makes updates awkward.

Practitioner checklist

  • Set spec.os.name: windows, a kubernetes.io/os nodeSelector and a matching toleration on every Windows workload.
  • Enforce Pod Security Baseline or Restricted on all Windows application namespaces.
  • Limit HostProcess to dedicated system namespaces, named service accounts and approved images, using an admission policy.
  • Run HostProcess containers as LocalService or a scoped local usergroup unless SYSTEM is essential.
  • Bind gMSA use per credential spec and per service account; never to default.
  • Use a dedicated AD group per gMSA for password retrieval and separate gMSAs per environment.
  • Enable BitLocker and file ACLs for Secret storage on Windows nodes.
  • Rebuild Windows node images and matching application images monthly and roll node pools.
  • Alert on HostProcess pod creation and on changes to credential specs and their bindings.

Standards and references

Related NHI Mgmt Group resources: Kubernetes Security Guide · Kubernetes Admission Control Guide · Group Managed Service Accounts (gMSA) Guide · Kubernetes Pod Security Standards and Pod Security Admission Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.