SaveMyCert
Log in
5 of 5 free questions left today·for 10 a day
Overview of Cloud Native Security

KCSA: The 4Cs of Cloud Native Security, Infrastructure Security and Security Controls

16 min readKCSA · Overview of Cloud Native SecurityUpdated

The 4Cs of cloud native security are four nested layers, Cloud, Cluster, Container and Code, in which each layer depends on the one around it, so a Kubernetes workload is only as secure as the infrastructure and cluster beneath it. This KCSA lesson covers that model, the shared responsibility split between a cloud provider and its customer, how to secure the infrastructure a cluster runs on (network access to the API server, nodes and etcd, least-privilege cloud permissions, the instance metadata endpoint and host hardening), and the frameworks used to choose controls: preventive, detective and corrective controls, defence in depth, the CIS Kubernetes Benchmark and the cloud native lifecycle phases.

What you’ll learn
  • Place a security control in the correct 4C layer (Cloud, Cluster, Container or Code) and explain why outer-layer weaknesses cannot be fixed in code
  • Apply the shared responsibility model to managed and self-installed Kubernetes, including self-managed node groups
  • Restrict network access to the API server, worker nodes and etcd, and know which component uses which port
  • Grant least-privilege cloud permissions to the control plane and nodes, protect the instance metadata endpoint and use workload identity
  • Classify controls as preventive, detective or corrective and design defence in depth across independent layers
  • Use the CIS Kubernetes Benchmark and the Develop, Distribute, Deploy and Runtime phases to choose and place controls

What the 4Cs of cloud native security are

The 4Cs are a layered way of thinking about cloud native security: Cloud, Cluster, Container and Code, drawn as four nested rings with Cloud on the outside and Code in the middle. Each ring is a set of controls you can apply, and each one sits inside, and depends on, the ring around it.

LayerWhat it coversTypical controls
Cloud (infrastructure)The data centre, cloud account, networks, virtual machines and hosts the cluster runs onNetwork ACLs and private endpoints for the API server, node firewall rules, cloud IAM permissions for the control plane and nodes, disk encryption, hardened node operating systems
ClusterKubernetes itself: its components and everything configured through the Kubernetes APIAuthentication, RBAC, admission policies, NetworkPolicies, Secrets encryption, audit logging
ContainerImages and the settings each container runs withImage scanning and signing, minimal base images, running as non-root, dropping capabilities, no privileged mode
CodeThe application you write and its dependenciesInput validation, TLS between services, static analysis, dependency scanning, limiting exposed ports

To place a control in the right layer, ask where it is configured, not what it protects. A network ACL in the provider that guards the API server is still a Cloud-layer control, because it lives outside Kubernetes. RBAC and NetworkPolicies are Cluster-layer controls because they are Kubernetes objects. A container's user ID or capabilities are Container-layer settings, and the application's own validation logic is Code.

The model came from the Kubernetes documentation's original "Overview of Cloud Native Security" page. That page has since been replaced on kubernetes.io by "Cloud Native Security and Kubernetes", which is organised by lifecycle phase instead (covered below), but the 4Cs remain a named KCSA competency and the vocabulary is still widely used.

Why each layer depends on the layer around it

Each layer builds on the next outermost one, so a weakness in an outer layer exposes everything inside it, and strong security in the Code layer cannot make up for weak Cloud or Cluster security. The Kubernetes guidance put it directly: you cannot safeguard against poor security standards in the base layers by addressing security at the Code level.

Work through what an attacker can do from each foothold:

  • Control of the cloud account lets them read node disks and snapshots, change network rules or replace the virtual machines, so every cluster control is bypassed.
  • Control of the cluster (for example an etcd endpoint open to the internet, or an over-privileged credential) lets them read every Secret and rewrite any Deployment, including the application's own. None of that passes through the application's code.
  • Control of a container gives them whatever the container's settings, its ServiceAccount token and the node allow.

So an application that validates every input and passes static analysis is still at risk if the layers it runs on are weak. The reverse also holds: good outer layers limit the damage when the Code layer fails. That is why security work starts from the outside in, and why the controls in this lesson (the Cloud layer and the framework for choosing controls) come first in the curriculum.

The shared responsibility model for Kubernetes

