Threat Model
The Kubernetes Security Special Interest Group (SIG) has defined an Admission Control Threat Model for Kubernetes. The Kubewarden team continuously evaluates Kubewarden against this threat model, and works to provide secure defaults. It's recommended that Kubewarden administrators read and understand the threat model, and use it to devise their own circumstance specific threat model as needed.
Details about each threat is provided in the document published by SIG Security.
Kubernetes threats​
Threat 1 - Attacker floods webhook with traffic preventing its operation​
Scenario​
An attacker who has access to the Webhook endpoint, at the network level, could send large quantities of traffic, causing an effective denial of service to the admission controller.
Mitigation​
Webhook fails closed. if the webhook doesn't respond in time, for any reason, the API server should reject the request. This is Kubewarden's default behavior.
Failing closed means that if, for any reason, Kubewarden stops responding or crashes, the API server rejects the request by default. This is even if the request would normally be accepted by Kubewarden.
Threat 2 - Attacker passes workloads which require complex processing causing timeouts​
Scenario​
An attacker, who can access the admission controller at a network level, passes requests to the admission controller requiring complex processing and causing timeouts as the admission controller uses compute power to process the workloads.
Mitigation​
Webhook fails closed and authenticate callers. This is Kubewarden's default behavior.
Threat 3 - Attacker exploits mis-configuration of webhook to bypass​
Scenario​
An attacker, who has rights to create workloads in the cluster, is able to exploit a mis-configuration to bypass the intended security control.
Mitigation​
Regular reviews of webhook configuration can help catch issues.
Threat 4 - Attacker has rights to delete or modify the Kubernetes webhook object​
Scenario​
An attacker who has Kubernetes API access, has sufficient privileges to delete the webhook object in the cluster.
Mitigation​
RBAC rights should be strictly controlled.
To-do​
Most of RBAC isn't within the scope of the current discussion. However, the following will be provided in due course for helping Kubewarden users:
- Directions around minimum RBAC to be implemented.
- Provision & documentation of a policy that detects and could block RBAC changes.
Threat 5 - Attacker gets access to valid credentials for the webhook​
Scenario​
An attacker gains access to valid client credentials for the admission controller webhook.
Mitigation​
Webhook fails closed. This is Kubewarden's default behavior.
Threat 6 - Attacker gains access to a cluster admin credential​
Scenario​
An attacker gains access to a cluster-admin level credential in the Kubernetes cluster.
Mitigation​
N/A
Threat 7 - Attacker sniffs traffic on the container network​
Scenario​
An attacker who has access to the container network is able to sniff traffic between the API server and the admission controller webhook.
Mitigation​
Since the webhook uses TLS encryption for all traffic, Kubewarden is safe.
Threat 8 - Attacker carries out a MITM attack on the webhook​
Scenario​
An attacker on the container network, who has access to the NET_RAW capability can try to use MITM tooling to intercept traffic between the API server and admission controller webhook.
Mitigation​
Webhook mTLS authentication should be used. You should also use capabilities-psp and configure it to drop NET_RAW capabilities.
To-do​
Implement mutual TLS authentication.
Additionally, it would be possible to add a policy within the recommended
policies section in the kubewarden-defaults
which drops the NET_RAW
capability.
Threat 9 - Attacker steals traffic from the webhook via spoofing​
Scenario​
An attacker is able to redirect traffic from the API server which is intended for the admission controller webhook by spoofing.
Mitigation​
Webhook mTLS authentication is used.
To-do​
Kubewarden should implement mutual TLS authentication
Threat 10 - Abusing a mutation rule to create a privileged container​
Scenario​
An attacker is able to cause a mutating admission controller to modify a workload, such that it allows for privileged container creation.
Mitigation​
All rules should be reviewed and tested.
Threat 11 - Attacker deploys workloads to namespaces that are exempt from admission control​
Scenario​
An attacker is able to deploy workloads to Kubernetes namespaces that are exempt from the admission controller configuration.
Mitigation​
RBAC rights are strictly controlled
To-do​
Most of the RBAC is out of scope with respect to this decision. However, the Kubewarden team aims to:
- Warn users via our docs and suggest some minimum RBAC to be used.
- Provide a policy which detects RBAC changes and maybe block them.
Threat 12 - Block rule can be bypassed due to missing match (for example, missing initcontainers)​
Scenario​
An attacker created a workload manifest which uses a feature of the Kubernetes API which is not covered by the admission controller