Files
document-haness/docs/clean-architecture-backend-template/tech-log-studio/security-policy-enforcement/case/case-messaging-security-f01.md
T
DongHyeonkaandClaude Fable 5.1 b25357c48a docs(clean-architecture-backend-template): fold analysis into final and re-select one topic
- analysis/·source-index·state.json 을 final/document.md 제2부·제3부로 접었다. SSOT 는 하나다
- 파일럿 — commit-ambiguity-as-a-result 를 새 기준으로 재선별. 후보 14 → 글감 5
  (PROMOTE 5 · MERGE_INTO 3 · KEEP_IN_SSOT 4 · 보류 2). 기록 5건을 다시 썼고 그림 1개를
  techviz 로 만들었다
- 재선별이 잡은 것: 제1부 §6.2·§11.1 이 자기 §13.2 와 어긋나 있었다(레인을 안 돌렸다 vs
  돌렸다) — 정정. 이미 답이 나와 있던 Question 을 HEAD 재실행 질문으로 다시 세웠다.
  Concept 이 인용한 코드가 SSOT 에 없어 뺐다
- candidateScope·sourceRepository 기록. 나머지 43개 주제는 재선별 대기(PENDING 905)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-07 12:39:20 +09:00

93 lines
4.5 KiB
Markdown

---
kind: CASE
slug: messaging-security-f01
title: 같은 TLS posture를 두 클래스가 다른 엄격도로 검사한다
topic: security-policy-enforcement
project: clean-architecture-backend-template
status: 게시 전
sourceRevision: 21234e38cdb9a926cbc92bb97a2aee2e4a7d2916
rootTreeNode: case:messaging-security-f01
evidenceCapturedOn: 2026-09-01
assets:
- key: messaging-security-f01
file: ../../../final/evidence/rendered/messaging-security-f01.svg
- key: messaging-security-f01-diagram
file: ../../../final/assets/diagrams/messaging-security-f01.svg
evidence:
- ../../../final/evidence/raw/messaging-security-f01.txt
source:
- 원본 분석 절은 final/document.md#a19-messaging-security#L634 이다.
module: messaging-security
priority: P2
---
# 같은 TLS posture를 두 클래스가 다른 엄격도로 검사한다
MessageSecurityValidator는 hostname 검증을 production && !hostnameVerification일 때만 요구하고, BrokerTlsPolicy는 tlsEnabled && !hostnameVerification일 때 요구한다. 전자는 코드 없는 IllegalArgumentException, 후자는 안정 코드가 붙은 MessagingConfigurationException을 던진다.
## 관계
- **배선된 게이트는 자기 leaf 레인에서 검증한다**
같은 분석 리프에서 끌어낸 규칙이다.
- **같은 술어가 두 타입에 있으면 하나가 다른 하나를 부른다**
같은 분석 리프에서 끌어낸 규칙이다.
- **가변 필드로 상태 전이를 표현하면 가시성을 함께 정한다**
같은 분석 리프에서 끌어낸 규칙이다.
- **맵 갱신 함수 안에서 I/O를 하면 그 지연이 락 범위가 된다**
같은 분석 리프에서 끌어낸 규칙이다.
## 문제
MessageSecurityValidator는 hostname 검증을 production && !hostnameVerification일 때만 요구하고, BrokerTlsPolicy는 tlsEnabled && !hostnameVerification일 때 요구한다.
전자는 코드 없는 IllegalArgumentException, 후자는 안정 코드가 붙은 MessagingConfigurationException을 던진다.
## 결론
둘 다 같은 BrokerSecurityProfile을 받고, 후자만 어댑터에서 실제로 호출된다.
비운영에서 TLS를 켜고 hostname 검증을 끈 구성을 두 검사가 다르게 판정한다.
그리고 이 leaf 자신의 javadoc이 그 구성을 "looks encrypted in every dashboard while accepting any certificate a man in the middle presents"라고 부른다 — 즉 더 느슨한 쪽이 그 위험을 통과시킨다.
실패 형태도 달라서 운영자가 두 어휘를 알아야 한다.
## 검증 환경
OpenJDK : 21.0.12 java -version 으로 확인
Gradle : 9.0.0 src/gradle/wrapper/gradle-wrapper.properties 의 distributionUrl 로 확인
확인 방식 : MessageSecurityValidator 참조 7건 검색과 두 클래스의 검사 조건·예외 타입 대조
소스 수정 : x
## 재현 조건
원문은 final/document.md#a19-messaging-security#L634 에 있다.
## 본문
<!-- body:start -->
`MessageSecurityValidator`는 hostname 검증을 `production && !hostnameVerification`일 때만 요구하고, `BrokerTlsPolicy``tlsEnabled && !hostnameVerification`일 때 요구한다.
## 두 검사의 차이
:::evidence key="messaging-security-f01-diagram" alt="검증기 쪽에 production 일 때만과 코드 없는 예외가 빗금으로 놓이고 정책 쪽에 tls 켜지면 언제나와 안정 코드 예외가 놓인다" caption="두 검사의 차이" zoom="false"
:::
전자는 코드 없는 `IllegalArgumentException`, 후자는 안정 코드가 붙은 `MessagingConfigurationException`을 던진다.
## MessageSecurityValidator 참조 위치
:::evidence key="messaging-security-f01" alt="코드베이스에서 MessageSecurityValidator 를 검색한 출력 7줄. 이 기록이 세는 참조가 그 출력에 그대로 보인다." caption="MessageSecurityValidator 코드베이스 검색 — 7줄 · exit 0" zoom="true"
:::
## 느슨한 쪽이 위험을 통과시킨다
둘 다 같은 `BrokerSecurityProfile`을 받고, 후자만 어댑터에서 실제로 호출된다. 비운영에서 TLS를 켜고 hostname 검증을 끈 구성을 두 검사가 다르게 판정한다. 이 leaf 자신의 javadoc이 그 구성을 "looks encrypted in every dashboard while accepting any certificate a man in the middle presents"라고 부른다. 실패 형태도 달라서 운영자가 두 어휘를 알아야 한다.
## 확인하지 못한 것
validate 가 실제로 호출되는지 확인하지 못했다. starter 가 bean 을 만들고 같은 파일에서 직접 부를 가능성이 있으며, 그 leaf 가 답한다.
<!-- body:end -->