Hyper: Security in Kubernetes
原文链接 http://www.k8s.tips/tech/2015/12/10/k8s_security/
注:以下为加速网络访问所做的原文缓存,经过重新格式化,可能存在格式方面的问题,或偶有遗漏信息,请以原文为准。
Goal of K8S Security
- Ensure a clear isolation between the container and the underlying host it runs on
- Limit the ability of the container to negatively impact the infrastructure or other containers
- Principle of Least Privilege - ensure components are only authorized to perform the actions they need, and limit the scope of a compromise by limiting the capabilities of individual components
- Reduce the number of systems that have to be hardened and secured by defining clear boundaries between components
- Allow users of the system to be cleanly separated from administrators
- Allow administrative functions to be delegated to users where necessary
- Allow applications to be run on the cluster that have "secret" data (keys, certs, passwords) which is properly abstracted from "public" data.
Roles
- k8s admin - administers a Kubernetes cluster and has access to the underlying components of the system
- k8s project administrator - administrates the security of a small subset of the cluster
- k8s developer - launches pods on a Kubernetes cluster and consumes cluster resources
Service Account
A service account binds together several things:
- a name, understood by users, and perhaps by peripheral systems, for an identity
- a principal that can be authenticated and authorized
- a security context, which defines the Linux Capabilities, User IDs, Groups IDs, and other capabilities and controls on interaction with the file system and OS.
- a set of secrets, which a container may use to access various networked resources.
Service Context
A security context is a set of constraints that are applied to a container in order to achieve the following goals (from security design):
- Ensure a clear isolation between container and the underlying host it runs on
- Limit the ability of the container to negatively impact the infrastructure or other containers
Namespace
A single cluster should be able to satisfy the needs of multiple users or groups of users (henceforth a 'user community').
Each user community wants to be able to work in isolation from other communities. Each user community has its own:
- resources (pods, services, replication controllers, etc.)
- policies (who can or cannot perform actions in their community)
- constraints (this community is allowed this much quota, etc.)
A cluster operator may create a Namespace for each unique user community. The Namespace provides a unique scope for:
- named resources (to avoid basic naming collisions)
- delegated management authority to trusted users
- ability to limit community resource consumption