Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 |
Tags
- asyncio
- docker
- cpu
- EC2
- K8S
- kernel
- AWS
- Kubernetes
- Service
- elasticsearch
- leetcode
- dockerfile
- RBAC
- kubelet
- IAC
- Network
- POD
- AZURE
- ebs
- Django
- CKS
- IAM
- Deployment
- FastAPI
- DevOps
- terraform
- Python
- Role
- ansible
- AZ-900
Archives
- Today
- Total
궁금한게 많은 개발자 노트
[ K8S ] CKS - PSA (Pod Security Admission) 본문
Configure the namespace restricted-ns to enforce the restricted Pod Security Standard. Also, configure it to trigger a warn and audit log if pods violating the baseline standard are created.
[ 포함된 개념 ]
- 과거 PSP(Pod Security Policy)가 폐지되고 도입된 네임스페이스 라벨 기반 파드 보안 제어 기능
- Privileged, Baseline, Restricted 3단계
- privileged > 제한 없음 없음
- baseline > 최소한의 제한 privileged 모드, hostNetwork, hostPID 등 차단
- restricted > 가장 엄격 baseline + runAsNonRoot, readOnlyRootFilesystem 등 필수
- Privileged, Baseline, Restricted 3단계
- PSA 모드
- enforce > 위반 시 Pod 생성 거부
- warn > 위반 시 경고 메시지 출력 (생성은 허용)
- audit > 위반 시 audit 로그 기록 (생성은 허용)
# The per-mode level label indicates which policy level to apply for the mode.
#
# MODE must be one of `enforce`, `audit`, or `warn`.
# LEVEL must be one of `privileged`, `baseline`, or `restricted`.
pod-security.kubernetes.io/<MODE>: <LEVEL>
# Optional: per-mode version label that can be used to pin the policy to the
# version that shipped with a given Kubernetes minor version (for example v1.35).
#
# MODE must be one of `enforce`, `audit`, or `warn`.
# VERSION must be a valid Kubernetes minor version, or `latest`.
pod-security.kubernetes.io/<MODE>-version: <VERSION>
[ 풀이 방법 ]
# 1. Restricted 레벨 강제 (위반 파드 생성 차단)
kubectl label namespace restricted-ns pod-security.kubernetes.io/enforce=restricted
# 2. Baseline 레벨 위반 시 경고 출력
kubectl label namespace restricted-ns pod-security.kubernetes.io/warn=baseline
# 3. Baseline 레벨 위반 시 감사 로그 기록
kubectl label namespace restricted-ns pod-security.kubernetes.io/audit=baseline'DevOps > CKS' 카테고리의 다른 글
| [ K8S ] CKS - Secret Resource EncryptionConfiguration (0) | 2026.03.26 |
|---|---|
| [ K8S ] CKS - Seccomp Profile (0) | 2026.03.26 |
| [ K8S ] CKS - API Server TroubleShooting (Node Resctriction, RBAC) (0) | 2026.03.25 |
| [ K8S ] CKS - Falco Rule 작성 및 위협 파드 조치 (0) | 2026.03.25 |
| [ K8S ] CKS - Pod Security Context & BOM추출 (0) | 2026.03.24 |
Comments