@xdev-asia/xdev-knowledge-mcp 1.0.36 → 1.0.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/content/series/{devsecops/bao-mat-du-lieu-y-te-cho-microservices/chapters/01-phan-1-nen-tang-bao-mat-du-lieu-y-te/lessons/01-bai-1-tong-quan-bao-mat-du-lieu-y-te-hipaa-hl7-fhir.md → architecture/xay-dung-he-thong-y-te-microservices/chapters/01-phan-1-kien-truc-nen-tang/lessons/01-bai-1-tong-quan-he-thong-y-te-yeu-cau-bao-mat.md} +29 -66
  2. package/content/series/{devsecops/bao-mat-du-lieu-y-te-cho-microservices/chapters/01-phan-1-nen-tang-bao-mat-du-lieu-y-te/lessons/02-bai-2-kien-truc-microservices-an-toan-cho-y-te.md → architecture/xay-dung-he-thong-y-te-microservices/chapters/01-phan-1-kien-truc-nen-tang/lessons/02-bai-2-thiet-ke-kien-truc-microservices-y-te.md} +40 -148
  3. package/content/series/architecture/xay-dung-he-thong-y-te-microservices/chapters/01-phan-1-kien-truc-nen-tang/lessons/03-bai-3-phan-loai-du-lieu-y-te-danh-gia-rui-ro.md +258 -0
  4. package/content/series/{devsecops/bao-mat-du-lieu-y-te-cho-microservices/chapters/01-phan-1-nen-tang-bao-mat-du-lieu-y-te/lessons/04-bai-4-threat-modeling-stride-dread-cho-his.md → architecture/xay-dung-he-thong-y-te-microservices/chapters/01-phan-1-kien-truc-nen-tang/lessons/04-bai-4-threat-modeling-stride-dread.md} +7 -5
  5. package/content/series/{devsecops/bao-mat-du-lieu-y-te-cho-microservices/chapters/02-phan-2-identity-access-management-keycloak/lessons/01-bai-5-thiet-ke-keycloak-realm-chuan-y-te.md → architecture/xay-dung-he-thong-y-te-microservices/chapters/02-phan-2-iam-keycloak/lessons/01-bai-5-setup-keycloak-realm-benh-vien.md} +6 -4
  6. package/content/series/{devsecops/bao-mat-du-lieu-y-te-cho-microservices/chapters/02-phan-2-identity-access-management-keycloak/lessons/02-bai-6-rbac-abac-phan-quyen-nhan-vien-y-te.md → architecture/xay-dung-he-thong-y-te-microservices/chapters/02-phan-2-iam-keycloak/lessons/02-bai-6-phan-quyen-rbac-abac.md} +7 -4
  7. package/content/series/{devsecops/bao-mat-du-lieu-y-te-cho-microservices/chapters/02-phan-2-identity-access-management-keycloak/lessons/03-bai-7-smart-on-fhir-oauth2-oidc-healthcare-apis.md → architecture/xay-dung-he-thong-y-te-microservices/chapters/02-phan-2-iam-keycloak/lessons/03-bai-7-smart-on-fhir-oauth2-oidc.md} +7 -4
  8. package/content/series/{devsecops/bao-mat-du-lieu-y-te-cho-microservices/chapters/02-phan-2-identity-access-management-keycloak/lessons/04-bai-8-mfa-passkeys-emergency-access-nhan-vien-y-te.md → architecture/xay-dung-he-thong-y-te-microservices/chapters/02-phan-2-iam-keycloak/lessons/04-bai-8-mfa-passkeys-emergency-access.md} +7 -4
  9. package/content/series/{devsecops/bao-mat-du-lieu-y-te-cho-microservices/chapters/03-phan-3-bao-mat-postgresql-du-lieu-y-te/lessons/01-bai-9-postgresql-security-hardening-toan-dien.md → architecture/xay-dung-he-thong-y-te-microservices/chapters/03-phan-3-data-layer-postgresql/lessons/01-bai-9-postgresql-security-hardening.md} +7 -5
  10. package/content/series/{devsecops/bao-mat-du-lieu-y-te-cho-microservices/chapters/03-phan-3-bao-mat-postgresql-du-lieu-y-te/lessons/02-bai-10-ma-hoa-du-lieu-at-rest-in-transit-postgresql.md → architecture/xay-dung-he-thong-y-te-microservices/chapters/03-phan-3-data-layer-postgresql/lessons/02-bai-10-ma-hoa-du-lieu-postgresql.md} +7 -4
  11. package/content/series/{devsecops/bao-mat-du-lieu-y-te-cho-microservices/chapters/03-phan-3-bao-mat-postgresql-du-lieu-y-te/lessons/03-bai-11-row-level-security-column-encryption-phi.md → architecture/xay-dung-he-thong-y-te-microservices/chapters/03-phan-3-data-layer-postgresql/lessons/03-bai-11-row-level-security-column-encryption.md} +7 -4
  12. package/content/series/{devsecops/bao-mat-du-lieu-y-te-cho-microservices/chapters/03-phan-3-bao-mat-postgresql-du-lieu-y-te → architecture/xay-dung-he-thong-y-te-microservices/chapters/03-phan-3-data-layer-postgresql}/lessons/04-bai-12-audit-logging-cdc-pgaudit.md +7 -4
  13. package/content/series/{devsecops/bao-mat-du-lieu-y-te-cho-microservices/chapters/04-phan-4-bao-mat-microservices-quarkus → architecture/xay-dung-he-thong-y-te-microservices/chapters/04-phan-4-microservices-quarkus}/lessons/01-bai-13-quarkus-security-oidc-jwt-rbac.md +6 -4
  14. package/content/series/{devsecops/bao-mat-du-lieu-y-te-cho-microservices/chapters/04-phan-4-bao-mat-microservices-quarkus → architecture/xay-dung-he-thong-y-te-microservices/chapters/04-phan-4-microservices-quarkus}/lessons/02-bai-14-api-gateway-rate-limiting-waf.md +7 -4
  15. package/content/series/{devsecops/bao-mat-du-lieu-y-te-cho-microservices/chapters/04-phan-4-bao-mat-microservices-quarkus/lessons/03-bai-15-ma-hoa-du-lieu-end-to-end-microservices.md → architecture/xay-dung-he-thong-y-te-microservices/chapters/04-phan-4-microservices-quarkus/lessons/03-bai-15-ma-hoa-end-to-end-microservices.md} +7 -5
  16. package/content/series/{devsecops/bao-mat-du-lieu-y-te-cho-microservices/chapters/04-phan-4-bao-mat-microservices-quarkus/lessons/04-bai-16-mtls-service-mesh-inter-service-communication.md → architecture/xay-dung-he-thong-y-te-microservices/chapters/04-phan-4-microservices-quarkus/lessons/04-bai-16-mtls-service-mesh.md} +7 -5
  17. package/content/series/{devsecops/bao-mat-du-lieu-y-te-cho-microservices/chapters/05-phan-5-compliance-audit-data-protection/lessons/01-bai-17-hipaa-technical-safeguards-implementation.md → architecture/xay-dung-he-thong-y-te-microservices/chapters/05-phan-5-compliance-audit/lessons/01-bai-17-hipaa-technical-safeguards.md} +7 -4
  18. package/content/series/{devsecops/bao-mat-du-lieu-y-te-cho-microservices/chapters/05-phan-5-compliance-audit-data-protection/lessons/02-bai-18-centralized-audit-trail-opentelemetry-elk.md → architecture/xay-dung-he-thong-y-te-microservices/chapters/05-phan-5-compliance-audit/lessons/02-bai-18-audit-trail-opentelemetry-elk.md} +6 -4
  19. package/content/series/{devsecops/bao-mat-du-lieu-y-te-cho-microservices/chapters/05-phan-5-compliance-audit-data-protection/lessons/03-bai-19-data-masking-anonymization-de-identification.md → architecture/xay-dung-he-thong-y-te-microservices/chapters/05-phan-5-compliance-audit/lessons/03-bai-19-data-masking-anonymization.md} +7 -4
  20. package/content/series/{devsecops/bao-mat-du-lieu-y-te-cho-microservices/chapters/05-phan-5-compliance-audit-data-protection/lessons/04-bai-20-backup-dr-business-continuity-du-lieu-y-te.md → architecture/xay-dung-he-thong-y-te-microservices/chapters/05-phan-5-compliance-audit/lessons/04-bai-20-backup-disaster-recovery.md} +7 -4
  21. package/content/series/{devsecops/bao-mat-du-lieu-y-te-cho-microservices/chapters/06-phan-6-nang-cao-va-du-an-thuc-hanh/lessons/01-bai-21-zero-trust-architecture-he-thong-y-te.md → architecture/xay-dung-he-thong-y-te-microservices/chapters/06-phan-6-production-van-hanh/lessons/01-bai-21-zero-trust-architecture.md} +7 -5
  22. package/content/series/{devsecops/bao-mat-du-lieu-y-te-cho-microservices/chapters/06-phan-6-nang-cao-va-du-an-thuc-hanh/lessons/02-bai-22-container-kubernetes-security-healthcare.md → architecture/xay-dung-he-thong-y-te-microservices/chapters/06-phan-6-production-van-hanh/lessons/02-bai-22-container-kubernetes-security.md} +8 -5
  23. package/content/series/{devsecops/bao-mat-du-lieu-y-te-cho-microservices/chapters/06-phan-6-nang-cao-va-du-an-thuc-hanh/lessons/03-bai-23-penetration-testing-vulnerability-assessment-y-te.md → architecture/xay-dung-he-thong-y-te-microservices/chapters/06-phan-6-production-van-hanh/lessons/03-bai-23-penetration-testing.md} +8 -5
  24. package/content/series/{devsecops/bao-mat-du-lieu-y-te-cho-microservices/chapters/06-phan-6-nang-cao-va-du-an-thuc-hanh/lessons/04-bai-24-capstone-xay-dung-secure-healthcare-platform.md → architecture/xay-dung-he-thong-y-te-microservices/chapters/06-phan-6-production-van-hanh/lessons/04-bai-24-capstone-deploy-production.md} +7 -5
  25. package/content/series/architecture/xay-dung-he-thong-y-te-microservices/index.md +376 -0
  26. package/package.json +1 -1
  27. package/content/series/devsecops/bao-mat-du-lieu-y-te-cho-microservices/chapters/01-phan-1-nen-tang-bao-mat-du-lieu-y-te/lessons/03-bai-3-phan-loai-du-lieu-y-te-phi-va-danh-gia-rui-ro.md +0 -375
  28. package/content/series/devsecops/bao-mat-du-lieu-y-te-cho-microservices/index.md +0 -441
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  id: 019e1a40-a101-7001-d001-f0a1b2c30101
3
- title: 'Bài 1: Tổng quan Bảo mật Dữ liệu Y Tế - HIPAA, HL7 FHIR & Luật Việt Nam'
4
- slug: bai-1-tong-quan-bao-mat-du-lieu-y-te-hipaa-hl7-fhir
3
+ title: 'Bài 1: Tổng quan Hệ thống Y tế & Yêu cầu Bảo mật — HIPAA, HL7 FHIR'
4
+ slug: bai-1-tong-quan-he-thong-y-te-yeu-cau-bao-mat
5
5
  description: >-
