Squid에서 Active Directory와 함께 Kerberos 인증 오류 해결하기
Squid의 Kerberos 문제를 효과적으로 해결하려면 상세한 로깅을 활성화하세요. squid.conf 파일에 다음을 추가합니다:
debug_options ALL,1 33,2 28,2 50,2 # 인증, ACL, DNS
- 33: 인증, 28: ACL, 50: DNS, 84: 외부 ACL 도우미. 레벨은 0(심각한 오류)부터 9(전체 덤프)까지입니다.
로그 출력 설정을 구성합니다:
access_log stdio:/opt/squid/var/log/squid/access.log
cache_log stdio:/opt/squid/var/log/squid/cache.log
이 설정은 분석을 위해 GSS-API 및 Negotiate 인증 세부 정보를 기록합니다.
GSS에서 '잘못된 암호화 유형' 오류
로그 내용:
ERROR: Negotiate Authentication validating user. Result: {result=BH, notes={message=gss_accept_sec_context() failed: Unspecified GSS failure. Minor code may provide more information. Bad encryption type }}
원인: 클라이언트 측에서 캐시된 TGS 티켓이 오래된 키로 생성되어, Squid가 복호화할 수 없습니다.
PDC 에뮬레이터에서 실행할 조치
- PDC 에뮬레이터 확인:
Get-ADDomain | Select-Object PDCEmulator
- 오래된 SPN 확인 및 제거:
setspn -L squid
setspn -D HTTP/testSquidPc.domain.ru userAD
- Active Directory에서
userAD비밀번호 재설정.
- 새 keytab 생성:
ktpass /princ HTTP/[email protected] /mapuser [email protected] /crypto ALL /ptype KRB5_NT_PRINCIPAL /pass password /out C:\squid.keytab
- 강제 복제 실행:
repadmin /syncall /AdeP
Squid 서버에서 수행할 작업
systemctl stop squid
chown proxy:proxy /opt/squid/etc/squid.keytab
chmod 600 /opt/squid/etc/squid.keytab
klist -kte /opt/squid/etc/squid.keytab
클라이언트에서 수행할 작업
klist purge
Squid를 systemctl start squid로 다시 시작하면 일반적인 10~24시간 복제 지연을 회피할 수 있습니다.
'서비스 키 사용 불가' 오류
로그 항목:
ERROR: Negotiate Authentication validating user. Result: {result=BH, notes={message=gss_accept_sec_context() failed: Unspecified GSS failure. Minor code may provide more information. Service key not available }}
주요 원인:
- AD와 keytab 간 KVNO(Key Version Number) 불일치
- SPN 불일치 (FQDN vs 단축 이름)
KVNO 확인 방법
Squid 서버에서:
klist -kte /opt/squid/etc/squid.keytab
출력에는 KVNO, etype, principal 정보가 포함됩니다.
도메인 컨트롤러(파워셸):
Get-ADUser -Identity "userAD" -Properties msDS-KeyVersionNumber | Select-Object msDS-KeyVersionNumber
ktpass 명령 시 /vno <번호> 옵션을 사용해 KVNO를 일치시킵니다.
keytab 테스트
sudo -u proxy kinit -kt /opt/squid/etc/squid.keytab HTTP/testSquidPc.domain.ru
성공 시 출력 없음. 오류는 보통 Squid 보조 프로세스 시작 문제에서 발생합니다.
keytab 내 일반적인 etype 값:
- aes256-cts-hmac-sha1-96
- aes128-cts-hmac-sha1-96
- arcfour-hmac (레거시)
krb5.conf에서 암호화 설정 구성
'잘못된 암호화 유형' 오류 발생 시 /etc/krb5.conf에서 enctypes 동기화 필요:
[libdefaults]
default_tgs_enctypes = aes256-cts-hmac-sha1-96
default_tkt_enctypes = aes256-cts-hmac-sha1-96
permitted_enctypes = aes256-cts-hmac-sha1-96
allow_weak_crypto = true는 피하고, 정확한 AES 유형만 지정하세요. keytab에 폐기된 DES 또는 RC4가 포함되지 않았는지 확인합니다.
ICMP 핑거 오류
로그 내용:
pinger| Open icmp_sock: (1) Operation not permitted
ERROR: Unable to start ICMP pinger.
FATAL: Unable to open any ICMP sockets.
해결 방법: 원시 소켓 권한 부여:
setcap cap_net_raw+ep /opt/squid/libexec/pinger
Squid 재시작 후 적용됩니다.
핵심 요약
- 인증 추적을 위해
debug_options 33,2활성화. ktpass /vno와repadmin /syncall을 통해 keytab과 AD의 KVNO 동기화.- 클라이언트 티켓은
klist purge로 삭제. /etc/krb5.conf에서 AES256 사용, 약한 암호화 비활성화.- ICMP 오류 해결 시
setcap cap_net_raw+ep명령어를 pinger 바이너리에 적용.
— Editorial Team
아직 댓글이 없습니다.