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>
119 lines
10 KiB
XML
119 lines
10 KiB
XML
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="1294" viewBox="0 0 1200 1294" role="img">
|
|
<title>terminal evidence</title>
|
|
<desc>Terminal-style rendering generated from retained command output. Sensitive-looking values are redacted in the visual asset.</desc>
|
|
<rect x="1" y="1" width="1198" height="1292" rx="14" fill="#0d1117" stroke="#30363d"/>
|
|
<rect x="1" y="1" width="1198" height="44" rx="14" fill="#161b22"/>
|
|
<rect x="1" y="30" width="1198" height="14" fill="#161b22"/>
|
|
<circle cx="24" cy="22" r="6" fill="#ff5f57"/>
|
|
<circle cx="44" cy="22" r="6" fill="#febc2e"/>
|
|
<circle cx="64" cy="22" r="6" fill="#28c840"/>
|
|
<text x="92" y="27" fill="#8b949e" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace">terminal evidence</text>
|
|
<text x="24" y="68" fill="#c9d1d9" font-size="15" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">$ set -e
|
|
set -o pipefail
|
|
D=$(mktemp -d); trap 'rm -rf "$D"' EXIT
|
|
C=/shared/codebase/clean-architecture-backend-template
|
|
</tspan><tspan x="24" dy="22">N=$C/src/adapter/outbound/notification
|
|
CORE=$C/src/application-core
|
|
java -version 2>&1 | head -1
|
|
CP=$(find "$N/build/lib</tspan><tspan x="24" dy="22">s" "$CORE/build/libs" -name "*+21234e38cdb9.jar" 2>/dev/null | tr '\n' ':')
|
|
cat > "$D/AccessContextProbe.java" <<'JAVA'
|
|
</tspan><tspan x="24" dy="22">import dev.caskeleton.adapter.outbound.notification.platform.security.AesGcmContactPointProtector;
|
|
import dev.caskeleton</tspan><tspan x="24" dy="22">.application.notification.platform.contact.ContactPointValue;
|
|
import dev.caskeleton.application.notification.platform.co</tspan><tspan x="24" dy="22">ntact.EmailAddress;
|
|
import dev.caskeleton.application.notification.platform.security.AccessContext;
|
|
import dev.caskeleto</tspan><tspan x="24" dy="22">n.application.notification.platform.security.ProtectedContactPoint;
|
|
import dev.caskeleton.application.notification.platf</tspan><tspan x="24" dy="22">orm.security.SecretKeyMaterial;
|
|
import dev.caskeleton.application.notification.platform.security.SecretMaterialProvider;</tspan><tspan x="24" dy="22">
|
|
import dev.caskeleton.application.notification.platform.security.SecretPurpose;
|
|
import java.lang.reflect.Constructor;
|
|
i</tspan><tspan x="24" dy="22">mport java.lang.reflect.Field;
|
|
import java.util.Arrays;
|
|
|
|
public final class AccessContextProbe {
|
|
|
|
/** Deterministic ma</tspan><tspan x="24" dy="22">terial; the probe only needs the round trip to work. */
|
|
private static final SecretMaterialProvider KEYS =
|
|
new S</tspan><tspan x="24" dy="22">ecretMaterialProvider() {
|
|
@Override
|
|
public SecretKeyMaterial activeKey(SecretPurpose purpose) {
|
|
</tspan><tspan x="24" dy="22"> return material(purpose);
|
|
}
|
|
|
|
@Override
|
|
public SecretKeyMaterial keyById(String keyId) {
|
|
</tspan><tspan x="24" dy="22"> return material(
|
|
keyId.startsWith("mac") ? SecretPurpose.CONTACT_LOOKUP_HMAC
|
|
</tspan><tspan x="24" dy="22"> : SecretPurpose.CONTACT_ENCRYPTION);
|
|
}
|
|
|
|
private SecretKeyMaterial material(SecretPurpose pu</tspan><tspan x="24" dy="22">rpose) {
|
|
boolean hmac = purpose == SecretPurpose.CONTACT_LOOKUP_HMAC;
|
|
byte[] bytes = new byte[32];
|
|
</tspan><tspan x="24" dy="22"> Arrays.fill(bytes, hmac ? (byte) 0x22 : (byte) 0x11);
|
|
return new SecretKeyMaterial(hmac ? "mac-1" : "</tspan><tspan x="24" dy="22">enc-1", purpose, bytes);
|
|
}
|
|
};
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
AesGcmConta</tspan><tspan x="24" dy="22">ctPointProtector protector = new AesGcmContactPointProtector(KEYS);
|
|
ProtectedContactPoint stored = protector.protect</tspan><tspan x="24" dy="22">(EmailAddress.parse("user@example.com"));
|
|
|
|
System.out.println("[문맥을 바꿔 가며 같은 값을 복호화한다]");
|
|
Access</tspan><tspan x="24" dy="22">Context[] contexts = {
|
|
AccessContext.dispatch("ses-primary"),
|
|
new AccessContext("BREAK_GLASS", "operator@exa</tspan><tspan x="24" dy="22">mple.com", true),
|
|
new AccessContext("SUPPORT_LOOKUP", "agent-42", true),
|
|
};
|
|
for (AccessContext context : c</tspan><tspan x="24" dy="22">ontexts) {
|
|
ContactPointValue revealed = protector.reveal(stored, context);
|
|
System.out.printf(
|
|
" p</tspan><tspan x="24" dy="22">urposeCode=%-14s auditRequired=%-5s -> %s%n",
|
|
context.purposeCode(), context.auditRequired(), revealed.getClas</tspan><tspan x="24" dy="22">s().getSimpleName());
|
|
}
|
|
System.out.println();
|
|
|
|
System.out.println("[복호화기가 들고 있는 협력자]");
|
|
for </tspan><tspan x="24" dy="22">(Constructor<?> constructor : AesGcmContactPointProtector.class.getDeclaredConstructors()) {
|
|
System.out.printf(" </tspan><tspan x="24" dy="22">생성자 인자 : %s%n",
|
|
Arrays.toString(Arrays.stream(constructor.getParameterTypes())
|
|
.map(Class::</tspan><tspan x="24" dy="22">getSimpleName).toArray()));
|
|
}
|
|
for (Field field : AesGcmContactPointProtector.class.getDeclaredFields()) {
|
|
</tspan><tspan x="24" dy="22">if (!field.getType().isPrimitive() && !field.getName().startsWith("$")) {
|
|
System.out.printf(" 필드 %-10s : %s%n</tspan><tspan x="24" dy="22">", field.getName(), field.getType().getSimpleName());
|
|
}
|
|
}
|
|
System.out.println();
|
|
|
|
System.out.println("[</tspan><tspan x="24" dy="22">dispatch 팩토리가 정하는 값]");
|
|
AccessContext dispatch = AccessContext.dispatch("ses-primary");
|
|
System.out.print</tspan><tspan x="24" dy="22">f(" purposeCode=%s actorRef=%s auditRequired=%s%n",
|
|
dispatch.purposeCode(), dispatch.actorRef(), dispatch.aud</tspan><tspan x="24" dy="22">itRequired());
|
|
}
|
|
}
|
|
JAVA
|
|
javac -encoding UTF-8 -cp "$CP" -d "$D" "$D/AccessContextProbe.java"
|
|
java -Dstdout.encoding=UT</tspan><tspan x="24" dy="22">F-8 -cp "$CP$D" AccessContextProbe
|
|
</tspan></text>
|
|
<text x="24" y="816" fill="#8b949e" font-size="13" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">cwd: /shared/codebase/clean-architecture-backend-template</tspan></text>
|
|
<text x="24" y="838" fill="#8b949e" font-size="13" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">time: 2026-09-02T14:58:28+00:00 · exit 0</tspan></text>
|
|
<line x1="24" y1="852" x2="1176" y2="852" stroke="#30363d"/>
|
|
<text x="24" y="892" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">openjdk version "21.0.12" 2026-07-21</tspan></text>
|
|
<text x="24" y="914" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">[문맥을 바꿔 가며 같은 값을 복호화한다]</tspan></text>
|
|
<text x="24" y="936" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"> purposeCode=DISPATCH auditRequired=false -> EmailAddress</tspan></text>
|
|
<text x="24" y="958" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"> purposeCode=BREAK_GLASS auditRequired=true -> EmailAddress</tspan></text>
|
|
<text x="24" y="980" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"> purposeCode=SUPPORT_LOOKUP auditRequired=true -> EmailAddress</tspan></text>
|
|
<text x="24" y="1002" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"></tspan></text>
|
|
<text x="24" y="1024" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">[복호화기가 들고 있는 협력자]</tspan></text>
|
|
<text x="24" y="1046" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"> 생성자 인자 : [SecretMaterialProvider]</tspan></text>
|
|
<text x="24" y="1068" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"> 생성자 인자 : [SecretMaterialProvider, SecureRandom]</tspan></text>
|
|
<text x="24" y="1090" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"> 필드 CIPHER : String</tspan></text>
|
|
<text x="24" y="1112" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"> 필드 HMAC : String</tspan></text>
|
|
<text x="24" y="1134" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"> 필드 KEY_ALGORITHM : String</tspan></text>
|
|
<text x="24" y="1156" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"> 필드 keys : SecretMaterialProvider</tspan></text>
|
|
<text x="24" y="1178" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"> 필드 random : SecureRandom</tspan></text>
|
|
<text x="24" y="1200" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"></tspan></text>
|
|
<text x="24" y="1222" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0">[dispatch 팩토리가 정하는 값]</tspan></text>
|
|
<text x="24" y="1244" fill="#e6edf3" font-size="14" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" xml:space="preserve"><tspan x="24" dy="0"> purposeCode=DISPATCH actorRef=ses-primary auditRequired=false</tspan></text>
|
|
</svg>
|