Skip to content

feat: 워크로드 securityContext 추가 (컨테이너 하드닝) (#61)#62

Merged
eomkyeongmun merged 1 commit into
mainfrom
feat/#61-securitycontext
Jun 1, 2026
Merged

feat: 워크로드 securityContext 추가 (컨테이너 하드닝) (#61)#62
eomkyeongmun merged 1 commit into
mainfrom
feat/#61-securitycontext

Conversation

@eomkyeongmun

Copy link
Copy Markdown
Contributor

closes #61

개요

모든 워크로드에 securityContext가 없던 문제(코드리뷰 #7)를 이미지 깨짐 위험이 없는 안전 부분집합으로 하드닝.

적용

워크로드 pod-level container-level
backend / ai / frontend / redis seccompProfile: RuntimeDefault allowPrivilegeEscalation: false + capabilities.drop: [ALL]
postgres seccompProfile: RuntimeDefault allowPrivilegeEscalation: false (drop ALL 제외)
  • 앱/redis는 포트 >1024라 NET_BIND_SERVICE 등 캡 불필요 → drop [ALL] 안전.
  • postgres는 공식 이미지가 root로 시작해 postgres 유저로 권한 드롭(CHOWN/SETUID 등 캡 필요) → drop ALL/runAsNonRoot 적용 시 initdb 실패하므로 제외, no_new_privs만 설정.

의도적으로 제외 (후속, 이미지 검증 필요)

  • runAsNonRoot: true / runAsUser — 각 ECR 이미지가 non-root 사용자를 지원하는지 Dockerfile 확인 후
  • readOnlyRootFilesystem: true — 앱이 쓰는 임시경로에 emptyDir 마운트 필요

base 적용 → kind/eks overlay 공통 상속. YAML 검증 완료.

🤖 Generated with Claude Code

- 전 워크로드 pod-level seccompProfile: RuntimeDefault
- backend/ai/frontend/redis 컨테이너: allowPrivilegeEscalation: false + capabilities.drop [ALL]
- postgres: allowPrivilegeEscalation: false만 (root→postgres 권한 드롭에 캡 필요해 drop ALL 제외)

runAsNonRoot/readOnlyRootFilesystem은 이미지 검증 후 별도 적용(깨짐 방지).
base에 적용 → kind/eks overlay 공통 상속.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@eomkyeongmun eomkyeongmun merged commit e653966 into main Jun 1, 2026
1 check passed
@eomkyeongmun eomkyeongmun deleted the feat/#61-securitycontext branch June 1, 2026 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: 워크로드에 securityContext 추가 (컨테이너 하드닝, 안전 부분집합)

1 participant