Kubernetes provides several built-in security capabilities, including network security, resource isolation, access control, and logging and auditing. One of the more recent security capabilities is a group of plugins known as admission controllers.
Admission controllers enable governance and enforcement of how clusters are used. Kubernetes ships with over 30 admission controllers, which are listed here along with their descriptions. This article assumes you have a basic understanding of admission controllers, but if you are unfamiliar with them, check out Kubernetes reference guide on admission controllers to learn more.
We’ve compiled 11 tips and recommendations to help you operationalize admission controllers for better security:
-
As a first step, enable admission controllers in order to use some of the more advanced security features of Kubernetes, such as pod security policies which enforce configuration baseline for an entire namespace.
-
To turn on an admission controller, use the following command line, replacing what appears after “=” with the name of the admission controller you want to turn on
--enable-admission-plugins=NameOfController,NameOfController2
- To turn off an admission controller, use the following command line, replacing what appears after “=” with the actual name of the admission controller you want to turn off
--disable-admission-plugins=NameOfController,NameOfController2
- Ensure that the following admission controllers are enabled by default:
NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,Priority,ResourceQuota,PodSecurityPolicy
-
In order to validate Kubernetes resources during create, update, and delete operations, enable
ValidatingAdmissionWebhook
-
Consider disabling the
MutatingAdmissionWebhook
admission controller or applying stricter RBAC restrictions as to who can createMutatingWebhookConfiguration
-
You can use
PodSecurityPolicy
admission controller to prevent containers from running as root or ensure the container’s root filesystem is always mounted as read-only. Keep in mind that unless a policy has already been defined in aPodSecurityPolicy
, pods will not be created because the admission controller’s default operation is to reject pod creation in cases where no matching policy is found. -
Create custom, webhook-based admission controllers to:
- Prevent pulling images from unknown registries while allowing only approved registry usage.
- Set policies that prevent insecure deployments. For example, containers using
privileged
flag increase your security risk because they can bypass a lot of security controls. You can avoid this risk by using a webhook-based admission controller that either rejects this type of deployment or overrides theprivileged
flag. - Enforce label validation on objects to ensure proper labels are used, such as every object being assigned to a team or project.
- Automatically add annotations to objects, such as attributing the correct cost center for a “dev” deployment resource.
-
Use admission controllers to audit the configuration of the objects in clusters to prevent insecure and misconfigured objects from getting into your cluster.
-
Admission controllers can be used to identify and correct images deployed without semantic tags by:
- Automatically adding or validating resource limits
- Ensuring reasonable labels are attached to pods
- Making sure image references in product deployments are not using
latest
tags, or tags with a-dev
suffix
- Use
AlwaysPullImages
admission controller to ensure pull policy is set to Always, such as when you want to make sure a user’s private images are only pulled by those who have the credentials to pull them. Without this admission controller, any pod from any user can use an image by merely knowing its name.
Admission controllers are one of the critical pillars of security for Kubernetes, and as a result, a Kubernetes API server that’s not utilizing the correct set of admission controllers will be incomplete and unable to support all of the expected features of Kubernetes.
저자 소개
채널별 검색
오토메이션
기술, 팀, 인프라를 위한 IT 자동화 최신 동향
인공지능
고객이 어디서나 AI 워크로드를 실행할 수 있도록 지원하는 플랫폼 업데이트
오픈 하이브리드 클라우드
하이브리드 클라우드로 더욱 유연한 미래를 구축하는 방법을 알아보세요
보안
환경과 기술 전반에 걸쳐 리스크를 감소하는 방법에 대한 최신 정보
엣지 컴퓨팅
엣지에서의 운영을 단순화하는 플랫폼 업데이트
인프라
세계적으로 인정받은 기업용 Linux 플랫폼에 대한 최신 정보
애플리케이션
복잡한 애플리케이션에 대한 솔루션 더 보기
오리지널 쇼
엔터프라이즈 기술 분야의 제작자와 리더가 전하는 흥미로운 스토리
제품
- Red Hat Enterprise Linux
- Red Hat OpenShift Enterprise
- Red Hat Ansible Automation Platform
- 클라우드 서비스
- 모든 제품 보기
툴
체험, 구매 & 영업
커뮤니케이션
Red Hat 소개
Red Hat은 Linux, 클라우드, 컨테이너, 쿠버네티스 등을 포함한 글로벌 엔터프라이즈 오픈소스 솔루션 공급업체입니다. Red Hat은 코어 데이터센터에서 네트워크 엣지에 이르기까지 다양한 플랫폼과 환경에서 기업의 업무 편의성을 높여 주는 강화된 기능의 솔루션을 제공합니다.