Containers with added capabilities 이 페이지는 아직 한국어로 제공되지 않습니다. 번역 작업 중입니다.
현재 번역 프로젝트에 대한 질문이나 피드백이 있으신 경우
언제든지 연락주시기 바랍니다. Id: kubernetes-containers-with-added-capabilities
Platform: Kubernetes
Severity: Medium
Category: Insecure Configurations
Learn More Description Containers and initContainers should not include added capabilities other than NET_BIND_SERVICE. The rule checks container.securityContext.capabilities.add and reports an IncorrectValue when any capability other than NET_BIND_SERVICE is present. It applies to both containers and initContainers found in the pod spec.
Compliant Code Examples apiVersion : v1
kind : Pod
metadata :
name : pod1
spec :
containers :
- name : app
image : images.my-company.example/app:v4
securityContext :
allowPrivilegeEscalation : false
resources :
requests :
memory : "64Mi"
cpu : "250m"
limits :
memory : "128Mi"
cpu : "500m"
- name : log-aggregator
image : images.my-company.example/log-aggregator:v6
securityContext :
allowPrivilegeEscalation : false
resources :
requests :
memory : "64Mi"
cpu : "250m"
limits :
memory : "128Mi"
cpu : "500m"
apiVersion : v1
kind : Pod
metadata :
name : pod4
spec :
containers :
- name : app
image : images.my-company.example/app:v4
securityContext :
allowPrivilegeEscalation : false
capabilities :
drop :
- ALL
add :
- NET_BIND_SERVICE
resources :
requests :
memory : "64Mi"
cpu : "250m"
limits :
memory : "128Mi"
cpu : "500m"
- name : log-aggregator
image : images.my-company.example/log-aggregator:v6
securityContext :
allowPrivilegeEscalation : false
resources :
requests :
memory : "64Mi"
cpu : "250m"
limits :
memory : "128Mi"
cpu : "500m"
Non-Compliant Code Examples apiVersion : v1
kind : Pod
metadata :
name : pod2
spec :
containers :
- name : app
image : images.my-company.example/app:v4
securityContext :
allowPrivilegeEscalation : false
capabilities :
add : [ "NET_ADMIN" , "SYS_TIME" ]
resources :
requests :
memory : "64Mi"
cpu : "250m"
limits :
memory : "128Mi"
cpu : "500m"
- name : log-aggregator
image : images.my-company.example/log-aggregator:v6
securityContext :
allowPrivilegeEscalation : false
resources :
requests :
memory : "64Mi"
cpu : "250m"
limits :
memory : "128Mi"
cpu : "500m"
---
apiVersion : v1
kind : Pod
metadata :
name : pod3
spec :
initContainers :
- name : app
image : images.my-company.example/app:v4
securityContext :
allowPrivilegeEscalation : false
capabilities :
add : [ "NET_ADMIN" , "SYS_TIME" ]
resources :
requests :
memory : "64Mi"
cpu : "250m"
limits :
memory : "128Mi"
cpu : "500m"
- name : log-aggregator
image : images.my-company.example/log-aggregator:v6
securityContext :
allowPrivilegeEscalation : false
resources :
requests :
memory : "64Mi"
cpu : "250m"
limits :
memory : "128Mi"
cpu : "500m"
containers :
- name : app
image : images.my-company.example/app:v4