
*sshole(CVE-2026-123158)에 노출된 sshd를 포함하는 Dockerfile을 찾습니다. CLI, pre-commit hook 및 GitHub Action.
*sshole (CVE-2026-123158)에 노출된 sshd를 포함하는 Dockerfile을, 빌드하거나 배포하기 전에 단 하나의 명령으로 찾아냅니다.
uvx check-sshole
현재 폴더 아래의 모든 Dockerfile을 스캔합니다. 설치도, Docker도,
네트워크 접근도 필요 없습니다. 오직 파일만 읽습니다. (pipx run check-sshole 또는
pip install check-sshole도 사용할 수 있습니다.)
.devcontainer/Dockerfile:2: sshd from 'openssh' on 'python:3.12-alpine3.15' accepts password logins: exposed to *sshole (CVE-2026-123158)
why: Alpine 3.15 never got a fixed openssh build
fix: turn password logins off: RUN echo 'PasswordAuthentication no' >> /etc/ssh/sshd_config
(or start sshd with -o PasswordAuthentication=no)
or: move to Alpine 3.16 or newer and require its fixed openssh build
more: https://sshhole.com/ (to silence, put '# check-sshole: ignore' above line 2)
services/sftp/Dockerfile:2: sshd from 'openssh-server' on 'alpine:3.22' accepts password logins: exposed to *sshole (CVE-2026-123158)
why: a fresh build may pull the fixed package, but nothing here requires it; older or cached builds have the bug
fix: turn password logins off: RUN echo 'PasswordAuthentication no' >> /etc/ssh/sshd_config
(or start sshd with -o PasswordAuthentication=no)
or: if you need password logins, require a fixed build: apk add 'openssh-server>=10.0_p1-r11'
more: https://sshhole.com/ (to silence, put '# check-sshole: ignore' above line 2)
check-sshole: 2 findings in 3 Dockerfiles
*sshole은 PAM 없이 musl libc에 대해 빌드된 OpenSSH의 sshd 10.6p2 이전 버전에서 발생하는 비밀번호 인증 우회 취약점입니다. Alpine이 기본 openssh-server를 빌드하는 방식이 이와 같으므로, apk로 sshd를 설치하고 비밀번호 로그인을 켜둔 채(OpenSSH 기본값) 두는 컨테이너가 노출됩니다. 비밀번호 필드가 *인 계정(키 전용 사용자 및 Alpine의 root)이 위험 대상입니다. Debian, Ubuntu, RHEL 및 기타 glibc 이미지는 영향을 받지 않습니다.
check-sshole은 다음 조건이 모두 참일 때 Dockerfile 스테이지를 표시합니다:
| 조건 | check-sshole이 확인하는 항목 |
|---|---|
| sshd가 설치됨 | shell 형식, exec 형식, sh -c 및 heredoc에서의 apk add openssh, openssh-server, openssh-server-pam 또는 openssh-server-krb5; apk del이 뒤따르는 경우 |
| 베이스가 musl임 | 스테이지가 apk를 사용하며 Wolfi/Chainguard가 아님(이들은 glibc임) |
| 비밀번호 로그인이 켜져 있음 | RUN, CMD/ENTRYPOINT(sshd -o …), 저장소에서 COPY된 sshd 설정 파일 또는 COPY heredoc에서 PasswordAuthentication no 또는 비밀번호 없는 AuthenticationMethods를 설정하는 항목이 없음; openssh-server-pam과 함께 UsePAM yes인 경우도 꺼진 것으로 간주됨 |
| 고정된 빌드가 필요하지 않음 | 패키지가 고정된 빌드로 고정(=, >=, ~)되어 있지 않음 |
멀티 스테이지 빌드도 추적합니다: 스테이지는 FROM <stage> 부모가 설치하고 구성한 것을 상속하며, 다른 스테이지가 기반으로 삼지 않는 스테이지만 검사합니다.
check-sshole # every Dockerfile under the current folder
check-sshole services/ Dockerfile # some folders and files
check-sshole --format json . # machine-readable
Dockerfile, Containerfile, Dockerfile.<anything> 및
<anything>.Dockerfile을 선택하고, .git, node_modules 및 virtualenv는 건너뜁니다.
지정한 파일은 이름이 무엇이든 검사됩니다.
| 종료 상태 | 의미 |
|---|---|
| 0 | 아무것도 발견되지 않음 |
| 1 | 하나 이상의 발견 사항 |
| 2 | 경로가 존재하지 않거나 읽을 수 없음 |
repos:
- repo: https://github.com/shenxianpeng/check-sshole
rev: v0.1.0
hooks:
- id: check-sshole
커밋이 건드린 Dockerfile뿐만 아니라 모든 Dockerfile을 한 번에 확인하려면:
pre-commit run check-sshole --all-files.
jobs:
check-sshole:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: shenxianpeng/[email protected]
# with:
# path: services/ Dockerfile # default: the whole repository
검사 결과는 풀 리퀘스트에 대한 주석과 작업 요약에 표시되며, 작업을 실패시킵니다. 이 액션은 러너 자체의 Python에서 실행되며 아무것도 설치하지 않습니다.
| 입력 | 기본값 | 의미 |
|---|---|---|
path | . | 검사할 파일 또는 폴더, 공백으로 구분 |
format | github | github(주석 및 작업 요약), text 또는 json |
| Alpine | 최초 수정 빌드 |
|---|---|
| edge | 10.6_p2-r0 |
| 3.24 | 10.3_p1-r2 |
| 3.23 | 10.2_p1-r1 |
| 3.22 | 10.0_p1-r11 |
| 3.21 | 9.9_p2-r1 |
| 3.20 | 9.7_p1-r6 |
| 3.19 | 9.6_p1-r3 |
| 3.18 | 9.3_p2-r4 |
| 3.17 | 9.1_p1-r7 |
| 3.16 | 9.0_p1-r6 |
| 3.15 및 이전 버전 | 없음: 비밀번호 로그인을 끄거나 더 새로운 브랜치로 이동하세요 |
출처: 각 *-stable 브랜치의 aports 커밋 "main/openssh: fix password authentication"(2026-11-05).
check-sshole은 Dockerfile을 읽기 때문에 기존 이미지에 실제로 무엇이 들어 있는지 볼 수 없습니다. 이미지를 확인하려면 설치된 빌드를 읽고 표와 비교하세요:
docker run --rm --entrypoint apk IMAGE list --installed openssh-server
# openssh-server-10.0_p1-r11 aarch64 {openssh} (SSH-OpenSSH) [installed]
sshd -V와 ssh -V은 Alpine 리비전(-r11)을 표시하지 않으며,
apk info -v은 버전을 출력하지 않으므로 apk list --installed를 사용하세요.
--no-cache 없이 이미지를 다시 빌드하면 오래된 취약한 레이어가 유지될 수 있습니다.
sshd를 설치하는 RUN 위의 줄에 # check-sshole: ignore을 넣거나,
전체 스테이지(및 그 위에 빌드된 스테이지)를 건너뛰려면 FROM 위에 넣으세요:
FROM alpine:3.22
# check-sshole: ignore (sshd only listens on the internal network)
RUN apk add --no-cache openssh-server
FROM linuxserver/openssh-server)나 엔트리포인트 스크립트가 런타임에 변경하는 sshd 설정은 확인하지 못합니다. 해당 이미지는 위 명령으로 점검하십시오.pip install -e '.[test]'
pytest --cov # fails below 100% coverage
릴리스는 vX.Y.Z 태그가 붙은 GitHub 릴리스를 게시하여 생성되며, 게시
워크플로가 패키지를 빌드하여 PyPI에 업로드합니다.