6
6
  Tìm hiểu tổng quan bảo mật dữ liệu y tế: khái niệm PHI/ePHI, các tiêu chuẩn
7
7
  quốc tế HIPAA (Privacy Rule, Security Rule, Breach Notification), HL7 FHIR
@@ -12,15 +12,17 @@ duration_minutes: 120
12
12
  is_free: true
13
13
  video_url: null
14
14
  sort_order: 1
15
- section_title: "Phần 1: Nền tảng Bảo mật Dữ liệu Y Tế"
15
+ section_title: "Phần 1: Kiến trúc & Nền tảng"
16
16
  course:
17
17
  id: 019e1a40-a100-7001-d001-f0a1b2c30001
18
- title: Bảo mật Dữ liệu Y Tế cho Hệ thống Microservices
19
- slug: bao-mat-du-lieu-y-te-cho-microservices
18
+ title: Xây dựng Hệ thống Y tế Microservices Quarkus, PostgreSQL, Keycloak chuẩn HIPAA
19
+ slug: xay-dung-he-thong-y-te-microservices
20
20
  ---
21
21
 
22
22
  ## 1. Tại sao Bảo mật Dữ liệu Y Tế quan trọng?
23
23
 
24
+ ![Tổng quan HIPAA Technical Safeguards — 5 danh mục kiểm soát bảo mật kỹ thuật](/storage/uploads/2026/04/healthcare-hipaa-safeguards-overview.png)
25
+
24
26
  Dữ liệu y tế là một trong những loại dữ liệu nhạy cảm nhất. Một bản ghi y tế (medical record) chứa thông tin cá nhân, lịch sử bệnh án, kết quả xét nghiệm, đơn thuốc, và thông tin bảo hiểm — tất cả đều có giá trị cao trên thị trường đen.
