본문으로 건너뛰기
Skillpedia
배포 및 클라우드 (DevOps)35k · #8067

implementing-kubernetes-pod-security-standards

하는 일

이 도구는 Kubernetes에서 실행되는 애플리케이션에 보안 규칙을 설정하고 적용하도록 돕습니다. ‘Privileged’(제한 없음), ‘Baseline’(알려진 위험 방지), ‘Restricted’(가장 안전하지만 제약이 많음)의 세 가지 수준 중에서 선택하도록 합니다.

사용하는 경우

  • ✓애플리케이션 묶음(네임스페이스)에 어떤 보안 수준을 적용할지 결정할 때.
  • ✓더 엄격한 규칙을 적용하면 어떤 애플리케이션에 문제가 생길지 확인할 때.
  • ✓오래된 보안 규칙을 새 규칙으로 업데이트할 계획을 세울 때.

스킬 링크

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

AI에게 요청하는 예시

“애플리케이션이 'Restricted' 프로파일로 실행되려면 어떤 변경을 해야 하나요?”

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

작동 방식

이 도구는 애플리케이션 묶음(네임스페이스)에 적용하는 ‘Pod Security Standards’(PSS)라는 설정을 사용합니다. 이 설정은 애플리케이션이 실행될 때 무엇이 허용되고 금지되는지 정의하여, 과도한 권한이나 알려진 취약점을 막습니다.

기술 내용 (원본 SKILL.md)

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

Implementing Kubernetes Pod Security Standards

Overview

Pod Security Standards (PSS) define three levels of security policies -- Privileged, Baseline, and Restricted -- enforced by the Pod Security Admission (PSA) controller built into Kubernetes 1.25+. PSA replaces the deprecated PodSecurityPolicy and provides namespace-level enforcement with three modes: enforce, audit, and warn.

When to Use

  • Deciding whether a namespace or workload belongs at Privileged, Baseline, or Restricted
  • Auditing which existing workloads would be rejected if Restricted were enforced today
  • Translating a "must meet Restricted" requirement into concrete securityContext changes
  • Planning a PodSecurityPolicy migration and predicting what will break before it does
  • Mapping pod security posture to a compliance control (NIST PR.PS-01, CIS Kubernetes)

Not this skill: configuring the controller that enforces these profiles — namespace labels, AdmissionConfiguration, exemptions, or debugging a pod PSA rejected. Use implementing-pod-security-admission-controller.

Prerequisites

  • Kubernetes cluster 1.25+ (PSA GA)
  • kubectl configured with cluster-admin access
  • Understanding of Linux capabilities and security contexts

Core Concepts

Three Security Profiles

Profile Purpose Restrictions
Privileged Unrestricted, system workloads None
Baseline Prevents known escalations No hostNetwork, hostPID, hostIPC, privileged containers, dangerous capabilities
Restricted Hardened best practices Non-root, drop ALL caps, seccomp required, read-only rootfs recommended

Three Enforcement Modes

Mode Behavior
enforce Rejects pods that violate the policy
audit Logs violations in audit log but allows pod
warn Returns warning to user but allows pod

Workflow

Step 1: Label Namespaces for PSA

# Restricted namespace - production workloads
apiVersion: v1
kind: Namespace
metadata:
  name: production
  labels:
    pod-security.kubernetes.io/enforce: restricted
    pod-security.kubernetes.io/enforce-version: latest
    pod-security.kubernetes.io/audit: restricted
    pod-security.kubernetes.io/audit-version: latest
    pod-security.kubernetes.io/warn: restricted
    pod-security.kubernetes.io/warn-version: latest
# Baseline namespace - general workloads
apiVersion: v1
kind: Namespace
metadata:
  name: staging
  labels:
    pod-security.kubernetes.io/enforce: baseline
    pod-security.kubernetes.io/enforce-version: latest
    pod-security.kubernetes.io/audit: restricted
    pod-security.kubernetes.io/audit-version: latest
    pod-security.kubernetes.io/warn: restricted
    pod-security.kubernetes.io/warn-version: latest
# Privileged namespace - system components only
apiVersion: v1
kind: Namespace
metadata:
  name: kube-system
  labels:
    pod-security.kubernetes.io/enforce: privileged
    pod-security.kubernetes.io/enforce-version: latest

Step 2: Apply Labels to Existing Namespaces

# Apply restricted enforcement to production
kubectl label namespace production \
  pod-security.kubernetes.io/enforce=restricted \
  pod-security.kubernetes.io/audit=restricted \
  pod-security.kubernetes.io/warn=restricted \
  --overwrite

# Apply baseline to staging with restricted warnings
kubectl label namespace staging \
  pod-security.kubernetes.io/enforce=baseline \
  pod-security.kubernetes.io/audit=restricted \
  pod-security.kubernetes.io/warn=restricted \
  --overwrite

# Check labels on all namespaces
kubectl get namespaces -L pod-security.kubernetes.io/enforce

Step 3: Create Compliant Pod Specs

# Restricted-compliant deployment
apiVersion: apps/v1
kind: Deployment
metadata:
  name: secure-app
  namespace: production
spec:
  replicas: 3
  selector:
    matchLabels:
      app: secure-app
  template:
    metadata:
      labels:
        app: secure-app
    spec:
      automountServiceAccountToken: false
      securityContext:
        runAsNonRoot: true
        runAsUser: 65534
        runAsGroup: 65534
        fsGroup: 65534
        seccompProfile:
          type: RuntimeDefault
      containers:
        - name: app
          image: myregistry.com/myapp:v1.0.0@sha256:abc123
          ports:
            - containerPort: 8080
              protocol: TCP
          securityContext:
            allowPrivilegeEscalation: false

…
자주 묻는 질문

Privileged, Baseline, Restricted 프로파일은 무엇인가요?

Privileged는 제한이 없습니다. Baseline은 애플리케이션이 알려진 보안 문제를 일으키는 것을 막습니다. Restricted는 가장 안전하며, 추가 권한 없이 더 안전한 설정으로 실행되어야 합니다.

새 규칙을 적용해도 애플리케이션이 작동할지 어떻게 알 수 있나요?

강제 적용하기 전에 ‘감사(audit)’나 ‘경고(warn)’ 모드에서 규칙을 테스트할 수 있습니다. 이렇게 하면 애플리케이션을 막지 않고 어떤 것이 규칙을 위반하는지 보고, 고칠 시간을 얻을 수 있습니다.

‘securityContext’란 무엇인가요?

실행 중인 애플리케이션의 보안 권한과 특성을 정의하는 Kubernetes 설정으로, 관리자 권한으로 실행할 수 있는지, 어떤 시스템 기능을 쓸 수 있는지 등을 포함합니다.

상세 정보

작성자의 원본 설명

Chooses and applies the correct Kubernetes Pod Security Standard (Privileged, Baseline, Restricted) for a workload: what each profile forbids, how to map existing workloads to a profile, which securityContext fields must change, and how to plan a PodSecurityPolicy-to-PSS migration without breaking running pods. Use when deciding which pod security profile a namespace or workload should run under,

repo: mukul975/Anthropic-Cybersecurity-Skills

인기도

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

이 스킬이 유용한가요?

0

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

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