155 lines
4.4 KiB
JSON
155 lines
4.4 KiB
JSON
{
|
|
"version": "1.1",
|
|
"id": "b4-header-trust-boundary",
|
|
"title": "헤더 도착과 인가 우회는 다르다",
|
|
"question": "같은 위조 헤더가 도착하는 것과 인가를 우회하는 것은 같은가",
|
|
"type": "architecture",
|
|
"direction": "LR",
|
|
"audience": [
|
|
"Forward-Auth 구조를 운영하는 엔지니어"
|
|
],
|
|
"summary": "동명 위조 헤더는 permitAll echo 까지 도착했지만 JWT 보호 경로는 401 이었다. 헤더 삭제는 이 실험대에서 적용하지 않은 미검증 처방이다.",
|
|
"alt": "외부 위조 헤더가 nginx 를 지나 permitAll echo 에서는 200으로 도착하지만 JWT 보호 경로에서는 401로 막히는 분기.",
|
|
"long_description": "위조 헤더는 app1.hyeonworks.com/api 의 permitAll echo 앱까지 그대로 도착했다. 같은 헤더로 JWT 를 요구하는 /api/me 와 /api/protected 를 호출하면 401이었다. 따라서 헤더 도착과 인가 우회는 다른 사건이다. proxy_set_header 로 먼저 지우는 것은 문서에 적힌 처방이지만 이 실험대에서는 적용하지 않아 미검증이다.",
|
|
"source_context": {
|
|
"document": "docs/keycloak-session-store/final/document.md",
|
|
"document_sha256": "28aef96a2bbb94fbb10ade26a71238fee62a5a4d9fa6e7749ae98cfd0a65e560",
|
|
"anchor": {
|
|
"kind": "heading",
|
|
"value": "B-4 · Edge 인가의 범위 (Q4)",
|
|
"line": 821
|
|
}
|
|
},
|
|
"composition": {
|
|
"profile": "component-flow",
|
|
"diagram_only": true,
|
|
"reference_ids": [
|
|
"payment-event-flow"
|
|
],
|
|
"rationale": "헤더가 어디서 설정되고 어디서 신뢰되는가가 지배적 질문이다. 신뢰 경계이므로 component-flow 를 골랐다."
|
|
},
|
|
"groups": [],
|
|
"nodes": [
|
|
{
|
|
"id": "attacker",
|
|
"label": "외부 위조 헤더",
|
|
"kind": "actor",
|
|
"role": "source",
|
|
"emphasis": "warning",
|
|
"description": "앱이 신뢰할 수 있는 이름과 같은 헤더를 보낸다.",
|
|
"details": [
|
|
"X-Auth-Request-Roles"
|
|
],
|
|
"evidence": [
|
|
{
|
|
"start_line": 823,
|
|
"end_line": 830
|
|
}
|
|
],
|
|
"assumption": false
|
|
},
|
|
{
|
|
"id": "nginx",
|
|
"label": "nginx",
|
|
"kind": "gateway",
|
|
"role": "control",
|
|
"emphasis": "warning",
|
|
"description": "설정하지 않은 동명 헤더를 덮어쓰지 않는다.",
|
|
"details": [
|
|
"동명 헤더 미삭제"
|
|
],
|
|
"evidence": [
|
|
{
|
|
"start_line": 829,
|
|
"end_line": 830
|
|
}
|
|
],
|
|
"assumption": false
|
|
},
|
|
{
|
|
"id": "echo",
|
|
"label": "permitAll echo",
|
|
"kind": "service",
|
|
"role": "target",
|
|
"emphasis": "normal",
|
|
"description": "위조 헤더가 도착하는 것을 관측한 경로다.",
|
|
"details": [
|
|
"/api/echo · HTTP 200"
|
|
],
|
|
"evidence": [
|
|
{
|
|
"start_line": 825,
|
|
"end_line": 840
|
|
}
|
|
],
|
|
"assumption": false
|
|
},
|
|
{
|
|
"id": "protected",
|
|
"label": "JWT 보호 경로",
|
|
"kind": "service",
|
|
"role": "target",
|
|
"emphasis": "primary",
|
|
"description": "같은 위조 헤더만으로는 통과하지 못했다.",
|
|
"details": [
|
|
"/api/me · /api/protected · 401"
|
|
],
|
|
"evidence": [
|
|
{
|
|
"start_line": 832,
|
|
"end_line": 840
|
|
}
|
|
],
|
|
"assumption": false
|
|
}
|
|
],
|
|
"edges": [
|
|
{
|
|
"id": "a-n",
|
|
"from": "attacker",
|
|
"to": "nginx",
|
|
"label": "위조 헤더",
|
|
"kind": "request",
|
|
"evidence": [
|
|
{
|
|
"start_line": 823,
|
|
"end_line": 830
|
|
}
|
|
],
|
|
"assumption": false
|
|
},
|
|
{
|
|
"id": "n-e",
|
|
"from": "nginx",
|
|
"to": "echo",
|
|
"label": "그대로 전달",
|
|
"kind": "request",
|
|
"evidence": [
|
|
{
|
|
"start_line": 825,
|
|
"end_line": 840
|
|
}
|
|
],
|
|
"assumption": false
|
|
},
|
|
{
|
|
"id": "n-p",
|
|
"from": "nginx",
|
|
"to": "protected",
|
|
"label": "같은 헤더",
|
|
"kind": "request",
|
|
"evidence": [
|
|
{
|
|
"start_line": 832,
|
|
"end_line": 840
|
|
}
|
|
],
|
|
"assumption": false
|
|
}
|
|
],
|
|
"legend": [],
|
|
"metadata": {
|
|
"rationale": "위조 헤더의 도착과 인가 우회를 한 경로로 합치지 않고, 같은 입력이 permitAll 과 JWT 보호 경로에서 갈리는 것을 그렸다. 헤더 삭제 처방은 미검증이므로 노드로 확정하지 않았다."
|
|
}
|
|
}
|