25
27
 
26
28
  ### Thống kê đáng lo ngại
@@ -126,29 +128,13 @@ Security Rule đặt ra yêu cầu bảo mật cho ePHI, chia thành 3 loại sa
126
128
 
127
129
  #### Technical Safeguards (focus chính của series này)
128
130
 
129
- ```
130
- ┌─────────────────────────────────────────────────────────────┐
131
- │ HIPAA Technical Safeguards │
132
- ├─────────────────┬───────────────────────────────────────────┤
133
- Access Control │ Unique User Identification (Required)
134
- │ │ Emergency Access Procedure (Required)
135
- │ │ Automatic Logoff (Addressable)
136
- │ │ • Encryption & Decryption (Addressable) │
137
- ├─────────────────┼───────────────────────────────────────────┤
138
- │ Audit Controls │ • Hardware, software, procedural │
139
- │ │ mechanisms to record and examine │
140
- │ │ access to ePHI (Required) │
141
- ├─────────────────┼───────────────────────────────────────────┤
142
- │ Integrity │ • Mechanism to authenticate ePHI │
143
- │ │ (Addressable) │
144
- ├─────────────────┼───────────────────────────────────────────┤
145
- │ Authentication │ • Person or Entity Authentication │
146
- │ │ (Required) │
147
- ├─────────────────┼───────────────────────────────────────────┤
148
- │ Transmission │ • Integrity Controls (Addressable) │
149
- │ Security │ • Encryption (Addressable) │
150
- └─────────────────┴───────────────────────────────────────────┘
151
- ```
131
+ | Danh mục | Controls |
132
+ |----------|----------|
133
+ | **Access Control** | Unique User Identification (Required), Emergency Access Procedure (Required), Automatic Logoff (Addressable), Encryption & Decryption (Addressable) |
134
+ | **Audit Controls** | Hardware, software, procedural mechanisms to record and examine access to ePHI (Required) |
135
+ | **Integrity** | Mechanism to authenticate ePHI (Addressable) |
136
+ | **Authentication** | Person or Entity Authentication (Required) |
137
+ | **Transmission Security** | Integrity Controls (Addressable), Encryption (Addressable) |
152
138
 
153
139
  > **Lưu ý**: "Required" = bắt buộc triển khai. "Addressable" = phải đánh giá và triển khai nếu hợp lý, hoặc document lý do không triển khai.
154
140
 
@@ -171,23 +157,14 @@ Khi xảy ra data breach liên quan đến PHI:
171
157
 
172
158
  FHIR định nghĩa các security components:
173
159
 
174
- ```
175
- ┌──────────────────────────────────────────┐
176
- │ FHIR Security Layers │
177
- ├──────────────────────────────────────────┤
178
- │ Communication Security (HTTPS/TLS) │
179
- ├──────────────────────────────────────────┤
180
- │ Authentication (OAuth2, SMART on FHIR) │
181
- ├──────────────────────────────────────────┤
182
- │ Authorization (Scopes, Consent) │
183
- ├──────────────────────────────────────────┤
184
- │ Audit (AuditEvent resource) │
185
- ├──────────────────────────────────────────┤
186
- │ Digital Signatures (Provenance) │
187
- ├──────────────────────────────────────────┤
188
- │ Consent Management (Consent resource) │
189
- └──────────────────────────────────────────┘
190
- ```
160
+ ![Các lớp bảo mật trong kiến trúc FHIR — từ Communication Security đến Consent Management](/storage/uploads/2026/04/healthcare-fhir-security-layers.png)
161
+
162
+ - **Communication Security**: HTTPS/TLS
163
+ - **Authentication**: OAuth2, SMART on FHIR
164
+ - **Authorization**: Scopes, Consent
165
+ - **Audit**: AuditEvent resource
166
+ - **Digital Signatures**: Provenance
167
+ - **Consent Management**: Consent resource
191
168
 
192
169
  ### 4.3. SMART on FHIR
193
170
 
@@ -237,27 +214,13 @@ Quy định về hồ sơ bệnh án điện tử:
237
214
 
238
215
  ### 6.1. NIST Cybersecurity Framework
239
216
 
240
- ```
241
- ┌──────────┐
242
- IDENTIFY Asset Management, Risk Assessment
243
- └────┬─────┘
244
-
245
- ┌──────────┐
246
- PROTECT │ Access Control, Data Security, Training
247
- └────┬─────┘
248
-
249
- ┌──────────┐
250
- │ DETECT │ → Anomalies, Monitoring, Detection Processes
251
- └────┬─────┘
252
-
253
- ┌──────────┐
254
- │ RESPOND │ → Response Planning, Communications, Mitigation
255
- └────┬─────┘
256
-
257
- ┌──────────┐
258
- │ RECOVER │ → Recovery Planning, Improvements, Communications
259
- └──────────┘
260
- ```
217
+ ![Vòng đời NIST Cybersecurity Framework — 5 chức năng: Identify, Protect, Detect, Respond, Recover](/storage/uploads/2026/04/healthcare-nist-csf-framework.png)
218
+
219
+ - **IDENTIFY**: Asset Management, Risk Assessment
220
+ - **PROTECT**: Access Control, Data Security, Training
221
+ - **DETECT**: Anomalies, Monitoring, Detection Processes
222
+ - **RESPOND**: Response Planning, Communications, Mitigation
223
+ - **RECOVER**: Recovery Planning, Improvements, Communications
261
224
 
