refactor: 문서 개선 중

This commit is contained in:
donghyeon-ka
2026-09-21 14:30:55 +09:00
parent c93cdea150
commit 805a18f486
1497 changed files with 525837 additions and 59152 deletions
@@ -10,11 +10,11 @@ kubectl get secret -o yaml 이 보여주는 base64 는 인코딩이지 암호화
## Elements and evidence
- **k8s Secret** (datastore): base64 로 담긴다. Evidence: L495L501.
- **etcd** (datastore): 평문으로 있다. Evidence: L495L501.
- **파드 환경 변수** (component): env 로 그대로 읽힌다. Evidence: L495L501.
- **k8s Secret** (datastore): base64 로 담긴다. Evidence: L1002L1006.
- **etcd** (datastore): 평문으로 있다. Evidence: L1002L1006.
- **파드 환경 변수** (component): env 로 그대로 읽힌다. Evidence: L1002L1006.
## Relationships
- **k8s Secret → etcd:** 저장. Evidence: L495L501.
- **k8s Secret → 파드 환경 변수:** 주입. Evidence: L495L501.
- **k8s Secret → etcd:** 저장. Evidence: L1002L1006.
- **k8s Secret → 파드 환경 변수:** 주입. Evidence: L1002L1006.
@@ -1,6 +1,6 @@
# base64 는 암호화가 아니다
# Question: Secret 에 넣으면 값이 가려지는가
direction: down
direction: right
n0: "k8s Secret" {
shape: cylinder
}
@@ -1,5 +1,5 @@
digraph techviz {
graph [rankdir=TB, splines=ortho, nodesep=0.55, ranksep=0.85];
graph [rankdir=LR, splines=ortho, nodesep=0.55, ranksep=0.85];
node [fontname=Helvetica, fontsize=11, margin="0.18,0.12", style="rounded,filled", fillcolor=white, color="#2d4357", penwidth=1.5];
edge [fontname=Helvetica, fontsize=10, color="#364b5f", penwidth=1.4, arrowsize=0.75];
n0 [label="k8s Secret", shape=cylinder, style="rounded,filled"];
@@ -1,27 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<mxfile host="app.diagrams.net" modified="2026-07-23T00:00:00.000Z" agent="techviz-harness" version="24.7.17" type="device">
<diagram id="d3-secret-exposure" name="base64 는 암호화가 아니다">
<mxGraphModel dx="680" dy="388" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<mxGraphModel dx="680" dy="312" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="n_secret" value="k8s Secret&lt;br/&gt;base64 인코딩" tooltip="base64 로 담긴다. | Evidence: L495-L501" style="whiteSpace=wrap;html=1;rounded=1;strokeWidth=2;fontSize=14;fontStyle=1;fillColor=#ffffff;strokeColor=#2d4357;verticalAlign=middle;shape=cylinder3;boundedLbl=1;backgroundOutline=1;fillColor=#eef6fb;strokeColor=#d97706;fillColor=#fffdf5;" vertex="1" parent="1">
<mxGeometry x="187.0" y="60.0" width="150.0" height="97.0" as="geometry"/>
<mxCell id="n_secret" value="k8s Secret&lt;br/&gt;base64 인코딩" tooltip="base64 로 담긴다. | Evidence: L1002-L1006" style="whiteSpace=wrap;html=1;rounded=1;strokeWidth=2;fontSize=14;fontStyle=1;fillColor=#ffffff;strokeColor=#2d4357;verticalAlign=middle;shape=cylinder3;boundedLbl=1;backgroundOutline=1;fillColor=#eef6fb;strokeColor=#d97706;fillColor=#fffdf5;" vertex="1" parent="1">
<mxGeometry x="70.0" y="128.0" width="150.0" height="71.0" as="geometry"/>
</mxCell>
<mxCell id="n_etcd" value="etcd" tooltip="평문으로 있다. | Evidence: L495-L501" style="whiteSpace=wrap;html=1;rounded=1;strokeWidth=2;fontSize=14;fontStyle=1;fillColor=#ffffff;strokeColor=#2d4357;verticalAlign=middle;shape=cylinder3;boundedLbl=1;backgroundOutline=1;fillColor=#eef6fb;strokeColor=#d97706;fillColor=#fffdf5;" vertex="1" parent="1">
<mxGeometry x="70.0" y="253.0" width="150.0" height="90.0" as="geometry"/>
<mxCell id="n_etcd" value="etcd" tooltip="평문으로 있다. | Evidence: L1002-L1006" style="whiteSpace=wrap;html=1;rounded=1;strokeWidth=2;fontSize=14;fontStyle=1;fillColor=#ffffff;strokeColor=#2d4357;verticalAlign=middle;shape=cylinder3;boundedLbl=1;backgroundOutline=1;fillColor=#eef6fb;strokeColor=#d97706;fillColor=#fffdf5;" vertex="1" parent="1">
<mxGeometry x="392.0" y="60.0" width="150.0" height="64.0" as="geometry"/>
</mxCell>
<mxCell id="n_pod" value="파드 환경 변수&lt;br/&gt;env | grep -i secret" tooltip="env 로 그대로 읽힌다. | Evidence: L495-L501" style="whiteSpace=wrap;html=1;rounded=1;strokeWidth=2;fontSize=14;fontStyle=1;fillColor=#ffffff;strokeColor=#2d4357;verticalAlign=middle;strokeColor=#d97706;fillColor=#fffdf5;" vertex="1" parent="1">
<mxGeometry x="280.0" y="262.5" width="174.0" height="71.0" as="geometry"/>
<mxCell id="n_pod" value="파드 환경 변수&lt;br/&gt;env | grep -i secret" tooltip="env 로 그대로 읽힌다. | Evidence: L1002-L1006" style="whiteSpace=wrap;html=1;rounded=1;strokeWidth=2;fontSize=14;fontStyle=1;fillColor=#ffffff;strokeColor=#2d4357;verticalAlign=middle;strokeColor=#d97706;fillColor=#fffdf5;" vertex="1" parent="1">
<mxGeometry x="380.0" y="196.0" width="174.0" height="71.0" as="geometry"/>
</mxCell>
<mxCell id="e_s-e" value="저장" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeWidth=2;endArrow=block;endFill=1;" edge="1" parent="1" source="n_secret" target="n_etcd">
<mxGeometry relative="1" as="geometry">
<mxPoint x="199.0" y="177.0" as="offset"/>
<mxPoint x="330.0" y="123.2" as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="e_s-p" value="주입" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeWidth=2;endArrow=block;endFill=1;" edge="1" parent="1" source="n_secret" target="n_pod">
<mxGeometry relative="1" as="geometry">
<mxPoint x="319.0" y="181.8" as="offset"/>
<mxPoint x="324.0" y="202.0" as="offset"/>
</mxGeometry>
</mxCell>
</root>
@@ -6,10 +6,10 @@
{
"id": "edge-s-e",
"type": "arrow",
"x": 145.0,
"y": 157.0,
"width": 108.0,
"height": 96.0,
"x": 220.0,
"y": 92.0,
"width": 172.0,
"height": 62.5,
"angle": 0,
"strokeColor": "#1e1e1e",
"backgroundColor": "transparent",
@@ -32,20 +32,20 @@
"locked": false,
"points": [
[
108.0,
0.0,
62.5
],
[
86.0,
62.5
],
[
86.0,
0.0
],
[
108.0,
48.0
],
[
0.0,
48.0
],
[
0.0,
96.0
172.0,
0.0
]
],
"lastCommittedPoint": null,
@@ -66,8 +66,8 @@
{
"id": "edge-label-s-e",
"type": "text",
"x": 154.0,
"y": 165.0,
"x": 285.0,
"y": 111.25,
"width": 90,
"height": 24,
"angle": 0,
@@ -105,10 +105,10 @@
{
"id": "edge-s-p",
"type": "arrow",
"x": 271.0,
"y": 157.0,
"width": 96.0,
"height": 105.5,
"x": 220.0,
"y": 172.5,
"width": 160.0,
"height": 59.0,
"angle": 0,
"strokeColor": "#1e1e1e",
"backgroundColor": "transparent",
@@ -135,16 +135,16 @@
0.0
],
[
0.0,
52.75
80.0,
0.0
],
[
96.0,
52.75
80.0,
59.0
],
[
96.0,
105.5
160.0,
59.0
]
],
"lastCommittedPoint": null,
@@ -165,8 +165,8 @@
{
"id": "edge-label-s-p",
"type": "text",
"x": 274.0,
"y": 169.75,
"x": 279.0,
"y": 190.0,
"width": 90,
"height": 24,
"angle": 0,
@@ -204,10 +204,10 @@
{
"id": "node-secret",
"type": "rectangle",
"x": 187.0,
"y": 60.0,
"x": 70.0,
"y": 128.0,
"width": 150.0,
"height": 97.0,
"height": 71.0,
"angle": 0,
"strokeColor": "#1e1e1e",
"backgroundColor": "#e7f5ff",
@@ -234,10 +234,10 @@
{
"id": "node-label-secret",
"type": "text",
"x": 197.0,
"y": 70.0,
"x": 80.0,
"y": 138.0,
"width": 130.0,
"height": 77.0,
"height": 51.0,
"angle": 0,
"strokeColor": "#1e1e1e",
"backgroundColor": "transparent",
@@ -273,10 +273,10 @@
{
"id": "node-etcd",
"type": "rectangle",
"x": 70.0,
"y": 253.0,
"x": 392.0,
"y": 60.0,
"width": 150.0,
"height": 90.0,
"height": 64.0,
"angle": 0,
"strokeColor": "#1e1e1e",
"backgroundColor": "#e7f5ff",
@@ -303,10 +303,10 @@
{
"id": "node-label-etcd",
"type": "text",
"x": 80.0,
"y": 263.0,
"x": 402.0,
"y": 70.0,
"width": 130.0,
"height": 70.0,
"height": 44.0,
"angle": 0,
"strokeColor": "#1e1e1e",
"backgroundColor": "transparent",
@@ -342,8 +342,8 @@
{
"id": "node-pod",
"type": "rectangle",
"x": 280.0,
"y": 262.5,
"x": 380.0,
"y": 196.0,
"width": 174.0,
"height": 71.0,
"angle": 0,
@@ -372,8 +372,8 @@
{
"id": "node-label-pod",
"type": "text",
"x": 290.0,
"y": 272.5,
"x": 390.0,
"y": 206.0,
"width": 154.0,
"height": 51.0,
"angle": 0,
@@ -2,14 +2,14 @@
"harness_version": "0.2.0",
"spec_id": "d3-secret-exposure",
"spec_version": "1.1",
"spec_sha256": "b6167a15c39563b3cfa5ee200ba34a5cb23220b1c93428ad2bb399c48e3df240",
"spec_sha256": "532bea35bab3ea816b3ef815d338affa7e1247d0021ec375474137c7cda4e2e7",
"source_context": {
"document": "docs/keycloak-session-store/final/document.md",
"document_sha256": "1d44cba1905544d92f1d26ae36a8deb64a3db3914d6b488fd30d6ae7f8cfbabe",
"document_sha256": "28aef96a2bbb94fbb10ade26a71238fee62a5a4d9fa6e7749ae98cfd0a65e560",
"anchor": {
"kind": "heading",
"value": "D-3 · 비밀",
"line": 504
"line": 1015
}
},
"outputs": [
@@ -1,6 +1,6 @@
%% base64 는 암호화가 아니다
%% question: Secret 에 넣으면 값이 가려지는가
flowchart TB
flowchart LR
n0[("k8s Secret")]
n1[("etcd")]
n2["파드 환경 변수"]
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="680" height="388" viewBox="0 0 680 388" role="img" aria-labelledby="diagram-title diagram-description">
<svg xmlns="http://www.w3.org/2000/svg" width="680" height="312" viewBox="0 0 680 312" role="img" aria-labelledby="diagram-title diagram-description">
<title id="diagram-title">base64 는 암호화가 아니다</title>
<desc id="diagram-description">kubectl get secret -o yaml 이 보여주는 base64 는 인코딩이지 암호화가 아니다. etcd 에 평문으로 있다. 그리고 파드 안에서 env 를 grep 하면 그대로 나온다. 값을 Secret 에 넣었다는 것과 값이 가려졌다는 것은 다른 사건이다.</desc>
<metadata>{&quot;techviz&quot;:{&quot;spec_version&quot;:&quot;1.1&quot;,&quot;id&quot;:&quot;d3-secret-exposure&quot;,&quot;profile&quot;:&quot;component-flow&quot;},&quot;source_context&quot;:{&quot;document&quot;:&quot;docs/keycloak-session-store/final/document.md&quot;,&quot;document_sha256&quot;:&quot;1d44cba1905544d92f1d26ae36a8deb64a3db3914d6b488fd30d6ae7f8cfbabe&quot;,&quot;anchor&quot;:{&quot;kind&quot;:&quot;heading&quot;,&quot;value&quot;:&quot;D-3 · 비밀&quot;,&quot;line&quot;:504}},&quot;evidence_policy&quot;:&quot;Each factual element cites source lines or is marked assumption.&quot;,&quot;diagram_only&quot;:true}</metadata>
<metadata>{&quot;techviz&quot;:{&quot;spec_version&quot;:&quot;1.1&quot;,&quot;id&quot;:&quot;d3-secret-exposure&quot;,&quot;profile&quot;:&quot;component-flow&quot;},&quot;source_context&quot;:{&quot;document&quot;:&quot;docs/keycloak-session-store/final/document.md&quot;,&quot;document_sha256&quot;:&quot;28aef96a2bbb94fbb10ade26a71238fee62a5a4d9fa6e7749ae98cfd0a65e560&quot;,&quot;anchor&quot;:{&quot;kind&quot;:&quot;heading&quot;,&quot;value&quot;:&quot;D-3 · 비밀&quot;,&quot;line&quot;:1015}},&quot;evidence_policy&quot;:&quot;Each factual element cites source lines or is marked assumption.&quot;,&quot;diagram_only&quot;:true}</metadata>
<defs>
<marker id="arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
<path d="M 0 0 L 10 5 L 0 10 z" />
@@ -49,27 +49,27 @@
.timeline-detail { font-size: 11px; fill: #4b5563; text-anchor: middle; }
</style>
</defs>
<rect class="canvas" width="680" height="388" />
<polyline class="edge kind-write style-solid emphasis-normal" points="253.0,157.0 253.0,205.0 145.0,205.0 145.0,253.0" data-evidence="495-501" />
<rect class="edge-label-bg" x="177.0" y="163.0" width="44.0" height="22" rx="3" />
<text class="edge-label" x="199.0" y="178.0">저장</text>
<polyline class="edge kind-write style-solid emphasis-normal" points="271.0,157.0 271.0,209.8 367.0,209.8 367.0,262.5" data-evidence="495-501" />
<rect class="edge-label-bg" x="297.0" y="167.8" width="44.0" height="22" rx="3" />
<text class="edge-label" x="319.0" y="182.8">주입</text>
<rect class="canvas" width="680" height="312" />
<polyline class="edge kind-write style-solid emphasis-normal" points="220.0,154.5 306.0,154.5 306.0,92.0 392.0,92.0" data-evidence="1002-1006" />
<rect class="edge-label-bg" x="308.0" y="109.2" width="44.0" height="22" rx="3" />
<text class="edge-label" x="330.0" y="124.2">저장</text>
<polyline class="edge kind-write style-solid emphasis-normal" points="220.0,172.5 300.0,172.5 300.0,231.5 380.0,231.5" data-evidence="1002-1006" />
<rect class="edge-label-bg" x="302.0" y="188.0" width="44.0" height="22" rx="3" />
<text class="edge-label" x="324.0" y="203.0">주입</text>
<g id="node-secret">
<rect class="node-shape kind-datastore emphasis-warning role-source" data-evidence="495-501" x="187.0" y="73.0" width="150.0" height="71.0" /><ellipse class="node-shape kind-datastore emphasis-warning role-source" cx="262.0" cy="73.0" rx="75.0" ry="13.0" /><path class="storage-bottom" d="M 187.0 144.0 A 75.0 13.0 0 0 0 337.0 144.0" />
<text class="node-label" x="262.0" y="100.0">k8s Secret</text>
<line class="node-detail-divider" x1="201.0" y1="121.0" x2="323.0" y2="121.0" />
<text class="node-detail" x="203.0" y="138.0">base64 인코딩</text>
<rect class="node-shape kind-datastore emphasis-warning role-source" data-evidence="1002-1006" x="70.0" y="139.8" width="150.0" height="47.3" /><ellipse class="node-shape kind-datastore emphasis-warning role-source" cx="145.0" cy="139.8" rx="75.0" ry="11.8" /><path class="storage-bottom" d="M 70.0 187.2 A 75.0 11.8 0 0 0 220.0 187.2" />
<text class="node-label" x="145.0" y="155.0">k8s Secret</text>
<line class="node-detail-divider" x1="84.0" y1="176.0" x2="206.0" y2="176.0" />
<text class="node-detail" x="86.0" y="193.0">base64 인코딩</text>
</g>
<g id="node-etcd">
<rect class="node-shape kind-datastore emphasis-warning role-target" data-evidence="495-501" x="70.0" y="266.0" width="150.0" height="64.0" /><ellipse class="node-shape kind-datastore emphasis-warning role-target" cx="145.0" cy="266.0" rx="75.0" ry="13.0" /><path class="storage-bottom" d="M 70.0 330.0 A 75.0 13.0 0 0 0 220.0 330.0" />
<text class="node-label" x="145.0" y="296.0">etcd</text>
<rect class="node-shape kind-datastore emphasis-warning role-target" data-evidence="1002-1006" x="392.0" y="70.7" width="150.0" height="42.7" /><ellipse class="node-shape kind-datastore emphasis-warning role-target" cx="467.0" cy="70.7" rx="75.0" ry="10.7" /><path class="storage-bottom" d="M 392.0 113.3 A 75.0 10.7 0 0 0 542.0 113.3" />
<text class="node-label" x="467.0" y="90.0">etcd</text>
</g>
<g id="node-pod">
<rect class="node-shape kind-component emphasis-warning role-target" data-evidence="495-501" x="280.0" y="262.5" width="174.0" height="71.0" rx="7" />
<text class="node-label" x="367.0" y="289.5">파드 환경 변수</text>
<line class="node-detail-divider" x1="294.0" y1="310.5" x2="440.0" y2="310.5" />
<text class="node-detail" x="296.0" y="327.5">env | grep -i secret</text>
<rect class="node-shape kind-component emphasis-warning role-target" data-evidence="1002-1006" x="380.0" y="196.0" width="174.0" height="71.0" rx="7" />
<text class="node-label" x="467.0" y="223.0">파드 환경 변수</text>
<line class="node-detail-divider" x1="394.0" y1="244.0" x2="540.0" y2="244.0" />
<text class="node-detail" x="396.0" y="261.0">env | grep -i secret</text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB