본문으로 건너뛰기
Skillpedia
보안35k · #8097

implementing-pod-security-admission-controller

하는 일

이 기능은 Kubernetes Pod Security Admission(PSA) 컨트롤러를 설정하고 관리하도록 돕습니다. 정해진 표준을 따라 애플리케이션이 안전하게 실행되도록 합니다.

사용하는 경우

  • ✓Kubernetes 클러스터에서 파드 보안을 처음 설정할 때.
  • ✓클러스터 전체에 기본 보안 규칙을 설정하고 싶을 때.
  • ✓파드가 왜 차단되었는지, 또는 보안이 기대대로 작동하지 않는 이유를 확인하는 경우.

스킬 링크

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-pod-security-admission-controller/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-pod-security-admission-controller/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“'production' 네임스페이스에 'restricted' 보안 수준을 설정하려면 어떻게 해야 하나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

네임스페이스에 특정 레이블을 붙이거나, 클러스터 전체를 위한 중앙 파일을 설정해 보안 규칙을 정의합니다. 이를 통해 Kubernetes는 각 네임스페이스가 따라야 할 보안 표준을 알 수 있습니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Implementing Pod Security Admission Controller

Overview

Pod Security Admission (PSA) is a built-in Kubernetes admission controller (stable since v1.25) that enforces Pod Security Standards at the namespace level. It replaces the deprecated PodSecurityPolicy (PSP) and provides three security profiles: Privileged, Baseline, and Restricted, with three enforcement modes: enforce, audit, and warn.

When to Use

  • Wiring PSA up on a cluster for the first time
  • Setting cluster-wide default enforcement via AdmissionConfiguration
  • Exempting system namespaces, service accounts, or runtime classes from enforcement
  • Debugging why a pod was rejected, or why enforcement is silently not firing
  • Staging a safe rollout: warn and audit first, enforce once violations reach zero
  • Pulling PSA violations out of the kube-apiserver audit log

Not this skill: deciding which profile a workload should run under, or what securityContext changes Restricted demands. Use implementing-kubernetes-pod-security-standards.

Prerequisites

  • Kubernetes v1.25+ (PSA is stable/GA)
  • kubectl with cluster-admin access
  • No dependency on external tools - PSA is built into kube-apiserver

Pod Security Standards

Privileged Profile

  • Unrestricted - No restrictions applied
  • Use case: System-level pods (kube-system, monitoring)

Baseline Profile

  • Minimally restrictive - Prevents known privilege escalation
  • Blocks: privileged containers, hostPID, hostIPC, hostNetwork, hostPorts, certain volume types, adding capabilities beyond runtime defaults

Restricted Profile

  • Heavily restricted - Follows security best practices
  • Requires: non-root, drop ALL capabilities, seccomp RuntimeDefault, read-only root filesystem considerations
  • Blocks: Everything in Baseline plus running as root, privilege escalation, non-approved volume types

Enforcement Modes

Mode Behavior Use Case
enforce Reject pods violating policy Production enforcement
audit Log violations to audit log Pre-enforcement assessment
warn Show warnings to user Developer feedback

Implementation

Apply to Namespace via Labels

# Restricted enforcement with audit and warn
apiVersion: v1
kind: Namespace
metadata:
  name: production
  labels:
    pod-security.kubernetes.io/enforce: restricted
    pod-security.kubernetes.io/enforce-version: v1.28
    pod-security.kubernetes.io/audit: restricted
    pod-security.kubernetes.io/audit-version: v1.28
    pod-security.kubernetes.io/warn: restricted
    pod-security.kubernetes.io/warn-version: v1.28
# Baseline enforcement for staging
apiVersion: v1
kind: Namespace
metadata:
  name: staging
  labels:
    pod-security.kubernetes.io/enforce: baseline
    pod-security.kubernetes.io/enforce-version: v1.28
    pod-security.kubernetes.io/audit: restricted
    pod-security.kubernetes.io/audit-version: v1.28
    pod-security.kubernetes.io/warn: restricted
    pod-security.kubernetes.io/warn-version: v1.28
# Privileged for system namespaces
apiVersion: v1
kind: Namespace
metadata:
  name: kube-system
  labels:
    pod-security.kubernetes.io/enforce: privileged

Apply Labels with kubectl

# Set restricted enforcement
kubectl label namespace production \
  pod-security.kubernetes.io/enforce=restricted \
  pod-security.kubernetes.io/enforce-version=v1.28 \
  pod-security.kubernetes.io/audit=restricted \
  pod-security.kubernetes.io/warn=restricted

# Set baseline enforcement
kubectl label namespace staging \
  pod-security.kubernetes.io/enforce=baseline \
  pod-security.kubernetes.io/audit=restricted \
  pod-security.kubernetes.io/warn=restricted

# Check current labels
kubectl get namespace production -o jsonpath='{.metadata.labels}' | jq .

Dry-Run Testing

# Test what would happen with restricted policy on a namespace
kubectl label --dry-run=server --overwrite namespace staging \
  pod-security.kubernetes.io/enforce=restricted

# Output shows existing pods that would violate the policy
# Warning: existing pods in namespace "staging" violate the new PodSecurity enforce level "restricted:latest"

Cluster-Wide Defaults (AdmissionConfiguration)

# /etc/kubernetes/psa-config.yaml
apiVersion: apiserver.config.k8s.io/v1
kind: AdmissionConfiguration
plugins:
  - name: PodSecurity
    configuration:
      apiVersion: pod-security.admission.config.k8s.io/v1

…
자주 묻는 질문

사용 가능한 보안 수준은 무엇인가요?

‘Privileged’(제한 없음), ‘Baseline’(최소한의 제한), ‘Restricted’(모범 사례에 따라 강하게 제한)의 세 가지 수준이 있습니다.

시행 모드에는 무엇이 있나요?

‘enforce’(위반하는 파드를 차단), ‘audit’(위반을 기록), ‘warn’(사용자에게 위반을 경고)이 있습니다.

추가로 설치해야 할 것이 있나요?

아니요, Pod Security Admission(PSA) 컨트롤러는 최신 Kubernetes 버전(v1.25 이상)에 이미 내장되어 있습니다.

상세 정보

작성자의 원본 설명

Configures and operates the Kubernetes Pod Security Admission (PSA) controller that enforces Pod Security Standards: namespace enforce/audit/warn labels, cluster-wide defaults via AdmissionConfiguration, exemptions for usernames, runtime classes and namespaces, version pinning, and troubleshooting pods the controller rejected. Use when wiring PSA up on a cluster, setting cluster-wide default enfor

repo: mukul975/Anthropic-Cybersecurity-Skills

인기도

GitHub 스타
35k
순위
#8097
라이선스
Apache-2.0
업데이트
2026. 8. 31.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