262
225
  ### 6.2. ISO 27799 - Health Informatics Security
263
226
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  id: 019e1a40-a102-7001-d001-f0a1b2c30102
3
- title: 'Bài 2: Kiến trúc Microservices An toàn cho Y Tế với Quarkus Stack'
4
- slug: bai-2-kien-truc-microservices-an-toan-cho-y-te
3
+ title: 'Bài 2: Thiết kế Kiến trúc Microservices cho Y tế Quarkus Stack Blueprint'
4
+ slug: bai-2-thiet-ke-kien-truc-microservices-y-te
5
5
  description: >-
6
6
  Thiết kế kiến trúc microservices bảo mật cho hệ thống y tế sử dụng
7
7
  Quarkus, PostgreSQL, Keycloak. Bao gồm API Gateway pattern, service mesh,
@@ -11,15 +11,17 @@ duration_minutes: 150
11
11
  is_free: true
12
12
  video_url: null
13
13
  sort_order: 2
14
- section_title: "Phần 1: Nền tảng Bảo mật Dữ liệu Y Tế"
14
+ section_title: "Phần 1: Kiến trúc & Nền tảng"
15
15
  course:
16
16
  id: 019e1a40-a100-7001-d001-f0a1b2c30001
17
- title: Bảo mật Dữ liệu Y Tế cho Hệ thống Microservices
18
- slug: bao-mat-du-lieu-y-te-cho-microservices
17
+ title: Xây dựng Hệ thống Y tế Microservices Quarkus, PostgreSQL, Keycloak chuẩn HIPAA
18
+ slug: xay-dung-he-thong-y-te-microservices
19
19
  ---
20
20
 
21
21
  ## 1. Tổng quan Kiến trúc Healthcare Microservices
22
22
 
23
+ ![Kiến trúc tổng thể Healthcare Microservices — Quarkus, PostgreSQL, Keycloak, Kafka, Istio](/storage/uploads/2026/04/healthcare-ms-architecture-blueprint.png)
24
+
23
25
  ### 1.1. Tại sao Microservices cho Y Tế?
24
26
 
25
27
  Hệ thống y tế truyền thống (monolithic) gặp nhiều thách thức:
@@ -38,113 +40,37 @@ Microservices giải quyết bằng cách:
38
40
 
39
41
  ### 1.2. Healthcare Domain Services
40
42
 
41
- ```
42
- ┌─────────────────────────────────────────────────────────────────┐
43
- │ Healthcare Microservices │
44
- ├────────────┬────────────┬────────────┬────────────┬─────────────┤
45
- │ Patient │ Clinical │ Lab │ Pharmacy │ Billing │
46
- │ Service │ Service │ Service │ Service │ Service │
47
- │ │ (EMR) │ (LIS) │ │ │
48
- ├────────────┼────────────┼────────────┼────────────┼─────────────┤
49
- Patient │ Encounter│ Orders Prescr. │ Invoices │
50
- │ Registry Diagnosis│ Results │ Dispense │ • Insurance │
51
- Demo- │ Notes │ Specimens│ Drug DB │ • Claims │
52
- │ graphics Vitals │ Reports │ Interact │ • Payments │
53
- └────────────┴────────────┴────────────┴────────────┴─────────────┘
54
-
55
- ┌───────────────┼───────────────┐
56
- │ │ │
57
- ┌─────┴─────┐ ┌─────┴─────┐ ┌──────┴──────┐
58
- │ Scheduling │ │ Imaging │ │ Notification│
59
- │ Service │ │ Service │ │ Service │
60
- │ │ │ (RIS/ │ │ │
61
- │ • Appoint. │ │ PACS) │ │ • SMS/Email │
62
- │ • Calendar │ │ • Studies │ │ • Push │
63
- │ • Waitlist │ │ • Reports │ │ • Alerts │
64
- └────────────┘ └───────────┘ └─────────────┘
65
- ```
43
+ ![Tổng quan các Healthcare Microservices — 8 domain services chính trong hệ thống y tế](/storage/uploads/2026/04/healthcare-domain-services-grid.png)
44
+
45
+ **Core Services:**
46
+
47
+ | Service | Chức năng chính |
48
+ |---------|----------------|
49
+ | **Patient Service** | Patient Registry, Demographics |
50
+ | **Clinical Service (EMR)** | Encounters, Diagnosis, Notes, Vitals |
51
+ | **Lab Service (LIS)** | Orders, Results, Specimens, Reports |
52
+ | **Pharmacy Service** | Prescriptions, Dispensing, Drug DB |
53
+ | **Billing Service** | Invoices, Insurance, Claims, Payments |
54
+ | **Scheduling Service** | Appointments, Calendar, Waitlist |
55
+ | **Imaging Service (RIS/PACS)** | Studies, Reports |
56
+ | **Notification Service** | SMS/Email, Push, Alerts |
66
57
 
67
58
  ## 2. Reference Architecture: Secure Healthcare Platform
68
59
 
69
60
  ### 2.1. High-Level Architecture
70
61
 
