121 lines
3.1 KiB
JSON
121 lines
3.1 KiB
JSON
{
|
|
"version": "1.1",
|
|
"id": "d3-secret-exposure",
|
|
"title": "base64 는 암호화가 아니다",
|
|
"question": "Secret 에 넣으면 값이 가려지는가",
|
|
"type": "architecture",
|
|
"direction": "LR",
|
|
"audience": [
|
|
"쿠버네티스에 비밀을 두는 엔지니어"
|
|
],
|
|
"summary": "etcd 에 평문으로 있고 파드 안에서는 환경 변수로 그대로 읽힌다.",
|
|
"alt": "Secret 의 값이 base64 디코드와 파드 환경 변수 두 경로로 모두 평문에 닿는 구성.",
|
|
"long_description": "kubectl get secret -o yaml 이 보여주는 base64 는 인코딩이지 암호화가 아니다. etcd 에 평문으로 있다. 그리고 파드 안에서 env 를 grep 하면 그대로 나온다. 값을 Secret 에 넣었다는 것과 값이 가려졌다는 것은 다른 사건이다.",
|
|
"source_context": {
|
|
"document": "docs/keycloak-session-store/final/document.md",
|
|
"document_sha256": "28aef96a2bbb94fbb10ade26a71238fee62a5a4d9fa6e7749ae98cfd0a65e560",
|
|
"anchor": {
|
|
"kind": "heading",
|
|
"value": "D-3 · 비밀",
|
|
"line": 1015
|
|
}
|
|
},
|
|
"composition": {
|
|
"profile": "component-flow",
|
|
"diagram_only": true,
|
|
"reference_ids": [
|
|
"payment-event-flow"
|
|
],
|
|
"rationale": "값이 평문으로 드러나는 경로가 몇 개인가가 지배적 질문이다. 노출 경로이므로 component-flow 를 골랐다."
|
|
},
|
|
"groups": [],
|
|
"nodes": [
|
|
{
|
|
"id": "secret",
|
|
"label": "k8s Secret",
|
|
"kind": "datastore",
|
|
"role": "source",
|
|
"emphasis": "warning",
|
|
"description": "base64 로 담긴다.",
|
|
"details": [
|
|
"base64 인코딩"
|
|
],
|
|
"evidence": [
|
|
{
|
|
"start_line": 1002,
|
|
"end_line": 1006
|
|
}
|
|
],
|
|
"assumption": false
|
|
},
|
|
{
|
|
"id": "etcd",
|
|
"label": "etcd",
|
|
"kind": "datastore",
|
|
"role": "target",
|
|
"emphasis": "warning",
|
|
"description": "평문으로 있다.",
|
|
"details": [],
|
|
"evidence": [
|
|
{
|
|
"start_line": 1002,
|
|
"end_line": 1006
|
|
}
|
|
],
|
|
"assumption": false
|
|
},
|
|
{
|
|
"id": "pod",
|
|
"label": "파드 환경 변수",
|
|
"kind": "component",
|
|
"role": "target",
|
|
"emphasis": "warning",
|
|
"description": "env 로 그대로 읽힌다.",
|
|
"details": [
|
|
"env | grep -i secret"
|
|
],
|
|
"evidence": [
|
|
{
|
|
"start_line": 1002,
|
|
"end_line": 1006
|
|
}
|
|
],
|
|
"assumption": false
|
|
}
|
|
],
|
|
"edges": [
|
|
{
|
|
"id": "s-e",
|
|
"from": "secret",
|
|
"to": "etcd",
|
|
"label": "저장",
|
|
"kind": "write",
|
|
"evidence": [
|
|
{
|
|
"start_line": 1002,
|
|
"end_line": 1006
|
|
}
|
|
],
|
|
"assumption": false
|
|
},
|
|
{
|
|
"id": "s-p",
|
|
"from": "secret",
|
|
"to": "pod",
|
|
"label": "주입",
|
|
"kind": "write",
|
|
"evidence": [
|
|
{
|
|
"start_line": 1002,
|
|
"end_line": 1006
|
|
}
|
|
],
|
|
"assumption": false
|
|
}
|
|
],
|
|
"legend": [],
|
|
"metadata": {
|
|
"rationale": "인코딩과 암호화를 갈랐다. 두 경로 모두 끝이 평문이다."
|
|
}
|
|
}
|