@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.
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/content/series/architecture/xay-dung-he-thong-y-te-microservices/index.md +376 -0
- package/package.json +1 -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/03-bai-3-phan-loai-du-lieu-y-te-phi-va-danh-gia-rui-ro.md +0 -375
- package/content/series/devsecops/bao-mat-du-lieu-y-te-cho-microservices/index.md +0 -441
|
@@ -1,375 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: 019e1a40-a103-7001-d001-f0a1b2c30103
|
|
3
|
-
title: 'Bài 3: Phân loại Dữ liệu Y Tế (PHI/ePHI) và Đánh giá Rủi ro'
|
|
4
|
-
slug: bai-3-phan-loai-du-lieu-y-te-phi-va-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: Nền tảng Bảo mật Dữ liệu Y Tế"
|
|
15
|
-
course:
|
|
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
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
## 1. Data Classification Framework cho Y Tế
|
|
22
|
-
|
|
23
|
-
### 1.1. Tại sao cần phân loại dữ liệu?
|
|
24
|
-
|
|
25
|
-
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:
|
|
26
|
-
|
|
27
|
-
- **Tối ưu chi phí bảo mật**: Tập trung resources vào dữ liệu quan trọng nhất
|
|
28
|
-
- **Tuân thủ pháp luật**: Áp dụng đúng controls theo yêu cầu quy định
|
|
29
|
-
- **Giảm attack surface**: Hạn chế phạm vi dữ liệu nhạy cảm
|
|
30
|
-
- **Incident response**: Ưu tiên xử lý khi xảy ra breach
|
|
31
|
-
|
|
32
|
-
### 1.2. Healthcare Data Classification Levels
|
|
33
|
-
|
|
34
|
-
```
|
|
35
|
-
┌─────────────────────────────────────────────────────────┐
|
|
36
|
-
│ Level 4: RESTRICTED (Hạn chế tối đa) │
|
|
37
|
-
│ ├── Thông tin chẩn đoán HIV/AIDS, sức khỏe tâm thần │
|
|
38
|
-
│ ├── Kết quả xét nghiệm di truyền │
|
|
39
|
-
│ ├── Hồ sơ điều trị nghiện │
|
|
40
|
-
│ └── Thông tin sức khỏe sinh sản │
|
|
41
|
-
│ → Encryption: Required (AES-256) │
|
|
42
|
-
│ → Access: Named individuals only │
|
|
43
|
-
│ → Audit: Full logging, real-time alerts │
|
|
44
|
-
├─────────────────────────────────────────────────────────┤
|
|
45
|
-
│ Level 3: CONFIDENTIAL (Bảo mật) │
|
|
46
|
-
│ ├── Hồ sơ bệnh án (EMR) │
|
|
47
|
-
│ ├── Kết quả xét nghiệm │
|
|
48
|
-
│ ├── Đơn thuốc │
|
|
49
|
-
│ ├── Chẩn đoán hình ảnh │
|
|
50
|
-
│ └── Thông tin bảo hiểm y tế │
|
|
51
|
-
│ → Encryption: Required (AES-256) │
|
|
52
|
-
│ → Access: Role-based (treating clinicians) │
|
|
53
|
-
│ → Audit: Full logging │
|
|
54
|
-
├─────────────────────────────────────────────────────────┤
|
|
55
|
-
│ Level 2: INTERNAL (Nội bộ) │
|
|
56
|
-
│ ├── Thông tin lịch hẹn │
|
|
57
|
-
│ ├── Dữ liệu thống kê (ẩn danh) │
|
|
58
|
-
│ ├── Thông tin nhân viên y tế │
|
|
59
|
-
│ └── Cấu hình hệ thống │
|
|
60
|
-
│ → Encryption: Recommended │
|
|
61
|
-
│ → Access: Department-based │
|
|
62
|
-
│ → Audit: Standard logging │
|
|
63
|
-
├─────────────────────────────────────────────────────────┤
|
|
64
|
-
│ Level 1: PUBLIC (Công khai) │
|
|
65
|
-
│ ├── Danh mục dịch vụ y tế │
|
|
66
|
-
│ ├── Giờ làm việc phòng khám │
|
|
67
|
-
│ ├── Thông tin liên hệ bệnh viện │
|
|
68
|
-
│ └── Hướng dẫn sức khỏe chung │
|
|
69
|
-
│ → Encryption: Not required │
|
|
70
|
-
│ → Access: Public │
|
|
71
|
-
│ → Audit: Basic logging │
|
|
72
|
-
└─────────────────────────────────────────────────────────┘
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
### 1.3. Data Classification trong PostgreSQL Schema
|
|
76
|
-
|
|
77
|
-
```sql
|
|
78
|
-
-- Data classification metadata table
|
|
79
|
-
CREATE TABLE data_classification (
|
|
80
|
-
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
81
|
-
schema_name VARCHAR(100) NOT NULL,
|
|
82
|
-
table_name VARCHAR(100) NOT NULL,
|
|
83
|
-
column_name VARCHAR(100) NOT NULL,
|
|
84
|
-
classification_level INTEGER NOT NULL CHECK (classification_level BETWEEN 1 AND 4),
|
|
85
|
-
classification_label VARCHAR(50) NOT NULL,
|
|
86
|
-
contains_phi BOOLEAN DEFAULT false,
|
|
87
|
-
encryption_required BOOLEAN DEFAULT false,
|
|
88
|
-
masking_rule VARCHAR(100),
|
|
89
|
-
retention_days INTEGER,
|
|
90
|
-
legal_basis TEXT,
|
|
91
|
-
created_at TIMESTAMPTZ DEFAULT NOW(),
|
|
92
|
-
updated_at TIMESTAMPTZ DEFAULT NOW()
|
|
93
|
-
);
|
|
94
|
-
|
|
95
|
-
-- Ví dụ classification cho patient table
|
|
96
|
-
INSERT INTO data_classification (schema_name, table_name, column_name,
|
|
97
|
-
classification_level, classification_label, contains_phi, encryption_required, masking_rule)
|
|
98
|
-
VALUES
|
|
99
|
-
('public', 'patients', 'id', 2, 'INTERNAL', false, false, NULL),
|
|
100
|
-
('public', 'patients', 'full_name', 3, 'CONFIDENTIAL', true, true, 'PARTIAL_MASK'),
|
|
101
|
-
('public', 'patients', 'date_of_birth', 3, 'CONFIDENTIAL', true, false, 'YEAR_ONLY'),
|
|
102
|
-
('public', 'patients', 'cccd_number', 3, 'CONFIDENTIAL', true, true, 'FULL_MASK'),
|
|
103
|
-
('public', 'patients', 'phone', 3, 'CONFIDENTIAL', true, true, 'PARTIAL_MASK'),
|
|
104
|
-
('public', 'patients', 'email', 3, 'CONFIDENTIAL', true, true, 'PARTIAL_MASK'),
|
|
105
|
-
('public', 'patients', 'address', 3, 'CONFIDENTIAL', true, true, 'CITY_ONLY'),
|
|
106
|
-
('public', 'patients', 'blood_type', 2, 'INTERNAL', false, false, NULL),
|
|
107
|
-
('public', 'patients', 'hiv_status', 4, 'RESTRICTED', true, true, 'FULL_MASK'),
|
|
108
|
-
('public', 'patients', 'insurance_number', 3, 'CONFIDENTIAL', true, true, 'PARTIAL_MASK');
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
## 2. Data Flow Mapping
|
|
112
|
-
|
|
113
|
-
### 2.1. PHI Data Flow trong Microservices
|
|
114
|
-
|
|
115
|
-
```
|
|
116
|
-
┌──────────┐ HTTPS/TLS ┌──────────┐ OIDC ┌──────────┐
|
|
117
|
-
│ Patient │ ──────────────▶ │ API │ ──────────▶ │ Keycloak │
|
|
118
|
-
│ Portal │ │ Gateway │ │ │
|
|
119
|
-
└──────────┘ └────┬─────┘ └──────────┘
|
|
120
|
-
│
|
|
121
|
-
JWT Token + PHI Request
|
|
122
|
-
│
|
|
123
|
-
┌───────────────────┼───────────────────┐
|
|
124
|
-
▼ ▼ ▼
|
|
125
|
-
┌──────────┐ ┌──────────┐ ┌──────────┐
|
|
126
|
-
│ Patient │ │ Clinical │ │ Lab │
|
|
127
|
-
│ Service │ │ Service │ │ Service │
|
|
128
|
-
└────┬─────┘ └────┬─────┘ └────┬─────┘
|
|
129
|
-
│ │ │
|
|
130
|
-
PHI (encrypted) PHI (encrypted) PHI (encrypted)
|
|
131
|
-
│ │ │
|
|
132
|
-
▼ ▼ ▼
|
|
133
|
-
┌──────────┐ ┌──────────┐ ┌──────────┐
|
|
134
|
-
│patient_db│ │clinical │ │ lab_db │
|
|
135
|
-
│(RLS+Enc) │ │_db (RLS) │ │(RLS+Enc) │
|
|
136
|
-
└──────────┘ └──────────┘ └──────────┘
|
|
137
|
-
│ │ │
|
|
138
|
-
└──────────────────┼────────────────────┘
|
|
139
|
-
│
|
|
140
|
-
Audit Events (encrypted)
|
|
141
|
-
│
|
|
142
|
-
▼
|
|
143
|
-
┌──────────────┐
|
|
144
|
-
│ Kafka │
|
|
145
|
-
│ (audit topic)│
|
|
146
|
-
└──────┬───────┘
|
|
147
|
-
│
|
|
148
|
-
▼
|
|
149
|
-
┌──────────────┐
|
|
150
|
-
│ Audit DB │
|
|
151
|
-
│ (append-only)│
|
|
152
|
-
└──────────────┘
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
### 2.2. Data Flow Documentation Template
|
|
156
|
-
|
|
157
|
-
| # | Data Element | Source | Destination | Transport | Encryption | Classification |
|
|
158
|
-
|---|-------------|--------|-------------|-----------|------------|----------------|
|
|
159
|
-
| 1 | Patient Name | Portal | Patient Service | HTTPS/TLS 1.3 | In-transit + At-rest | L3 |
|
|
160
|
-
| 2 | Lab Results | Lab Instrument | Lab Service | HL7v2/MLLP over TLS | In-transit + At-rest | L3 |
|
|
161
|
-
| 3 | Diagnosis Code | Clinical Service | Billing Service | Kafka (SSL) | Application-level | L3 |
|
|
162
|
-
| 4 | HIV Status | Clinical Service | Clinical DB | JDBC/SSL | Column encryption | L4 |
|
|
163
|
-
| 5 | Audit Event | All Services | Audit Service | Kafka (SSL) | Event encryption | L2 |
|
|
164
|
-
| 6 | Appointment | Scheduling Service | Notification Service | Kafka (SSL) | In-transit | L2 |
|
|
165
|
-
|
|
166
|
-
## 3. Risk Assessment theo NIST SP 800-30
|
|
167
|
-
|
|
168
|
-
### 3.1. Risk Assessment Methodology
|
|
169
|
-
|
|
170
|
-
```
|
|
171
|
-
Bước 1: Xác định Threats (Mối đe dọa)
|
|
172
|
-
│
|
|
173
|
-
▼
|
|
174
|
-
Bước 2: Xác định Vulnerabilities (Lỗ hổng)
|
|
175
|
-
│
|
|
176
|
-
▼
|
|
177
|
-
Bước 3: Đánh giá Likelihood (Khả năng xảy ra)
|
|
178
|
-
│
|
|
179
|
-
▼
|
|
180
|
-
Bước 4: Đánh giá Impact (Mức độ ảnh hưởng)
|
|
181
|
-
│
|
|
182
|
-
▼
|
|
183
|
-
Bước 5: Tính Risk Level = Likelihood × Impact
|
|
184
|
-
│
|
|
185
|
-
▼
|
|
186
|
-
Bước 6: Xác định Risk Response (Giảm thiểu, chấp nhận, chuyển giao)
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
### 3.2. Threat Identification cho Healthcare Microservices
|
|
190
|
-
|
|
191
|
-
| Threat Category | Threat | Threat Source |
|
|
192
|
-
|----------------|--------|---------------|
|
|
193
|
-
| **External** | SQL Injection vào Patient Service | Attacker |
|
|
194
|
-
| **External** | Ransomware mã hóa database | Cybercriminal |
|
|
195
|
-
| **External** | MITM attack trên API calls | Network attacker |
|
|
196
|
-
| **External** | Credential stuffing vào Patient Portal | Bot network |
|
|
197
|
-
| **Internal** | Nhân viên truy cập PHI trái phép | Insider |
|
|
198
|
-
| **Internal** | Database admin export toàn bộ patient data | Privileged user |
|
|
199
|
-
| **Internal** | Developer hardcode credentials | Negligent employee |
|
|
200
|
-
| **Environmental** | Database corruption do hardware failure | Infrastructure |
|
|
201
|
-
| **Environmental** | Mất dữ liệu do thiên tai | Natural disaster |
|
|
202
|
-
| **Supply Chain** | Vulnerability trong Quarkus dependency | Third-party |
|
|
203
|
-
|
|
204
|
-
### 3.3. Vulnerability Assessment
|
|
205
|
-
|
|
206
|
-
```java
|
|
207
|
-
// Ví dụ: Checklist kiểm tra vulnerabilities trong Quarkus service
|
|
208
|
-
public class SecurityVulnerabilityChecklist {
|
|
209
|
-
|
|
210
|
-
// V1: SQL Injection - Sử dụng parameterized queries
|
|
211
|
-
// ❌ VULNERABLE
|
|
212
|
-
String badQuery = "SELECT * FROM patients WHERE name = '" + userInput + "'";
|
|
213
|
-
|
|
214
|
-
// ✅ SECURE
|
|
215
|
-
@NamedQuery(name = "Patient.findByName",
|
|
216
|
-
query = "SELECT p FROM Patient p WHERE p.name = :name")
|
|
217
|
-
List<Patient> findByName(@Param("name") String name);
|
|
218
|
-
|
|
219
|
-
// V2: Broken Authentication - Token validation
|
|
220
|
-
// ❌ VULNERABLE: Không verify token
|
|
221
|
-
String userId = jwt.getClaim("sub"); // Không verify expiration, issuer
|
|
222
|
-
|
|
223
|
-
// ✅ SECURE: Quarkus OIDC tự động verify
|
|
224
|
-
@Authenticated
|
|
225
|
-
@RolesAllowed("doctor")
|
|
226
|
-
public Response getPatient(UUID id) { ... }
|
|
227
|
-
|
|
228
|
-
// V3: Sensitive Data Exposure in Logs
|
|
229
|
-
// ❌ VULNERABLE
|
|
230
|
-
log.info("Patient created: " + patient.toString()); // Logs PHI!
|
|
231
|
-
|
|
232
|
-
// ✅ SECURE
|
|
233
|
-
log.info("Patient created: id={}", patient.getId()); // Only log ID
|
|
234
|
-
}
|
|
235
|
-
```
|
|
236
|
-
|
|
237
|
-
### 3.4. Risk Matrix
|
|
238
|
-
|
|
239
|
-
```
|
|
240
|
-
│ Negligible │ Low │ Medium │ High │ Critical
|
|
241
|
-
│ (1) │ (2) │ (3) │ (4) │ (5)
|
|
242
|
-
─────────┼────────────┼──────────┼──────────┼──────────┼──────────
|
|
243
|
-
Very High│ │ │ HIGH │ CRITICAL │ CRITICAL
|
|
244
|
-
(5) │ LOW │ MEDIUM │ │ │
|
|
245
|
-
─────────┼────────────┼──────────┼──────────┼──────────┼──────────
|
|
246
|
-
High │ │ │ │ │
|
|
247
|
-
(4) │ LOW │ MEDIUM │ HIGH │ HIGH │ CRITICAL
|
|
248
|
-
─────────┼────────────┼──────────┼──────────┼──────────┼──────────
|
|
249
|
-
Medium │ │ │ │ │
|
|
250
|
-
(3) │ LOW │ LOW │ MEDIUM │ HIGH │ HIGH
|
|
251
|
-
─────────┼────────────┼──────────┼──────────┼──────────┼──────────
|
|
252
|
-
Low │ │ │ │ │
|
|
253
|
-
(2) │ LOW │ LOW │ LOW │ MEDIUM │ MEDIUM
|
|
254
|
-
─────────┼────────────┼──────────┼──────────┼──────────┼──────────
|
|
255
|
-
Very Low │ │ │ │ │
|
|
256
|
-
(1) │ LOW │ LOW │ LOW │ LOW │ MEDIUM
|
|
257
|
-
─────────┴────────────┴──────────┴──────────┴──────────┴──────────
|
|
258
|
-
Impact → Likelihood ↑
|
|
259
|
-
```
|
|
260
|
-
|
|
261
|
-
## 4. Risk Register cho Healthcare Microservices
|
|
262
|
-
|
|
263
|
-
### 4.1. Risk Register Template
|
|
264
|
-
|
|
265
|
-
| ID | Risk Description | Likelihood | Impact | Risk Level | Mitigation | Owner | Status |
|
|
266
|
-
|----|-----------------|------------|--------|------------|------------|-------|--------|
|
|
267
|
-
| R001 | SQL Injection vào Patient API | Medium (3) | Critical (5) | HIGH | Parameterized queries, input validation, WAF | Dev Team | Mitigated |
|
|
268
|
-
| R002 | Insider access PHI không authorized | High (4) | High (4) | HIGH | RBAC, RLS, Audit logging, DLP | Security Team | In Progress |
|
|
269
|
-
| R003 | Ransomware mã hóa patient_db | Medium (3) | Critical (5) | HIGH | Immutable backups, network segmentation, EDR | Ops Team | Mitigated |
|
|
270
|
-
| R004 | Keycloak token theft | Medium (3) | High (4) | HIGH | Short-lived tokens, mTLS, DPoP | Dev Team | In Progress |
|
|
271
|
-
| R005 | PHI exposure in logs | High (4) | High (4) | HIGH | Log sanitization, PHI detection in CI/CD | Dev Team | Open |
|
|
272
|
-
| R006 | Unencrypted PHI in Kafka | Medium (3) | High (4) | HIGH | Application-level encryption, Kafka SSL | Dev Team | Open |
|
|
273
|
-
| R007 | Database backup theft | Low (2) | Critical (5) | MEDIUM | Encrypted backups, key management | Ops Team | Mitigated |
|
|
274
|
-
| R008 | API key/credential exposure | Medium (3) | High (4) | HIGH | Vault secrets management, no hardcoded secrets | All Teams | In Progress |
|
|
275
|
-
| R009 | DDoS on patient portal | Medium (3) | Medium (3) | MEDIUM | Rate limiting, WAF, CDN | Ops Team | Mitigated |
|
|
276
|
-
| R010 | Third-party dependency CVE | High (4) | Medium (3) | HIGH | Automated scanning, Dependabot, SBOM | Dev Team | Ongoing |
|
|
277
|
-
|
|
278
|
-
### 4.2. Risk Treatment Plan
|
|
279
|
-
|
|
280
|
-
```
|
|
281
|
-
Risk Response Strategies:
|
|
282
|
-
┌─────────────────────────────────────────────────────────┐
|
|
283
|
-
│ │
|
|
284
|
-
│ MITIGATE (Giảm thiểu) ← Preferred for HIGH risks │
|
|
285
|
-
│ ├── Implement controls │
|
|
286
|
-
│ ├── Reduce likelihood or impact │
|
|
287
|
-
│ └── Example: Add RLS to prevent unauthorized access │
|
|
288
|
-
│ │
|
|
289
|
-
│ TRANSFER (Chuyển giao) │
|
|
290
|
-
│ ├── Insurance (cyber insurance) │
|
|
291
|
-
│ ├── Outsource to specialist provider │
|
|
292
|
-
│ └── Example: Cloud provider handles physical security │
|
|
293
|
-
│ │
|
|
294
|
-
│ ACCEPT (Chấp nhận) ← Only for LOW risks │
|
|
295
|
-
│ ├── Document risk acceptance │
|
|
296
|
-
│ ├── Monitor for changes │
|
|
297
|
-
│ └── Example: Accept risk of public info disclosure │
|
|
298
|
-
│ │
|
|
299
|
-
│ AVOID (Tránh) │
|
|
300
|
-
│ ├── Eliminate the risk source │
|
|
301
|
-
│ ├── Change architecture/process │
|
|
302
|
-
│ └── Example: Don't store SSN if not absolutely needed │
|
|
303
|
-
│ │
|
|
304
|
-
└─────────────────────────────────────────────────────────┘
|
|
305
|
-
```
|
|
306
|
-
|
|
307
|
-
## 5. Data Retention Policy
|
|
308
|
-
|
|
309
|
-
### 5.1. Retention Requirements cho Y Tế Việt Nam
|
|
310
|
-
|
|
311
|
-
| Loại dữ liệu | Thời gian lưu trữ | Cơ sở pháp lý |
|
|
312
|
-
|---------------|-------------------|----------------|
|
|
313
|
-
| Hồ sơ bệnh án ngoại trú | 10 năm | Thông tư 46/2018/TT-BYT |
|
|
314
|
-
| Hồ sơ bệnh án nội trú | 20 năm | Thông tư 46/2018/TT-BYT |
|
|
315
|
-
| Hồ sơ bệnh án tử vong | 20 năm | Thông tư 46/2018/TT-BYT |
|
|
316
|
-
| Kết quả xét nghiệm | 10 năm | Quy định bệnh viện |
|
|
317
|
-
| Chẩn đoán hình ảnh | 10 năm | Quy định bệnh viện |
|
|
318
|
-
| Audit logs | 6 năm (HIPAA) | HIPAA §164.530(j) |
|
|
319
|
-
| Đơn thuốc | 5 năm | Luật Dược |
|
|
320
|
-
| Consent records | Lifetime + 6 years | HIPAA / NĐ 13/2023 |
|
|
321
|
-
|
|
322
|
-
### 5.2. Automated Retention trong PostgreSQL
|
|
323
|
-
|
|
324
|
-
```sql
|
|
325
|
-
-- Partition strategy for data retention
|
|
326
|
-
CREATE TABLE audit_events (
|
|
327
|
-
id UUID DEFAULT gen_random_uuid(),
|
|
328
|
-
event_time TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
|
329
|
-
event_type VARCHAR(50) NOT NULL,
|
|
330
|
-
actor_id UUID NOT NULL,
|
|
331
|
-
resource_type VARCHAR(100) NOT NULL,
|
|
332
|
-
resource_id UUID,
|
|
333
|
-
action VARCHAR(20) NOT NULL,
|
|
334
|
-
outcome VARCHAR(20) NOT NULL,
|
|
335
|
-
details JSONB
|
|
336
|
-
) PARTITION BY RANGE (event_time);
|
|
337
|
-
|
|
338
|
-
-- Create monthly partitions
|
|
339
|
-
CREATE TABLE audit_events_2026_01 PARTITION OF audit_events
|
|
340
|
-
FOR VALUES FROM ('2026-01-01') TO ('2026-02-01');
|
|
341
|
-
|
|
342
|
-
CREATE TABLE audit_events_2026_02 PARTITION OF audit_events
|
|
343
|
-
FOR VALUES FROM ('2026-02-01') TO ('2026-03-01');
|
|
344
|
-
|
|
345
|
-
-- Automated partition management
|
|
346
|
-
-- Drop partitions older than retention period (6 years for HIPAA)
|
|
347
|
-
-- Archive to cold storage before dropping
|
|
348
|
-
```
|
|
349
|
-
|
|
350
|
-
## 6. Tổng kết
|
|
351
|
-
|
|
352
|
-
Trong bài học này, chúng ta đã:
|
|
353
|
-
|
|
354
|
-
- Xây dựng **Data Classification Framework** 4 cấp cho dữ liệu y tế
|
|
355
|
-
- Tạo **Data Flow Mapping** cho PHI qua microservices architecture
|
|
356
|
-
- Thực hiện **Risk Assessment** theo NIST SP 800-30 methodology
|
|
357
|
-
- Thiết lập **Risk Register** với risk treatment plans
|
|
358
|
-
- Định nghĩa **Data Retention Policy** theo quy định Việt Nam và HIPAA
|
|
359
|
-
|
|
360
|
-
## Bài tập
|
|
361
|
-
|
|
362
|
-
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
|
|
363
|
-
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
|
|
364
|
-
3. Thực hiện Risk Assessment và tạo Risk Register cho ít nhất 15 risks
|
|
365
|
-
4. Xây dựng Data Retention Policy phù hợp với tổ chức
|
|
366
|
-
|
|
367
|
-
---
|
|
368
|
-
|
|
369
|
-
---
|
|
370
|
-
|
|
371
|
-
<!-- SERIES-NAV:START -->
|
|
372
|
-
| ◀ Bài trước | Bài tiếp theo ▶ |
|
|
373
|
-
|:---|---:|
|
|
374
|
-
| [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) |
|
|
375
|
-
<!-- SERIES-NAV:END -->
|