71
- ```
72
- ┌─────────────────────────┐
73
- │ Internet/WAN │
74
- └───────────┬──────────────┘
75
-
76
- ┌───────────▼──────────────┐
77
- │ WAF/CDN │
78
- │ (Cloudflare/AWS WAF) │
79
- └───────────┬──────────────┘
80
-
81
- ┌───────────▼──────────────┐
82
- │ DMZ Network │
83
- │ ┌─────────────────────┐ │
84
- │ │ API Gateway │ │
85
- │ │ (Kong / APISIX) │ │
86
- │ └─────────┬───────────┘ │
87
- └────────────┼──────────────┘
88
-
89
- ┌────────────────────────┼────────────────────────┐
90
- │ Internal Network │
91
- │ │
92
- │ ┌──────────────┐ ┌──────────────┐ │
93
- │ │ Keycloak │ │ Service │ │
94
- │ │ Cluster │ │ Mesh │ │
95
- │ │ (IAM/SSO) │ │ (Istio) │ │
96
- │ └──────┬───────┘ └──────┬───────┘ │
97
- │ │ │ │
98
- │ ┌──────▼──────────────────▼───────┐ │
99
- │ │ Quarkus Microservices │ │
100
- │ │ ┌─────┐ ┌─────┐ ┌─────┐ │ │
101
- │ │ │Pati.│ │Clin.│ │Lab │ ... │ │
102
- │ │ └──┬──┘ └──┬──┘ └──┬──┘ │ │
103
- │ └─────┼───────┼───────┼───────────┘ │
104
- │ │ │ │ │
105
- │ ┌─────▼───────▼───────▼───────────┐ │
106
- │ │ Data Layer │ │
107
- │ │ ┌──────┐ ┌────┐ ┌─────┐ │ │
108
- │ │ │Postgr│ │Kafka│ │Redis │ │ │
109
- │ │ │ SQL │ │ │ │Cache │ │ │
110
- │ │ └──────┘ └────┘ └─────┘ │ │
111
- │ └─────────────────────────────────┘ │
112
- │ │
113
- │ ┌─────────────────────────────────┐ │
114
- │ │ Observability Stack │ │
115
- │ │ ┌─────┐ ┌──────┐ ┌──────┐ │ │
116
- │ │ │ELK │ │Prome.│ │Jaeger│ │ │
117
- │ │ │Stack│ │+Graf.│ │/Tempo│ │ │
118
- │ │ └─────┘ └──────┘ └──────┘ │ │
119
- │ └─────────────────────────────────┘ │
120
- └──────────────────────────────────────────────────┘
121
- ```
62
+ ![Kiến trúc tổng quan Healthcare Platform — từ Internet qua WAF, DMZ, API Gateway đến Internal Network](/storage/uploads/2026/04/healthcare-high-level-architecture.png)
122
63
 
123
64
  ### 2.2. Network Segmentation (Defense-in-Depth)
124
65
 
125
- ```
126
- Zone 1: DMZ (Demilitarized Zone)
127
- ├── API Gateway
128
- ├── Static content / CDN origin
129
- └── Reverse Proxy
130
-
131
- Zone 2: Application Zone
132
- ├── Quarkus Microservices
133
- ├── Keycloak
134
- └── Message Queue (Kafka)
135
-
136
- Zone 3: Data Zone (Most restricted)
137
- ├── PostgreSQL Clusters
138
- ├── Redis Cache
139
- ├── Backup Storage
140
- └── Key Management (Vault)
141
-
142
- Zone 4: Management Zone
143
- ├── Monitoring (Prometheus, Grafana)
144
- ├── Logging (ELK Stack)
145
- ├── CI/CD Pipeline
146
- └── Admin Access
147
- ```
66
+ ![Mô hình Defense-in-Depth với 4 vùng mạng — DMZ, Application, Data, Management](/storage/uploads/2026/04/healthcare-network-segmentation.png)
67
+
68
+ | Zone | Thành phần |
69
+ |------|------------|
70
+ | **Zone 1: DMZ** | API Gateway, Static content / CDN origin, Reverse Proxy |
71
+ | **Zone 2: Application** | Quarkus Microservices, Keycloak, Message Queue (Kafka) |
72
+ | **Zone 3: Data** (Most restricted) | PostgreSQL Clusters, Redis Cache, Backup Storage, Key Management (Vault) |
73
+ | **Zone 4: Management** | Monitoring (Prometheus, Grafana), Logging (ELK Stack), CI/CD Pipeline, Admin Access |
148
74
 
149
75
  **Firewall Rules giữa các zones:**
150
76
 
