Files
document-haness/docs/clean-architecture-backend-template/tech-log-studio/drain-and-shutdown-ordering/case/case-the-last-step-of-secret-erasure-is-not-wired.md
T
DongHyeonkaandClaude Opus 5 b2963105a8 docs(keycloak-session-store): import the session-storage lab as a new project
The keycloak project ended with four open questions that design could not
settle. A two-VM lab was built to answer them by measurement, and this is
that material: 26 experiments, 125 raw command outputs, 22 browser captures.

Follows the import procedure in README.md.

  source/     the originating repository verbatim — 78 documents, 28 SVGs,
              8 manifests, plus .source-revision recording the commit
  final/      the SSOT
    document.md   729 lines written from the 29 experiment documents, not
                  concatenated: what was predicted, what was measured, and
                  where the measurement itself was wrong
    evidence/raw    125 outputs, flattened to <experiment>__<file> because
                    the originals collided (01-baseline.txt appeared three
                    times) and the audit only globs the top level
    evidence/meta   one per raw file; command and exitCode are null and the
                    README says why rather than inventing them
    evidence/browser  22 captures
    assets/       three diagrams through techviz
    .techviz/     their VizSpecs

A separate project rather than an addition to keycloak: the B-layer answers
that project's four questions, but the A, C and D layers are about cluster
failure, SSO and operations, and one document.md should hold one subject.
The four question records there can point here through 관계.

Recorded rather than papered over: only three of the 28 diagrams were
remade. The repository forbids hand-drawn SVG and forbids titles inside the
canvas; all 28 originals carry both, so converting them is redrawing, not
reformatting. They stay in source/ and the gap is written into the document.

verify-pipeline.py passes. audit-records.py reports no issues.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-04 22:51:59 +09:00

4.3 KiB

kind, slug, title, topic, project, status, sourceRevision, rootTreeNode, evidenceCapturedOn, assets, evidence, source
kind slug title topic project status sourceRevision rootTreeNode evidenceCapturedOn assets evidence source
CASE the-last-step-of-secret-erasure-is-not-wired 비밀을 힙에서 지우는 마지막 단계가 종료 경로에 연결되지 않았다 drain-and-shutdown-ordering clean-architecture-backend-template 게시 전 21234e38cdb9a926cbc92bb97a2aee2e4a7d2916 case:the-last-step-of-secret-erasure-is-not-wired 2026-09-01
key file
the-last-step-of-secret-erasure-is-not-wired ../../../final/evidence/rendered/the-last-step-of-secret-erasure-is-not-wired.svg
../../../final/evidence/raw/the-last-step-of-secret-erasure-is-not-wired.txt
원본 분석 절은 analysis/messaging/messaging-security.md §17 이다.

비밀을 힙에서 지우는 마지막 단계가 종료 경로에 연결되지 않았다

자격증명 레지스트리의 전체 소거 메서드가 종료용이라고 javadoc 에 적혀 있고 호출자가 저장소에 없다. 리프 전체가 비밀을 힙에 남기지 않기 위해 설계됐다.

관계

  • 8단계 종료 순서 계약과 실제 종료 경로 이 사례가 속한 구조다.
  • 순서 계약을 구현하는 것이 없고, 그것을 검증한다는 테스트는 enum 선언 순서만 본다 같은 계약이 구현되지 않았다는 사실의 구체적 결과 하나다.
  • 검증기는 발행이 아니라 주입이 강제다 같은 계열의 규칙이다.

문제

이 리프는 자격증명을 다루는 방식 전체가 하나의 목적을 향한다. 비밀을 문자열이 아니라 문자 배열로 들고, 쓰고 나면 그 배열을 지우고, 회전할 때 옛 값을 즉시 소거한다.

그 규율의 마지막 단계가 종료다. 프로세스가 끝날 때 아직 들고 있는 자격증명을 전부 지우는 메서드가 있다.

결론

그 메서드를 부르는 곳이 없다.

javadoc 은 용도를 명확히 적는다.

Clears every held credential, for shutdown

호출자를 저장소 전역에서 검색하면 선언과 테스트만 나온다.

프로세스가 끝나면 힙도 사라지므로 사소해 보인다. 그러나 이 통제가 겨냥하는 상황이 정확히 그 전제가 성립하지 않는 경우다. 종료가 느려서 힙이 오래 남거나, 종료 중에 덤프가 뜨거나, 컨테이너가 정지 상태로 유지되는 경우다.

8단계 종료 계약에 자격증명 소거에 해당하는 단계가 있고 그 단계를 수행하는 코드가 없다. 그러므로 이 사례는 계약이 구현되지 않았다는 사실의 구체적 결과 하나다.

검증 환경

OpenJDK : 21.0.12 Gradle : 9.0.0 확인 방식 : 전체 소거 메서드의 호출자 전수 검색 소스 수정 : x

재현 조건

  1. 자격증명 레지스트리에서 전체 소거 메서드와 그 javadoc 을 확인한다.
  2. 그 메서드 이름으로 저장소를 검색해 호출자를 센다.
  3. 종료 수명주기 클래스가 그것을 부르는지 확인한다.

본문

이 리프 전체가 "비밀이 힙에 남지 않게 한다" 를 목적으로 설계됐다 — 자격증명을 char[] 로 들고, 사용 후 clear() 하고, 회전 시 즉시 소거한다.

리프가 설계된 목적

:::evidence key="the-last-step-of-secret-erasure-is-not-wired" alt="분석 문서 analysis/messaging/messaging-security.md 에서 이 기록의 근거 절을 그대로 잘라낸 18줄. 코드베이스를 측정한 것이 아니라 원본 판정이 무엇을 적었는지를 보여 준다." caption="analysis/messaging/messaging-security.md 발췌 — 18줄" zoom="true" :::

마지막 단계에 호출자가 없다

clearAll() 의 javadoc 이 "Clears every held credential, for shutdown" 이라고 적고, 호출자가 저장소에 없다.

사소해 보이지만 겨냥한 상황이 그것이다

프로세스가 끝나면 힙도 사라지지만, 종료가 느리거나 힙 덤프가 뜨는 경우가 정확히 이 통제가 겨냥하는 상황이다. 8단계 종료 계약에 자격증명 소거 단계가 있고 그 단계를 수행하는 코드가 없다는 점에서, 이 사례는 계약이 구현되지 않았다는 사실의 구체적 결과 하나다.

확인하지 못한 것

힙 덤프로 잔존을 확인하지 않았다. 호출자 부재로 판정했다.