In the shared responsibility model, the cloud provider secures what it operates and the customer secures what it configures and deploys; where the line falls depends on how much of the cluster the provider runs. Responsibility follows operation: whoever installs, patches and configures a component owns its security.

ComponentManaged Kubernetes service (provider runs the control plane)Kubernetes you install yourself on rented VMs
Physical hosts, hypervisor, data centreProviderProvider
Control plane: API server, etcd, scheduler, controller manager (patching, scaling, availability, etcd encryption at rest)ProviderCustomer
Worker nodes in a provider-managed node poolShared: the provider builds patched node images and the upgrade tooling; the customer still decides when and how nodes roll (unless automatic upgrades are on)Customer
Self-managed worker nodes (the customer's own launch template, image and auto-scaling group)CustomerCustomer
RBAC, admission policy, NetworkPolicies, Secrets handling, workloads, images, application codeCustomerCustomer

Two consequences come up often:

  • A kernel flaw lives on the worker nodes, not the control plane. On a managed service the provider fixes the control plane, but if the nodes are self-managed the customer must roll them onto a fixed image. Upgrading the cluster's Kubernetes version changes the control plane; it does not replace the operating system on self-managed nodes.
  • Self-installed clusters put the whole control plane on the customer, including configuring the API server to encrypt Secret data in etcd. The provider's disk encryption under those VMs is useful defence in depth, but it is not Kubernetes encryption of Secrets and it does not make the provider responsible for it.

Whatever the model, what you put into the cluster (who can do what, which workloads run, how they are configured) is always yours.

Restricting network access to the API server and nodes

The Kubernetes API endpoint should not be reachable from the public internet: limit it with network ACLs (or a private endpoint) to the addresses that administer the cluster, and let nodes accept only the traffic they need. These are Cloud-layer controls in the original Kubernetes infrastructure guidance.

The API server

Allow only the IP ranges of administrators, CI/CD systems and anything else that legitimately calls the API. What reduces exposure is limiting which source addresses can connect at all.

Network restriction is a separate layer from authentication and RBAC, not a replacement for either. RBAC decides what a request may do once it arrives; the network allow list decides who can send a request at all. If a credential leaks or a flaw is found in the API server, the attacker can only use it from an allowed network.

Worker nodes

Nodes should accept, through network ACLs, only:

  • connections from the control plane on the ports it needs, above all the kubelet API on port 10250; and
  • traffic for Services you deliberately publish through NodePort or LoadBalancer.

Where possible nodes should not be on the public internet at all. Opening the node ports to the whole virtual network exposes the kubelet API to any host on it.

It helps to know what uses port 10250: kubectl logs, exec, attach and port-forward are proxied by the API server to the kubelet on the target node, so the control plane must be able to reach that port on every node. Running Pods and Service traffic do not depend on that connection.

PortComponent
6443kube-apiserver (default secure port)
2379–2380etcd client and peer ports
10250kubelet API (on every node)
10256kube-proxy health endpoint
10257kube-controller-manager secure port
10259kube-scheduler secure port

Administrative shell access

When operators need SSH to private nodes, route every session through one controlled entry point, such as a bastion host inside the network, and let node ACLs accept SSH only from it. The nodes themselves keep no public addresses. Many providers also offer an identity-based session service that avoids open SSH ports entirely.

Least-privilege cloud permissions and the metadata endpoint

The control plane and the nodes need permissions in the cloud provider's API, and each should get only the permissions its own components use. The guidance notes that providers grant different permissions to the control plane and to nodes, and that the cluster's cloud access should follow least privilege.

Why node permissions matter

Anything running on a node can usually use the credentials the provider issues to that node's virtual machine (an instance role, managed identity or service account). That includes an attacker after a container escape. If the node identity holds administrator rights, one compromised node becomes a compromised cloud account. The blast radius is set by what those credentials are allowed to do, so the control that matters is keeping the node identity's permissions small. RBAC governs the node's Kubernetes API identity, not its calls to the provider's API.

Put each permission on the component that uses it

With an external cloud provider integration, the cloud-controller-manager runs on the control plane and holds the provider-specific control loops: its service controller creates cloud load balancers for Services of type LoadBalancer, and its node and route controllers manage node and routing details. The kube-controller-manager keeps the provider-independent loops. Each cloud permission therefore belongs on the identity of the component that actually makes that call, so that it is not shared with everything that can reach node credentials.

The instance metadata endpoint

On most clouds, Pods can reach the instance metadata service (commonly at 169.254.169.254) from the node they run on, and it can return the node's temporary cloud credentials. The Kubernetes "Securing a Cluster" guidance is to:

  • limit the permissions given to instance credentials;
  • use NetworkPolicies (or the provider's metadata protections) to restrict Pod access to the metadata API; and
  • avoid using cloud metadata to deliver secrets.

A NetworkPolicy that stops Pod egress to the metadata address is the direct block (standard NetworkPolicies are allow lists, so this is an egress rule whose ipBlock allows the wider range except the metadata address). Two caveats: it only works if the cluster's network plugin enforces egress NetworkPolicies, and Pods that use hostNetwork are generally outside NetworkPolicy's reach, so the provider's own metadata protections (such as requiring session tokens and limiting the response hop count) are worth enabling too.

Workload identity instead of node identity or stored keys

When one Pod genuinely needs a cloud permission, bind a cloud role to that Pod's ServiceAccount through the provider's workload identity federation (for example EKS Pod Identity or IAM roles for service accounts, GKE Workload Identity Federation, AKS Workload Identity). The Pod gets short-lived tokens for that role alone, the permission can be removed from the node identity, and no long-lived access key has to be stored in a Secret. Block metadata access for the other Pods so they cannot fall back to the node's credentials. Scope that block carefully: on some providers the workload identity token itself is served from a metadata address on the node.

Protecting etcd at the infrastructure level

etcd stores the state of the whole cluster, including every Secret, so network access to it should be limited to the API server, its traffic should use TLS, and its storage should be encrypted at rest.

  • Who may connect. All reads and writes of cluster state go through the kube-apiserver, which is the only Kubernetes component that talks to etcd. The scheduler, controller manager and kubelets are clients of the API server, not of etcd. Firewall etcd's client port so only the API server instances (plus the other etcd members on the peer port) can connect, and require mutual TLS. Otherwise a compromised node or component could read or rewrite cluster state directly, bypassing authentication, authorization and admission.
  • Encryption at rest. The guidance calls it good practice to encrypt all storage at rest and singles out etcd's disk, because a copied disk, snapshot or backup exposes all of the cluster's configuration and credentials.
  • Disk encryption is not enough on its own. It protects data on a stolen disk, not data served by a live endpoint. An etcd endpoint reachable from the internet without client certificates exposes everything regardless of disk encryption. Kubernetes can also encrypt Secret data before it is written to etcd (configured on the API server); the details belong to the etcd and Secrets topics in later domains.

Hardening the hosts a cluster runs on

Host hardening means running worker nodes on a minimal, patched operating system with tightly restricted administrative access, so an attacker who escapes a container finds as little as possible to use.

  • Use a minimal, immutable, container-optimised OS. These operating systems ship only what is needed to run containers and keep system files read-only. The Kubernetes runtime-protection guidance recommends them because they shrink the attack surface after a breakout. The fewer tools and packages a node carries, the less an intruder can use.
  • Patch by replacing nodes. Rather than patching nodes in place, roll them onto a new, fixed image. That is how kernel fixes reach self-managed node groups.
  • Restrict administrative access. Keep nodes in private networks, allow SSH only through a controlled entry point, and prefer audited, identity-based access to shared keys.
  • Least privilege for the node identity, as above, and encrypted disks.

Preventive, detective and corrective controls

Security controls are classified by when and how they act: preventive controls stop a bad state from happening, detective controls notice it after it has happened, and corrective controls restore a good state afterwards.

TypeActsKubernetes examples
PreventiveBefore the event; the risky state never existsAn admission policy that rejects privileged Pods; RBAC denying a verb; a NetworkPolicy blocking egress; an image with no shell
DetectiveDuring or after the event; it raises an alert or records evidenceA runtime security tool alerting when a shell starts in a container; audit log review; CIS benchmark scans that report drift
CorrectiveAfter detection; it removes the bad state or limits its effectDeleting a compromised Pod so its Deployment recreates it from a clean image; rolling nodes onto a patched image; revoking a leaked credential

Two other categories appear in frameworks: a compensating control is an alternative used when the preferred control can't be applied, and a deterrent control discourages an attack (warning banners, for example). Classify by timing: an admission rejection is preventive because nothing is created, while an alert about something already running is detective even if it is fast.

A good design pairs them. A runtime alert (detective) that triggers automatic Pod deletion (corrective) covers what preventive controls missed, and the incident should feed a new preventive control, such as blocking exec or removing the shell from the image.

Defence in depth

Defence in depth means using several independent controls at different layers, so an attacker who defeats one still meets others before reaching anything valuable. The key word is independent: several controls stacked in a single layer tend to share a weakness and fail together.

A layered plan for one workload might be:

  • Container: run as non-root with dropped capabilities, so an exploit gets little inside the container;
  • Cluster: give its ServiceAccount narrowly scoped RBAC and isolate it with NetworkPolicies, so a stolen token does little in the API;
  • Cloud: keep the nodes' provider permissions minimal and block metadata access, so even a node compromise does not become an account compromise.

Each control is worth having on its own, but the value comes from them failing independently. The 4Cs are a convenient checklist for this: a plan with controls in only one ring is not defence in depth.

Frameworks: CIS Benchmark and the cloud native lifecycle

Frameworks give you a structured list of what to control and when: the CIS Kubernetes Benchmark is the setting-by-setting hardening baseline, and the CNCF cloud native security lifecycle groups controls into Develop, Distribute, Deploy and Runtime.

Hardening references

ReferenceWhat it is
CIS Kubernetes BenchmarkNumbered, specific configuration recommendations for the API server, etcd, controller manager, scheduler, kubelet and policies, each with expected values. kube-bench automates checking a cluster against it. Managed services have their own CIS variants because customers can't see the control plane.
NSA/CISA Kubernetes Hardening GuidanceNarrative hardening advice (Pod security, network separation, authentication, logging, upgrades), not a per-setting checklist
Pod Security StandardsThree Kubernetes policy levels (Privileged, Baseline, Restricted) for Pod settings, enforced at admission; covered in Domain 3
NIST SP 800-190NIST's Application Container Security Guide: risks and countermeasures for images, registries, orchestrators, containers and host OSes

Compliance and threat-modelling frameworks (such as STRIDE and MITRE ATT&CK) have their own domain later in the curriculum.

The lifecycle phases

The current kubernetes.io page, "Cloud Native Security and Kubernetes", follows the CNCF cloud native security whitepaper and places controls in four phases:

PhaseFocusExample controls
DevelopSecure design and development environmentsThreat modelling new designs, code review, static analysis, protecting developer environments
DistributeThe supply chain for the images and artifacts you will runScanning images, signing and verifying artifacts, storing images in a private registry only authorised clients can use
DeployChecks before a workload startsAdmission control rejecting unapproved registries or unsigned images, policy checks on manifests
RuntimeProtecting running workloads; the whitepaper splits it into access, compute and storage, and kubernetes.io adds guidance on networking and on observability and runtime securityRBAC and authentication, runtime threat detection, container-optimised node OS, encryption at rest

A control's phase is set by when it acts, not by which artifact it concerns. Image security in depth is taught in the next topic of this domain.

Tip. Questions on this topic are short scenarios at a foundational level. Some describe a control and ask which 4C layer, control type (preventive, detective or corrective) or lifecycle phase it belongs to. Others describe a risk or a symptom in the infrastructure around a cluster, such as exposed endpoints, node credentials or connectivity between the control plane and nodes, and ask for the control or explanation that fits. Shared-responsibility items ask who secures a component under a given deployment model (managed control plane, managed or self-managed nodes, a self-installed cluster). Harder items combine two facts or add a constraint, such as which component's identity should hold a cloud permission, or which design gives one Pod cloud access while meeting every stated requirement.

Key takeaways
  • The 4Cs are Cloud, Cluster, Container and Code; place a control by where it is configured, not by what it protects.
  • Each layer builds on the one around it, so strong application code cannot make up for a weak cloud account or cluster.
  • Responsibility follows operation: on a managed service the provider runs the control plane, but RBAC, workloads and self-managed nodes stay with the customer; a self-installed cluster puts the whole control plane on the customer.
  • Keep the API endpoint off the internet and limit it to administrative sources; this is an extra layer beside authentication and RBAC, not a replacement.
  • Nodes should accept only control-plane traffic on the needed ports (kubelet 10250) plus NodePort and LoadBalancer Service traffic.
  • Give the control plane and nodes only the cloud permissions their own components use, block Pod access to the metadata endpoint, and use workload identity instead of node credentials or stored keys.
  • Only the API server should connect to etcd, over mutual TLS, and etcd's storage should be encrypted because it holds every Secret.
  • Preventive controls stop a bad state, detective controls notice it and corrective controls restore a good state; defence in depth needs independent controls in several layers.
  • The CIS Kubernetes Benchmark is the per-setting hardening baseline that kube-bench checks; the CNCF lifecycle phases are Develop, Distribute, Deploy and Runtime.

Check yourself: 3 questions on this topic

Exam-style KCSA questions on The 4Cs, cloud provider and infrastructure security, and controls and frameworks, answered right here with an explanation after each. Want more? KCSA Overview of Cloud Native Security practice questions.

Frequently asked questions

What are the 4Cs of cloud native security?

The 4Cs are Cloud, Cluster, Container and Code: four nested security layers from the Kubernetes documentation. Cloud is the infrastructure the cluster runs on, Cluster is Kubernetes and its configuration, Container is the image and its runtime settings, and Code is the application. Each layer depends on the one around it, so weaknesses in the Cloud or Cluster layer cannot be compensated for in the Code layer.

Is a network ACL in front of the Kubernetes API server a Cloud or a Cluster control?

It is a Cloud-layer control. Network ACLs and firewall rules are configured in the infrastructure outside Kubernetes, even when they protect a Kubernetes component. Cluster-layer controls are the ones configured through Kubernetes itself, such as RBAC, admission policies and NetworkPolicies.

Who is responsible for security on a managed Kubernetes service?

The provider secures what it operates, usually the control plane (API server, etcd, scheduler and controller manager), including patching and availability. The customer secures what it configures and deploys: RBAC, workloads, NetworkPolicies, Secrets handling and images. Worker nodes depend on the node type: provider-managed node pools share the work, while self-managed nodes are fully the customer's to patch.

Why should Pods be blocked from the cloud instance metadata endpoint?

On most clouds the instance metadata service is reachable from Pods on a node and can return the node's temporary cloud credentials. Any Pod, or an attacker inside one, could then act with the node's cloud permissions. Kubernetes guidance is to limit instance credential permissions, restrict Pod access to the metadata API with network policies and not deliver secrets through metadata; workload identity gives a single Pod its own scoped, short-lived cloud role instead.

Which components should be allowed to connect to etcd?

Only the kube-apiserver instances, plus the other etcd members for peer traffic, ideally over mutual TLS. The scheduler, controller manager and kubelets all work through the API server, so none of them needs etcd. Limiting etcd this way stops a compromised node or component from reading or changing cluster state while bypassing authorization.

What is the difference between preventive, detective and corrective controls?

A preventive control stops a risky state from existing, such as an admission policy that rejects privileged Pods. A detective control notices something that has already happened, such as a runtime alert when a shell starts in a container. A corrective control restores a good state afterwards, such as deleting the compromised Pod so its Deployment replaces it from a clean image.

What is the CIS Kubernetes Benchmark used for?

The CIS Kubernetes Benchmark is a published set of numbered, setting-by-setting hardening recommendations for Kubernetes components such as the API server, etcd and the kubelet, each with an expected value. Teams use it as a configuration baseline, and tools such as kube-bench check a cluster against it automatically.

What are the four phases of the cloud native security lifecycle?

Develop, Distribute, Deploy and Runtime, from the CNCF cloud native security whitepaper. Develop covers secure design and code, Distribute the image supply chain (scanning, signing, private registries), Deploy the checks before a workload starts (such as admission control), and Runtime the protection of running workloads (access, compute and storage in the whitepaper, with networking and observability added on kubernetes.io).

Source

This lesson covers the "Overview of Cloud Native Security" domain of the official KCSA exam guide. Vendors revise their guides — check the source for the current version.

Sign up free to mark lessons complete, bookmark topics and track your exam readiness.

Spotted a mistake in this lesson?