@xdev-asia/xdev-knowledge-mcp 1.0.38 → 1.0.40
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/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 +79 -114
- package/content/series/architecture/xay-dung-he-thong-y-te-microservices/chapters/02-phan-2-iam-keycloak/lessons/01-bai-5-setup-keycloak-realm-benh-vien.md +33 -84
- package/content/series/architecture/xay-dung-he-thong-y-te-microservices/chapters/02-phan-2-iam-keycloak/lessons/02-bai-6-phan-quyen-rbac-abac.md +6 -23
- package/content/series/architecture/xay-dung-he-thong-y-te-microservices/chapters/02-phan-2-iam-keycloak/lessons/03-bai-7-smart-on-fhir-oauth2-oidc.md +25 -36
- package/content/series/architecture/xay-dung-he-thong-y-te-microservices/chapters/02-phan-2-iam-keycloak/lessons/04-bai-8-mfa-passkeys-emergency-access.md +7 -23
- package/content/series/architecture/xay-dung-he-thong-y-te-microservices/chapters/03-phan-3-data-layer-postgresql/lessons/01-bai-9-postgresql-security-hardening.md +23 -69
- package/content/series/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 +25 -80
- package/content/series/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 +26 -55
- package/content/series/architecture/xay-dung-he-thong-y-te-microservices/chapters/03-phan-3-data-layer-postgresql/lessons/04-bai-12-audit-logging-cdc-pgaudit.md +51 -87
- package/content/series/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 +18 -63
- package/content/series/architecture/xay-dung-he-thong-y-te-microservices/chapters/04-phan-4-microservices-quarkus/lessons/04-bai-16-mtls-service-mesh.md +26 -88
- package/content/series/architecture/xay-dung-he-thong-y-te-microservices/chapters/05-phan-5-compliance-audit/lessons/01-bai-17-hipaa-technical-safeguards.md +50 -61
- package/content/series/architecture/xay-dung-he-thong-y-te-microservices/chapters/05-phan-5-compliance-audit/lessons/02-bai-18-audit-trail-opentelemetry-elk.md +11 -34
- package/content/series/architecture/xay-dung-he-thong-y-te-microservices/chapters/05-phan-5-compliance-audit/lessons/03-bai-19-data-masking-anonymization.md +113 -223
- package/content/series/architecture/xay-dung-he-thong-y-te-microservices/chapters/05-phan-5-compliance-audit/lessons/04-bai-20-backup-disaster-recovery.md +92 -149
- package/content/series/architecture/xay-dung-he-thong-y-te-microservices/chapters/06-phan-6-production-van-hanh/lessons/01-bai-21-zero-trust-architecture.md +126 -271
- package/content/series/architecture/xay-dung-he-thong-y-te-microservices/chapters/06-phan-6-production-van-hanh/lessons/02-bai-22-container-kubernetes-security.md +10 -52
- package/content/series/architecture/xay-dung-he-thong-y-te-microservices/chapters/06-phan-6-production-van-hanh/lessons/03-bai-23-penetration-testing.md +51 -90
- package/content/series/architecture/xay-dung-he-thong-y-te-microservices/chapters/06-phan-6-production-van-hanh/lessons/04-bai-24-capstone-deploy-production.md +137 -232
- package/package.json +1 -1
|
@@ -23,73 +23,48 @@ course:
|
|
|
23
23
|
|
|
24
24
|

