I06 · 資安治理 詳細 ROADMAP
計畫文件,不會被 Quartz 渲染。
回主 roadmap → infra/ROADMAP.md
章節目標
跨層橫切的資安治理 :Identity / Secret / Scanning / Compliance / Network Policy。本章處理基礎設施層的資安 ——不是 app code 層(那在 backend/security/ B16),是誰能存取什麼資源、secret 怎麼管、憑證怎麼輪、漏洞怎麼掃、合規怎麼過 。
跟 backend 的分工 :backend B16 講 SQL injection / OWASP / 輸入驗證(code 層);infra 這章講 IAM / Vault / Scanner / Policy / Compliance (平台層)。
🌱 基本介紹
# 主題 Slug Stage 大綱 01 Infra 資安治理全景 01-security-governance-landscape🌱 從 IAM 到 Compliance 的完整堆疊;雲地差異
❓ 為什麼需要
# 主題 Slug Stage 大綱 02 為什麼 root / admin 不能當日常 02-why-least-privilege🌱 單點失控整個組織暴露;稽核 trail 混亂;最小權限原則實作難點 03 為什麼 secret 不能寫死在 code / config 03-why-not-hardcode-secret🌱 Git history 永遠在;rotation 成本;存取控制;跟 backend/security/ B16 呼應但視角不同 04 為什麼合規(SOC 2 / HIPAA)不是文件活 04-why-compliance-not-paperwork🌱 實際要 infra 層支援 audit log / encryption at rest / access review;一堆技術債
🕰️ 演進
# 主題 Slug Stage 大綱 05 IAM 演進 ⛔️ infra/security-governance/04-identity-access 🌿 跨系列 06 Secret 管理演進 ⛔️ infra/security-governance/09-secrets-config 🌿 跨系列 07 資安治理演進驅動力 07-security-evolution-drivers🌱 單機 root 撞多人協作撞牆 → IAM role;.env 撞 rotation 撞牆 → Vault / KMS;手動 scan 撞 CVE 爆發撞牆 → 自動 scanning CI 整合;peripheral defense 撞 zero-day 撞牆 → Zero Trust 架構
🧠 知識型
F06-A Identity & Access
# 主題 Slug Stage 大綱 08 IAM 基礎 ⛔️ infra/security-governance/04-identity-access 🌿 跨系列 09 K8s RBAC(吸收 k8s/04) ⛔️ infra/k8s/04-k8s-config-rbac 🌿 跨系列 10 雲 IAM 深入(AWS IAM / IRSA / GCP IAM) 10-cloud-iam-deep🌱 Role / Policy / Assume Role / OIDC;跟 infra/cloud/aws/01-aws-account-iam 對照 11 Zero Trust Network 架構 11-zero-trust-architecture🌱 概念層 :不信任 network perimeter;每個 request 都要驗;實作落地(BeyondCorp / Tailscale 類);具體 workload identity 機制見 #1212 SPIFFE / SPIRE Workload Identity 12-spiffe-spire🌱 Zero Trust 的實作骨架 :SPIFFE ID(spiffe://trust-domain/path)、SVID(SPIFFE Verifiable Identity Document)x.509 / JWT 形式;SPIRE server/agent 部署;跨 cluster trust domain federation;跟 service mesh(Istio / Linkerd)整合13 SSO / SAML / OIDC 部署 13-sso-deployment🌱 Keycloak / Okta / Auth0 自架 vs SaaS;企業單簽 infra
F06-B Secret / 憑證管理
# 主題 Slug Stage 大綱 14 Secret / Config 基礎 ⛔️ infra/security-governance/09-secrets-config 🌿 跨系列 15 Secret 憑證管理深入 ⛔️ infra/security-governance/27-secrets-certificate-management 🌿 跨系列 16 Vault 深入部署 16-vault-deploy🌱 HA / Auto-unseal / HSM / Namespace;跨 cluster Vault 17 External Secrets Operator(K8s) 17-eso-k8s🌱 把 Vault / Secrets Manager 同步進 K8s Secret;避免硬抄 18 內部 PKI 與憑證管理 18-internal-pki🌱 聚焦內部 service-to-service 憑證:Vault PKI、內部 CA、service mesh mTLS 的憑證生命週期;Edge ingress TLS(cert-manager + Let’s Encrypt)歸 infra/network-edge/ I01 #24 19 Secret / Config 集中管理(吸收 backend B08 #38) 19-secret-config-centralized🌱 從 backend 吸收:每服務 rotation / 輪替 cost;跨環境 config 策略 20 Secret Rotation 運維實戰 20-secret-rotation-ops🌱 實戰痛點 :rotation schedule 設計(每 90 天 vs event-driven);zero-downtime rotation(雙 key 過渡期);應用端感知策略(SDK auto-reload vs restart);跟 K8s External Secrets Operator / Vault Agent Injector 配合;rotation 失敗的 blast radius 控制
F06-C 漏洞掃描 & 應用資安
# 主題 Slug Stage 大綱 21 Security Scanning 全景 ⛔️ infra/security-governance/26-security-scanning 🌿 跨系列 22 SAST / DAST / SCA / Secret Scan 22-scan-types🌱 靜態 / 動態 / 相依性 / secret leak 四種 scan;CI 整合策略 23 Container Image Scanning 23-image-scan-ops🌱 Trivy / Grype / Snyk;admission webhook 擋漏洞 image 24 Dependency 管理策略 24-dependency-mgmt-ops🌱 Dependabot / Renovate;supply chain attack(xz utils 2024)後的對策 25 Application Security(infra 層視角) ⛔️ infra/security-governance/30-application-security 🌿 跨系列 26 Scanner 結果 Triage 流程 26-scanner-triage-ops🌱 實戰流程 :false positive / false negative 處理;CVSS 評分跟 exploitability 實際風險 gap;誰負責修(dev / sec / ops);SLA 分級(P0-P3);exception process;跟 ticket 系統串接(見 I05 #26 監控→告警→Ticket 鏈)27 Supply Chain Attack 防禦(application level) 27-app-supply-chain-defense🌱 跟 I03 #15 Container Supply Chain 呼應,但聚焦 app 相依 :lockfile pinning / verified publishers / install-time sandboxing(npm --ignore-scripts);typosquatting 防範;xz / event-stream / solarwinds 事件解剖;個人/公司維護者審查策略;整合 Sigstore verify 到 npm install
F06-D Network Security
# 主題 Slug Stage 大綱 28 NetworkPolicy(K8s) 28-network-policy🌱 Pod-to-pod 限制;CNI 支援;Calico / Cilium NetworkPolicy 29 Service Mesh mTLS(infra 視角) 29-mesh-mtls-ops🌱 Istio / Linkerd mTLS 自動化;憑證輪替 30 VPC / Subnet / Security Group 30-vpc-security🌱 跟 infra/cloud/aws/02-aws-vpc-networking 連動;網路層隔離
F06-E Compliance
# 主題 Slug Stage 大綱 31 Compliance 基礎(SOC 2 / ISO 27001 / HIPAA / PCI-DSS) 31-compliance-basics🌱 infra 層要做什麼支援 audit;從 backend B16 F16-F 視角反看(真的運維落地) 32 Audit Log 平台 32-audit-log-platform🌱 不可竄改 log;保留年限;跟 I05 observability 區隔(audit log vs app log) 33 Data Residency 實作 33-data-residency-impl🌱 GDPR / PIPL 地域限制;跟 I08 Multi-region 連動 34 Compliance Audit 季度流程 34-compliance-audit-ops🌱 SOC 2 Type 2 evidence 收集:access review / change log / vendor risk;auto-audit tool(Drata / Vanta / Secureframe / Tugboat Logic);manual evidence 收集痛點;internal audit readiness;跟 management/engineering-process/04-incident-management 連動
F06-F AI / LLM Security(2024+ 新戰場)
LLM 應用大爆發後,一批新的資安議題浮現——不是傳統 code injection 或 SQL injection,而是 prompt injection、data poisoning、context leak、model output 逃脫 。infra 層要在 AI Gateway / RAG 系統做守門。
# 主題 Slug Stage 大綱 35 AI / LLM Security 基礎 35-ai-llm-security-basics🌱 OWASP LLM Top 10;Prompt Injection(direct / indirect / jailbreak);training data poisoning;PII / secret 從 prompt 洩漏;output sanitization;跟 backend/ai/ B20 應用層視角分工(本篇是 infra 層守門) 36 AI Gateway / RAG Security 36-ai-gateway-security🌱 AI Gateway(LiteLLM / Portkey / Kong AI Gateway)做 LLM 請求守門:token rate limit、PII masking、prompt filter、provider failover;RAG 系統的 vector DB access control、retrieval audit log;跟 I02 S01 Gateway for AI agents 連動
🔧 小實作注意事項
# 主題 Slug Stage 大綱 37 本機起 Vault 測試 37-local-vault🌱 Docker Compose + dev mode;跟 app 整合 demo 38 K8s Pod Security Standards 導入 38-pod-security-standards🌱 Restricted / Baseline / Privileged;漸進式 enforce 39 Secret Rotation 演練 39-secret-rotation-drill🌱 DB 密碼 rotation 不停機演練;K8s ESO reload;失敗 fallback 驗證
💣 Anti-pattern
# 主題 Slug Stage 大綱 40 資安治理 Anti-patterns 40-security-governance-antipatterns🌱 IAM role 太寬(*:*)、secret 寫 ConfigMap、CI 用 long-lived token、image 從不 scan、憑證手動 renew、沒 audit log 就無法查事件、K8s 所有 Pod 都跑 default SA、Zero Trust 只買 Tailscale 沒做 workload identity、Scanner 結果無人 triage 一路堆積、LLM Gateway 沒做 prompt filter、Compliance 只做 checklist 不 rehearse
🧰 對應檢查工具
# 主題 Slug Stage 大綱 41 資安治理工具 41-security-tooling🌱 Secret : Vault / SOPS / sealed-secrets / External Secrets Operator;Scanning : Trivy / Snyk / Grype / Semgrep;K8s Security : kube-bench / kube-hunter / Falco;Policy : OPA / Kyverno / Gatekeeper;Identity : SPIRE / Teleport / Pomerium;Compliance : Drata / Vanta / Secureframe;AI Security : Lakera / PromptArmor / NeMo Guardrails
📎 補充
# 主題 Slug Stage 大綱 S01 Policy as Code(OPA / Kyverno) s01-policy-as-code🌱 強制 enforce best practice;admission webhook;跟 backend/auth/ B10 #20 連動但視角不同 S02 Compliance as Code s02-compliance-as-code🌱 Chef InSpec / OpenSCAP;自動化 compliance 檢查
章節進度統計
知識主題 :41 + 2 補充 = 43 項(2026-04 新增 7 題:SPIFFE/SPIRE #12、Secret Rotation 運維 #20、Scanner Triage #26、Supply Chain Attack app-level #27、Compliance Audit #34、F06-F AI/LLM Security 35-36 、Rotation 演練 #39)
🌿 growing:8(既有 infra/ + k8s + pointer)
🌱 seed:35
跨系列連結
→ infra/security-governance/04, 09, 26, 27, 30(原始 security 篇)
→ infra/k8s/04-k8s-config-rbac
→ backend/security/ B16(code 層資安互補)
→ backend/auth/ B10(auth 模型)
→ infra/cloud/aws/01 IAM / 08 Secrets(雲端 IAM 實作)
→ common/quality/standards/(合規跟 infra 配合)
→ infra/disaster-recovery/ I09 #26 DR event 閉環 workflow(alert → ticket → runbook → case → postmortem)
→ I01 Edge(WAF / DDoS 跟本章的 Zero Trust 呼應)
→ infra/disaster-recovery/ I09 #26 DR event 閉環 workflow(alert → ticket → runbook → case → postmortem)
→ I05 Observability(audit log)