@@ -292,53 +218,19 @@ public class PatientResource {
292
218
 
293
219
  ### 4.1. Data Isolation Strategy
294
220
 
295
- ```
296
- Patient Service ──→ patient_db (PostgreSQL)
297
- ├── patients (demographics, contacts)
298
- ├── patient_consents
299
- └── patient_identifiers
300
-
301
- Clinical Service ──→ clinical_db (PostgreSQL)
302
- ├── encounters
303
- ├── diagnoses
304
- ├── clinical_notes (encrypted)
305
- └── vital_signs
306
-
307
- Lab Service ──→ lab_db (PostgreSQL)
308
- ├── lab_orders
309
- ├── lab_results (encrypted)
310
- ├── specimens
311
- └── reference_ranges
312
-
313
- Pharmacy Service ──→ pharmacy_db (PostgreSQL)
314
- ├── prescriptions
315
- ├── dispensing_records
316
- └── drug_interactions
317
-
318
- Audit Service ──→ audit_db (PostgreSQL - append-only)
319
- ├── audit_events (immutable)
320
- ├── access_logs
321
- └── security_incidents
322
- ```
221
+ ![Database-per-Service pattern — mỗi microservice có database riêng biệt với data isolation](/storage/uploads/2026/04/healthcare-database-per-service.png)
222
+
223
+ | Service | Database | Tables |
224
+ |---------|----------|--------|
225
+ | **Patient Service** | patient_db | patients (demographics, contacts), patient_consents, patient_identifiers |
226
+ | **Clinical Service** | clinical_db | encounters, diagnoses, clinical_notes (encrypted), vital_signs |
227
+ | **Lab Service** | lab_db | lab_orders, lab_results (encrypted), specimens, reference_ranges |
228
+ | **Pharmacy Service** | pharmacy_db | prescriptions, dispensing_records, drug_interactions |
229
+ | **Audit Service** | audit_db (append-only) | audit_events (immutable), access_logs, security_incidents |
323
230
 
324
231
  ### 4.2. Shared Data via Events (Event Sourcing)
325
232
 
326
- ```
327
- ┌──────────┐ ┌─────────┐ ┌──────────┐
328
- │ Patient │────▶│ Kafka │────▶│ Clinical │
329
- │ Service │ │ Topics │ │ Service │
330
- └──────────┘ │ │ └──────────┘
331
- │ patient.│
332
- │ created │────▶┌──────────┐
333
- │ patient.│ │ Lab │
334
- │ updated │ │ Service │
335
- │ patient.│ └──────────┘
336
- │ consent.│
337
- │ changed │────▶┌──────────┐
338
- └─────────┘ │ Pharmacy │
339
- │ Service │
340
- └──────────┘
341
- ```
233
+ ![Event-driven architecture — Patient Service publish events qua Kafka đến các consuming services](/storage/uploads/2026/04/healthcare-event-sourcing-kafka.png)
342
234
 
343
235
  > **Quan trọng**: Kafka messages chứa PHI phải được mã hóa. Sử dụng Kafka encryption at-rest và application-level encryption cho sensitive fields.
344
236
 
@@ -0,0 +1,258 @@
1
+ ---
2
+ id: 019e1a40-a103-7001-d001-f0a1b2c30103
3
+ title: 'Bài 3: Phân loại Dữ liệu Y tế (PHI/ePHI) & Đánh giá Rủi ro'
4
+ slug: bai-3-phan-loai-du-lieu-y-te-danh-gia-rui-ro
5
+ description: >-
6
+ Phân loại dữ liệu y tế theo mức độ nhạy cảm: PHI, ePHI, PII, dữ liệu
7
+ lâm sàng, dữ liệu hành chính. Xây dựng Data Classification Policy,
8
+ Data Flow Mapping, Risk Assessment theo NIST SP 800-30, và thiết lập
9
+ Risk Register cho hệ thống microservices y tế.
10
+ duration_minutes: 120
11
+ is_free: true
12
+ video_url: null
13
+ sort_order: 3
14
+ section_title: "Phần 1: Kiến trúc & Nền tảng"
15
+ course:
16
+ id: 019e1a40-a100-7001-d001-f0a1b2c30001
17
+ title: Xây dựng Hệ thống Y tế Microservices — Quarkus, PostgreSQL, Keycloak chuẩn HIPAA
18
+ slug: xay-dung-he-thong-y-te-microservices
19
+ ---
20
+
21
+ ## 1. Data Classification Framework cho Y Tế
22
+
23
+ ![Kim tự tháp phân loại dữ liệu y tế — 4 cấp độ từ Public đến Restricted](/storage/uploads/2026/04/healthcare-data-classification-pyramid.png)
24
+
25
+ ### 1.1. Tại sao cần phân loại dữ liệu?
26
+
27
+ Không phải tất cả dữ liệu đều cần cùng mức độ bảo vệ. Phân loại dữ liệu giúp:
28
+
29
+ - **Tối ưu chi phí bảo mật**: Tập trung resources vào dữ liệu quan trọng nhất
30
+ - **Tuân thủ pháp luật**: Áp dụng đúng controls theo yêu cầu quy định
31
+ - **Giảm attack surface**: Hạn chế phạm vi dữ liệu nhạy cảm
32
+ - **Incident response**: Ưu tiên xử lý khi xảy ra breach
33
+
34
+ ### 1.2. Healthcare Data Classification Levels
35
+
36
+ ![Kim tự tháp phân loại dữ liệu y tế — 4 mức từ Public đến Restricted](/storage/uploads/2026/04/healthcare-data-classification-levels.png)
37
+
38
+ | Level | Tên | Ví dụ | Encryption | Access | Audit |
39
+ |-------|-----|--------|------------|--------|-------|
40
+ | **4 - RESTRICTED** | Hạn chế tối đa | HIV/AIDS, sức khỏe tâm thần, di truyền, điều trị nghiện, sức khỏe sinh sản | Required (AES-256) | Named individuals only | Full logging, real-time alerts |
41
+ | **3 - CONFIDENTIAL** | Bảo mật | Hồ sơ bệnh án, xét nghiệm, đơn thuốc, chẩn đoán hình ảnh, BHYT | Required (AES-256) | Role-based (treating clinicians) | Full logging |
42
+ | **2 - INTERNAL** | Nội bộ | Lịch hẹn, thống kê (ẩn danh), nhân viên y tế, cấu hình | Recommended | Department-based | Standard logging |
43
+ | **1 - PUBLIC** | Công khai | Danh mục dịch vụ, giờ làm việc, liên hệ bệnh viện, hướng dẫn SK | Not required | Public | Basic logging |
44
+
45
+ ### 1.3. Data Classification trong PostgreSQL Schema
46
+
47
+ ```sql
48
+ -- Data classification metadata table
49
+ CREATE TABLE data_classification (
50
+ id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
51
+ schema_name VARCHAR(100) NOT NULL,
52
+ table_name VARCHAR(100) NOT NULL,
53
+ column_name VARCHAR(100) NOT NULL,
54
+ classification_level INTEGER NOT NULL CHECK (classification_level BETWEEN 1 AND 4),
55
+ classification_label VARCHAR(50) NOT NULL,
56
+ contains_phi BOOLEAN DEFAULT false,
57
+ encryption_required BOOLEAN DEFAULT false,
58
+ masking_rule VARCHAR(100),
59
+ retention_days INTEGER,
60
+ legal_basis TEXT,
61
+ created_at TIMESTAMPTZ DEFAULT NOW(),
62
+ updated_at TIMESTAMPTZ DEFAULT NOW()
63
+ );
64
+
65
+ -- Ví dụ classification cho patient table
66
+ INSERT INTO data_classification (schema_name, table_name, column_name,
67
+ classification_level, classification_label, contains_phi, encryption_required, masking_rule)
68
+ VALUES
69
+ ('public', 'patients', 'id', 2, 'INTERNAL', false, false, NULL),
70
+ ('public', 'patients', 'full_name', 3, 'CONFIDENTIAL', true, true, 'PARTIAL_MASK'),
71
+ ('public', 'patients', 'date_of_birth', 3, 'CONFIDENTIAL', true, false, 'YEAR_ONLY'),
72
+ ('public', 'patients', 'cccd_number', 3, 'CONFIDENTIAL', true, true, 'FULL_MASK'),
73
+ ('public', 'patients', 'phone', 3, 'CONFIDENTIAL', true, true, 'PARTIAL_MASK'),
74
+ ('public', 'patients', 'email', 3, 'CONFIDENTIAL', true, true, 'PARTIAL_MASK'),
75
+ ('public', 'patients', 'address', 3, 'CONFIDENTIAL', true, true, 'CITY_ONLY'),
76
+ ('public', 'patients', 'blood_type', 2, 'INTERNAL', false, false, NULL),
77
+ ('public', 'patients', 'hiv_status', 4, 'RESTRICTED', true, true, 'FULL_MASK'),
78
+ ('public', 'patients', 'insurance_number', 3, 'CONFIDENTIAL', true, true, 'PARTIAL_MASK');
79
+ ```
80
+
81
+ ## 2. Data Flow Mapping
82
+
83
+ ### 2.1. PHI Data Flow trong Microservices
84
+
85
+ ![Luồng dữ liệu PHI qua các microservices — từ Patient Portal qua API Gateway, Keycloak đến các services và databases](/storage/uploads/2026/04/healthcare-phi-data-flow.png)
86
+
87
+ ### 2.2. Data Flow Documentation Template
88
+
89
+ | # | Data Element | Source | Destination | Transport | Encryption | Classification |
90
+ |---|-------------|--------|-------------|-----------|------------|----------------|
91
+ | 1 | Patient Name | Portal | Patient Service | HTTPS/TLS 1.3 | In-transit + At-rest | L3 |
92
+ | 2 | Lab Results | Lab Instrument | Lab Service | HL7v2/MLLP over TLS | In-transit + At-rest | L3 |
93
+ | 3 | Diagnosis Code | Clinical Service | Billing Service | Kafka (SSL) | Application-level | L3 |
94
+ | 4 | HIV Status | Clinical Service | Clinical DB | JDBC/SSL | Column encryption | L4 |
95
+ | 5 | Audit Event | All Services | Audit Service | Kafka (SSL) | Event encryption | L2 |
96
+ | 6 | Appointment | Scheduling Service | Notification Service | Kafka (SSL) | In-transit | L2 |
97
+
98
+ ## 3. Risk Assessment theo NIST SP 800-30
99
+
100
+ ### 3.1. Risk Assessment Methodology
101
+
102
+ ![6 bước đánh giá rủi ro theo NIST SP 800-30 — từ xác định Threats đến Risk Response](/storage/uploads/2026/04/healthcare-risk-assessment-steps.png)
103
+
104
+ ### 3.2. Threat Identification cho Healthcare Microservices
105
+
106
+ | Threat Category | Threat | Threat Source |
107
+ |----------------|--------|---------------|
108
+ | **External** | SQL Injection vào Patient Service | Attacker |
109
+ | **External** | Ransomware mã hóa database | Cybercriminal |
110
+ | **External** | MITM attack trên API calls | Network attacker |
111
+ | **External** | Credential stuffing vào Patient Portal | Bot network |
112
+ | **Internal** | Nhân viên truy cập PHI trái phép | Insider |
113
+ | **Internal** | Database admin export toàn bộ patient data | Privileged user |
114
+ | **Internal** | Developer hardcode credentials | Negligent employee |
115
+ | **Environmental** | Database corruption do hardware failure | Infrastructure |
116
+ | **Environmental** | Mất dữ liệu do thiên tai | Natural disaster |
117
+ | **Supply Chain** | Vulnerability trong Quarkus dependency | Third-party |
118
+
119
+ ### 3.3. Vulnerability Assessment
120
+
121
+ ```java
122
+ // Ví dụ: Checklist kiểm tra vulnerabilities trong Quarkus service
123
+ public class SecurityVulnerabilityChecklist {
124
+
125
+ // V1: SQL Injection - Sử dụng parameterized queries
126
+ // ❌ VULNERABLE
127
+ String badQuery = "SELECT * FROM patients WHERE name = '" + userInput + "'";
128
+
129
+ // ✅ SECURE
130
+ @NamedQuery(name = "Patient.findByName",
131
+ query = "SELECT p FROM Patient p WHERE p.name = :name")
132
+ List<Patient> findByName(@Param("name") String name);
133
+
134
+ // V2: Broken Authentication - Token validation
135
+ // ❌ VULNERABLE: Không verify token
136
+ String userId = jwt.getClaim("sub"); // Không verify expiration, issuer
137
+
138
+ // ✅ SECURE: Quarkus OIDC tự động verify
139
+ @Authenticated
140
+ @RolesAllowed("doctor")
141
+ public Response getPatient(UUID id) { ... }
142
+
143
+ // V3: Sensitive Data Exposure in Logs
144
+ // ❌ VULNERABLE
145
+ log.info("Patient created: " + patient.toString()); // Logs PHI!
146
+
147
+ // ✅ SECURE
148
+ log.info("Patient created: id={}", patient.getId()); // Only log ID
149
+ }
150
+ ```
151
+
152
+ ### 3.4. Risk Matrix
153
+
154
+ ![Ma trận đánh giá rủi ro 5x5 — Likelihood x Impact từ LOW đến CRITICAL](/storage/uploads/2026/04/healthcare-risk-matrix-heatmap.png)
155
+
156
+ | | Negligible (1) | Low (2) | Medium (3) | High (4) | Critical (5) |
157
+ |-|----------------|---------|------------|----------|-------------|
158
+ | **Very High (5)** | LOW | MEDIUM | HIGH | CRITICAL | CRITICAL |
159
+ | **High (4)** | LOW | MEDIUM | HIGH | HIGH | CRITICAL |
160
+ | **Medium (3)** | LOW | LOW | MEDIUM | HIGH | HIGH |
161
+ | **Low (2)** | LOW | LOW | LOW | MEDIUM | MEDIUM |
162
+ | **Very Low (1)** | LOW | LOW | LOW | LOW | MEDIUM |
163
+
164
+ ## 4. Risk Register cho Healthcare Microservices
165
+
166
+ ### 4.1. Risk Register Template
167
+
168
+ | ID | Risk Description | Likelihood | Impact | Risk Level | Mitigation | Owner | Status |
169
+ |----|-----------------|------------|--------|------------|------------|-------|--------|
170
+ | R001 | SQL Injection vào Patient API | Medium (3) | Critical (5) | HIGH | Parameterized queries, input validation, WAF | Dev Team | Mitigated |
171
+ | R002 | Insider access PHI không authorized | High (4) | High (4) | HIGH | RBAC, RLS, Audit logging, DLP | Security Team | In Progress |
172
+ | R003 | Ransomware mã hóa patient_db | Medium (3) | Critical (5) | HIGH | Immutable backups, network segmentation, EDR | Ops Team | Mitigated |
173
+ | R004 | Keycloak token theft | Medium (3) | High (4) | HIGH | Short-lived tokens, mTLS, DPoP | Dev Team | In Progress |
174
+ | R005 | PHI exposure in logs | High (4) | High (4) | HIGH | Log sanitization, PHI detection in CI/CD | Dev Team | Open |
175
+ | R006 | Unencrypted PHI in Kafka | Medium (3) | High (4) | HIGH | Application-level encryption, Kafka SSL | Dev Team | Open |
176
+ | R007 | Database backup theft | Low (2) | Critical (5) | MEDIUM | Encrypted backups, key management | Ops Team | Mitigated |
177
+ | R008 | API key/credential exposure | Medium (3) | High (4) | HIGH | Vault secrets management, no hardcoded secrets | All Teams | In Progress |
178
+ | R009 | DDoS on patient portal | Medium (3) | Medium (3) | MEDIUM | Rate limiting, WAF, CDN | Ops Team | Mitigated |
179
+ | R010 | Third-party dependency CVE | High (4) | Medium (3) | HIGH | Automated scanning, Dependabot, SBOM | Dev Team | Ongoing |
180
+
181
+ ### 4.2. Risk Treatment Plan
182
+
183
+ ![4 chiến lược xử lý rủi ro — Mitigate, Transfer, Accept, Avoid](/storage/uploads/2026/04/healthcare-risk-response-strategies.png)
184
+
185
+ - **MITIGATE** (Giảm thiểu) ← Preferred cho HIGH risks: Implement controls, giảm likelihood/impact
186
+ - **TRANSFER** (Chuyển giao): Cyber insurance, outsource cho specialist provider
187
+ - **ACCEPT** (Chấp nhận) ← Chỉ cho LOW risks: Document risk acceptance, monitor
188
+ - **AVOID** (Tránh): Loại bỏ nguồn rủi ro, thay đổi architecture
189
+
190
+ ## 5. Data Retention Policy
191
+
192
+ ### 5.1. Retention Requirements cho Y Tế Việt Nam
193
+
194
+ | Loại dữ liệu | Thời gian lưu trữ | Cơ sở pháp lý |
195
+ |---------------|-------------------|----------------|
196
+ | Hồ sơ bệnh án ngoại trú | 10 năm | Thông tư 46/2018/TT-BYT |
197
+ | Hồ sơ bệnh án nội trú | 20 năm | Thông tư 46/2018/TT-BYT |
198
+ | Hồ sơ bệnh án tử vong | 20 năm | Thông tư 46/2018/TT-BYT |
199
+ | Kết quả xét nghiệm | 10 năm | Quy định bệnh viện |
200
+ | Chẩn đoán hình ảnh | 10 năm | Quy định bệnh viện |
201
+ | Audit logs | 6 năm (HIPAA) | HIPAA §164.530(j) |
202
+ | Đơn thuốc | 5 năm | Luật Dược |
203
+ | Consent records | Lifetime + 6 years | HIPAA / NĐ 13/2023 |
204
+
205
+ ### 5.2. Automated Retention trong PostgreSQL
206
+
207
+ ```sql
208
+ -- Partition strategy for data retention
209
+ CREATE TABLE audit_events (
210
+ id UUID DEFAULT gen_random_uuid(),
211
+ event_time TIMESTAMPTZ NOT NULL DEFAULT NOW(),
212
+ event_type VARCHAR(50) NOT NULL,
213
+ actor_id UUID NOT NULL,
214
+ resource_type VARCHAR(100) NOT NULL,
215
+ resource_id UUID,
216
+ action VARCHAR(20) NOT NULL,
217
+ outcome VARCHAR(20) NOT NULL,
218
+ details JSONB
219
+ ) PARTITION BY RANGE (event_time);
220
+
221
+ -- Create monthly partitions
222
+ CREATE TABLE audit_events_2026_01 PARTITION OF audit_events
223
+ FOR VALUES FROM ('2026-01-01') TO ('2026-02-01');
224
+
225
+ CREATE TABLE audit_events_2026_02 PARTITION OF audit_events
226
+ FOR VALUES FROM ('2026-02-01') TO ('2026-03-01');
227
+
228
+ -- Automated partition management
229
+ -- Drop partitions older than retention period (6 years for HIPAA)
230
+ -- Archive to cold storage before dropping
231
+ ```
232
+
233
+ ## 6. Tổng kết
234
+
235
+ Trong bài học này, chúng ta đã:
236
+
237
+ - Xây dựng **Data Classification Framework** 4 cấp cho dữ liệu y tế
238
+ - Tạo **Data Flow Mapping** cho PHI qua microservices architecture
239
+ - Thực hiện **Risk Assessment** theo NIST SP 800-30 methodology
240
+ - Thiết lập **Risk Register** với risk treatment plans
241
+ - Định nghĩa **Data Retention Policy** theo quy định Việt Nam và HIPAA
242
+
243
+ ## Bài tập
244
+
245
+ 1. Phân loại tất cả tables/columns trong database hệ thống y tế của bạn theo 4 cấp
246
+ 2. Vẽ Data Flow Diagram cho 3 use cases chính: đăng ký khám, ghi nhận kết quả xét nghiệm, kê đơn thuốc
247
+ 3. Thực hiện Risk Assessment và tạo Risk Register cho ít nhất 15 risks
248
+ 4. Xây dựng Data Retention Policy phù hợp với tổ chức
249
+
250
+ ---
251
+
252
+ ---
253
+
254
+ <!-- SERIES-NAV:START -->
255
+ | ◀ Bài trước | Bài tiếp theo ▶ |
256
+ |:---|---:|
257
+ | [Bài 2: Kiến trúc Microservices An toàn cho Y Tế với Quarkus Stack](/series/bao-mat-du-lieu-y-te-cho-microservices/bai-2-kien-truc-microservices-an-toan-cho-y-te) | [Bài 4: Threat Modeling STRIDE/DREAD cho Health Information System](/series/bao-mat-du-lieu-y-te-cho-microservices/bai-4-threat-modeling-stride-dread-cho-his) |
258
+ <!-- SERIES-NAV:END -->