|
|
25
25
|
|
|
26
|
-
|
|
27
26
|
HIPAA Security Rule §164.308(a)(7) yêu cầu mọi tổ chức xử lý ePHI phải có **Contingency Plan** — kế hoạch dự phòng cho các tình huống khẩn cấp (thiên tai, tấn công ransomware, sự cố phần cứng, lỗi con người). Trong healthcare, **downtime có thể ảnh hưởng trực tiếp đến tính mạng bệnh nhân**.
|
|
28
27
|
|
|
29
28
|
### 1.1. HIPAA Contingency Plan Requirements
|
|
30
29
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
│ └── Periodic testing of contingency plans │
|
|
52
|
-
│ └── Update plans based on test results │
|
|
53
|
-
│ │
|
|
54
|
-
│ (v) Applications and Data Criticality Analysis [Addr.] │
|
|
55
|
-
│ └── Identify critical applications │
|
|
56
|
-
│ └── Prioritize recovery order │
|
|
57
|
-
└─────────────────────────────────────────────────────────────┘
|
|
58
|
-
```
|
|
30
|
+
**HIPAA Contingency Plan — §164.308(a)(7):**
|
|
31
|
+
|
|
32
|
+
1. **Data Backup Plan** [Required]
|
|
33
|
+
- Create and maintain exact copies of ePHI
|
|
34
|
+
- Regular backup schedule
|
|
35
|
+
- Backup verification
|
|
36
|
+
2. **Disaster Recovery Plan** [Required]
|
|
37
|
+
- Procedures to restore lost data
|
|
38
|
+
- Restore from backups
|
|
39
|
+
- Test recovery procedures
|
|
40
|
+
3. **Emergency Mode Operation Plan** [Required]
|
|
41
|
+
- Continue critical operations during emergency
|
|
42
|
+
- Protect ePHI during emergency
|
|
43
|
+
- Prioritize patient safety systems
|
|
44
|
+
4. **Testing and Revision Procedures** [Addressable]
|
|
45
|
+
- Periodic testing of contingency plans
|
|
46
|
+
- Update plans based on test results
|
|
47
|
+
5. **Applications and Data Criticality Analysis** [Addressable]
|
|
48
|
+
- Identify critical applications
|
|
49
|
+
- Prioritize recovery order
|
|
59
50
|
|
|
60
51
|
### 1.2. RTO/RPO Requirements cho Healthcare
|
|
61
52
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
│ │ Pharmacy │ <5min │ <30min │ Critical │ │
|
|
78
|
-
│ │ Patient Portal │ <1hr │ <4hr │ Important │ │
|
|
79
|
-
│ │ Billing │ <4hr │ <8hr │ Standard │ │
|
|
80
|
-
│ │ Analytics │ <24hr │ <24hr │ Low │ │
|
|
81
|
-
│ │ Audit Logs │ 0 │ <1hr │ Critical (HIPAA) │ │
|
|
82
|
-
│ └────────────────┴────────┴────────┴───────────────────┘ │
|
|
83
|
-
│ │
|
|
84
|
-
│ Timeline: │
|
|
85
|
-
│ ◄───── RPO ─────┤ Disaster ├───── RTO ─────► │
|
|
86
|
-
│ Data loss window │ occurs │ Downtime window │
|
|
87
|
-
│ │
|
|
88
|
-
│ Target cho Critical Healthcare: │
|
|
89
|
-
│ RPO ≈ 0 (synchronous replication) │
|
|
90
|
-
│ RTO < 15 minutes (automated failover) │
|
|
91
|
-
└─────────────────────────────────────────────────────────────┘
|
|
92
|
-
```
|
|
53
|
+

