
Kubernetes DaemonSet으로 CVE-2026-31431(GHSA-2274-3hgr-wxv6)을 탐지 및 완화 — modprobe 블랙리스트를 통한 algif_aead LPE
심각도: 높음 (CVSS 7.8 — CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H)
CVE-2026-31431은 Linux 커널의 algif_aead 모듈(AF_ALG AEAD 암호화 소켓 인터페이스)에서 발생하는 로컬 권한 상승 취약점입니다. 권한이 낮은 로컬 사용자가 잘못된 인플레이스 버퍼 작업을 악용하여 전체 루트 액세스 권한을 얻을 수 있습니다. 업스트림 패치 이전의 Linux 커널을 실행하는 모든 AKS 노드 풀이 잠재적으로 영향을 받습니다.
algif_aead 모듈은 일반적인 Kubernetes 또는 AKS 워크로드에 필요하지 않습니다. 이를 블랙리스트에 등록하면 공격 표면이 완전히 제거됩니다.
각 Linux 노드에서 하나의 파드가 실행됩니다. 시작 시 그리고 이후 60초마다 각 파드는 다음을 수행합니다:
호스트에 /etc/modprobe.d/modprobe-CIS.conf 작성:
install algif_aead /bin/false
blacklist algif_aead
이는 재부팅 시 또는 modprobe를 통한 모듈 로드를 방지합니다.
/proc/modules 확인 (라이브 호스트 커널 모듈 목록 — 모든 컨테이너와 공유됨)에서 algif_aead를 검사합니다.
결과로 Kubernetes 노드에 레이블을 지정하여 클러스터 전체에서 쿼리할 수 있게 합니다:
| 레이블 값 | 의미 |
|---|---|
mitigated | 모듈이 로드되지 않음; 블랙리스트 구성 적용됨 |
module-loaded | 모듈이 현재 로드됨 — 즉시 조사 필요 |
| 파일 | 용도 |
|---|---|
rbac.yaml | 네임스페이스, ServiceAccount, ClusterRole(get/patch 노드), ClusterRoleBinding |
configmap.yaml | 모든 파드에 마운트되는 셸 완화 스크립트 |
kubectl매니페스트를 순서대로 적용합니다:
kubectl apply -f rbac.yaml
kubectl apply -f configmap.yaml
kubectl apply -f daemonset.yaml
모든 노드에서 롤아웃이 완료될 때까지 기다립니다:
kubectl -n security-remediation rollout status daemonset/cve-2026-31431-remediator
kubectl get nodes -L vulnerability.aks.io/CVE-2026-31431
깨끗한 클러스터에서의 예상 출력:
NAME STATUS ROLES AGE VERSION CVE-2026-31431
aks-nodepool1-xxxxx-vmss000000 Ready <none> 4d v1.33.7 mitigated
aks-nodepool1-xxxxx-vmss000001 Ready <none> 4d v1.33.7 mitigated
# 파드 및 할당된 노드 나열
kubectl -n security-remediation get pods -o wide
# 특정 파드의 로그 추적
kubectl -n security-remediation logs <pod-name> -f
예상 로그 출력:
2026-05-01T01:33:36Z [INFO ] CVE-2026-31431 remediator starting on node: aks-nodepool1-...
2026-05-01T01:33:36Z [INFO ] Blacklist config written → /host/etc/modprobe.d/modprobe-CIS.conf
2026-05-01T01:33:36Z [INFO ] Node aks-nodepool1-...: 'algif_aead' is NOT loaded — blacklist config applied, node is mitigated.
2026-05-01T01:33:36Z [INFO ] Labeled node aks-nodepool1-...: vulnerability.aks.io/CVE-2026-31431=mitigated
2026-05-01T01:33:36Z [INFO ] Entering monitoring loop (interval: 60s)
kubectl -n security-remediation exec <pod-name> -- cat /host/etc/modprobe.d/modprobe-CIS.conf
예상 내용:
# CIS hardening – mitigate CVE-2026-31431 (GHSA-2274-3hgr-wxv6)
# Prevents algif_aead (AF_ALG AEAD) LPE from being loaded or exploited.
install algif_aead /bin/false
blacklist algif_aead
노드가 module-loaded를 표시하면 커널 모듈이 현재 활성 상태이며 노드가 이미 손상되었을 수 있습니다. 포렌식 분석을 위해 노드를 즉시 cordon 및 drain하십시오:
# 영향을 받는 노드 찾기
kubectl get nodes -l vulnerability.aks.io/CVE-2026-31431=module-loaded
# 조사를 위해 cordon 및 drain
kubectl cordon <node-name>
kubectl drain <node-name> --ignore-daemonsets --delete-emptydir-data
참고: DaemonSet을 제거해도 호스트 노드에서
/etc/modprobe.d/modprobe-CIS.conf파일은 제거되지 않습니다. 해당 파일은 지속적인 커널 강화 조치로 의도적으로 남겨집니다.
kubectl delete -f daemonset.yaml
kubectl delete -f configmap.yaml
kubectl delete -f rbac.yaml
이렇게 하면 DaemonSet, 모든 파드, ConfigMap, ServiceAccount, ClusterRole, ClusterRoleBinding 및 네임스페이스가 삭제됩니다.
kubectl label nodes --all vulnerability.aks.io/CVE-2026-31431-
대체 완화 조치(패치된 커널)가 있는 경우에만 수행하십시오. 각 노드에서 또는 권한 있는 파드를 통해 실행합니다:
rm -f /etc/modprobe.d/modprobe-CIS.conf
runAsUser: 0) — 호스트의 /etc/modprobe.d/에 쓰기 위해 필요합니다.capabilities.drop: ["ALL"]). 커널 capabilities는 필요하지 않습니다.readOnlyRootFilesystem: true**로 실행됩니다. 마운트된 hostPath 및 emptyDir 볼륨만 쓰기 가능합니다./etc/modprobe.d/뿐입니다 — /etc, /proc 또는 더 넓은 경로는 아닙니다.curl 바이너리와 해당 공유 라이브러리는 init 컨테이너에 의해 emptyDir(/tools)에 스테이징되어 기본 컨테이너가 rootfs에 대한 쓰기 액세스 없이 Kubernetes API를 호출할 수 있습니다.nodes에 대한 및 만.daemonset.yaml | DaemonSet 정의 — Linux 노드당 하나의 파드 |
getpatch