|
|
54
|
+
|
|
55
|
+
| System | RPO | RTO | Criticality |
|
|
56
|
+
|--------|-----|-----|------------|
|
|
57
|
+
| EHR (Bệnh án) | 0-1min | <15min | Critical |
|
|
58
|
+
| Lab Results | <5min | <30min | Critical |
|
|
59
|
+
| Pharmacy | <5min | <30min | Critical |
|
|
60
|
+
| Patient Portal | <1hr | <4hr | Important |
|
|
61
|
+
| Billing | <4hr | <8hr | Standard |
|
|
62
|
+
| Analytics | <24hr | <24hr | Low |
|
|
63
|
+
| Audit Logs | 0 | <1hr | Critical (HIPAA) |
|
|
64
|
+
|
|
65
|
+
**Timeline:** ◄── RPO (Data loss window) ──┤ Disaster occurs ├── RTO (Downtime window) ──►
|
|
66
|
+
|
|
67
|
+
**Target cho Critical Healthcare:** RPO ≈ 0 (synchronous replication), RTO < 15 minutes (automated failover)
|
|
93
68
|
|
|
94
69
|
## 2. PostgreSQL Backup Strategies
|
|
95
70
|
|
|
@@ -741,41 +716,20 @@ volumes:
|
|
|
741
716
|
|
|
742
717
|
### 5.1. Cross-Region Architecture
|
|
743
718
|
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
│ │ │
|
|
759
|
-
│ │ Internet / VPN / Direct Connect │
|
|
760
|
-
│ │ (encrypted TLS 1.3) │
|
|
761
|
-
│ │ │
|
|
762
|
-
│ DR REGION (ap-northeast-1: Tokyo) │
|
|
763
|
-
│ ┌───────┼─────────────────────────────────────┐ │
|
|
764
|
-
│ │ ▼ │ │
|
|
765
|
-
│ │ ┌──────────┐ │ │
|
|
766
|
-
│ │ │ pg-dr │ (async replica, read-only) │ │
|
|
767
|
-
│ │ │ │ Lag: < 1 minute │ │
|
|
768
|
-
│ │ └──────────┘ │ │
|
|
769
|
-
│ │ │ │
|
|
770
|
-
│ │ + pgBackRest S3 backup (encrypted) │ │
|
|
771
|
-
│ │ + Standby microservices (cold/warm) │ │
|
|
772
|
-
│ └──────────────────────────────────────────────┘ │
|
|
773
|
-
│ │
|
|
774
|
-
│ Failover: DNS switch + Patroni promote DR │
|
|
775
|
-
│ RPO: < 1 minute (async lag) │
|
|
776
|
-
│ RTO: < 15 minutes (automated) │
|
|
777
|
-
└─────────────────────────────────────────────────────────────┘
|
|
778
|
-
```
|
|
719
|
+

|
|
720
|
+
|
|
721
|
+
**PRIMARY REGION** (ap-southeast-1: Singapore):
|
|
722
|
+
|
|
723
|
+
- pg-primary (R/W) → pg-replica (R/O) — sync replication
|
|
724
|
+
- WAL streaming (async) tới DR region
|
|
725
|
+
|
|
726
|
+
**DR REGION** (ap-northeast-1: Tokyo):
|
|
727
|
+
|
|
728
|
+
- pg-dr (async replica, read-only) — Lag: < 1 minute
|
|
729
|
+
- pgBackRest S3 backup (encrypted)
|
|
730
|
+
- Standby microservices (cold/warm)
|
|
731
|
+
|
|
732
|
+
**Failover:** DNS switch + Patroni promote DR — **RPO < 1 minute**, **RTO < 15 minutes** (automated)
|
|
779
733
|
|
|
780
734
|
### 5.2. DR Replication Setup
|
|
781
735
|
|
|
@@ -852,23 +806,17 @@ echo "=== DR Replica setup complete ==="
|
|
|
852
806
|
|
|
853
807
|
### 6.1. Recovery Scope
|
|
854
808
|
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
│ Elasticsearch │ Audit logs │ Snapshot │
|
|
867
|
-
│ Application Config │ ConfigMaps, Secrets │ Git + Velero │
|
|
868
|
-
│ Container Images │ Docker images │ Registry │
|
|
869
|
-
│ Certificates │ TLS certs │ cert-manager │
|
|
870
|
-
└─────────────────────────────────────────────────────────────┘
|
|
871
|
-
```
|
|
809
|
+
| Component | State | Recovery |
|
|
810
|
+
|-----------|-------|----------|
|
|
811
|
+
| PostgreSQL | Patient data (PHI) | PITR/Replica |
|
|
812
|
+
| Kafka | Consumer offsets | Reset offset |
|
|
813
|
+
| Kafka | Topic data | Replay logs |
|
|
814
|
+
| Keycloak | Realm, users, roles | Realm export |
|
|
815
|
+
| HashiCorp Vault | Encryption keys | Snapshot |
|
|
816
|
+
| Elasticsearch | Audit logs | Snapshot |
|
|
817
|
+
| Application Config | ConfigMaps, Secrets | Git + Velero |
|
|
818
|
+
| Container Images | Docker images | Registry |
|
|
819
|
+
| Certificates | TLS certs | cert-manager |
|
|
872
820
|
|
|
873
821
|
### 6.2. Kafka Consumer Offset Recovery
|
|
874
822
|
|
|
@@ -1076,43 +1024,38 @@ esac
|
|
|
1076
1024
|
|
|
1077
1025
|
### 8.1. DR Test Runbook
|
|
1078
1026
|
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
│ □ Submit test report to compliance │
|
|
1112
|
-
│ │
|
|
1113
|
-
│ Frequency: Quarterly (HIPAA Addressable §164.308(a)(7)(iv)) │
|
|
1114
|
-
└─────────────────────────────────────────────────────────────┘
|
|
1115
|
-
```
|
|
1027
|
+
**Healthcare DR Test Runbook:**
|
|
1028
|
+
|
|
1029
|
+
**Pre-Test (T-1 week):**
|
|
1030
|
+
|
|
1031
|
+
- [ ] Notify all stakeholders
|
|
1032
|
+
- [ ] Verify backup integrity (`pgbackrest verify`)
|
|
1033
|
+
- [ ] Confirm DR environment is ready
|
|
1034
|
+
- [ ] Review escalation contacts
|
|
1035
|
+
- [ ] Prepare rollback plan
|
|
1036
|
+
|
|
1037
|
+
**Test Execution:**
|
|
1038
|
+
|
|
1039
|
+
- [ ] T+0:00 — Simulate primary failure
|
|
1040
|
+
- [ ] T+0:01 — Verify automated failover triggered
|
|
1041
|
+
- [ ] T+0:05 — Verify DR database accessible
|
|
1042
|
+
- [ ] T+0:10 — Verify application connectivity
|
|
1043
|
+
- [ ] T+0:15 — Verify PHI data integrity (record counts)
|
|
1044
|
+
- [ ] T+0:20 — Test critical operations: Patient lookup, Lab result entry, Prescription creation, Audit log writing
|
|
1045
|
+
- [ ] T+0:30 — Verify audit trail continuity
|
|
1046
|
+
- [ ] T+0:45 — Performance benchmarks
|
|
1047
|
+
|
|
1048
|
+
**Post-Test:**
|
|
1049
|
+
|
|
1050
|
+
- [ ] Document actual RTO achieved
|
|
1051
|
+
- [ ] Document actual RPO (data loss)
|
|
1052
|
+
- [ ] Document any issues encountered
|
|
1053
|
+
- [ ] Update DR plan based on findings
|
|
1054
|
+
- [ ] Failback to primary
|
|
1055
|
+
- [ ] Verify failback successful
|
|
1056
|
+
- [ ] Submit test report to compliance
|
|
1057
|
+
|
|
1058
|
+
**Frequency:** Quarterly (HIPAA Addressable §164.308(a)(7)(iv))
|
|
1116
1059
|
|
|
1117
1060
|
### 8.2. Automated DR Test Script
|
|
1118
1061
|
|