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(平台層)。


🌱 基本介紹

#主題SlugStage大綱
01Infra 資安治理全景01-security-governance-landscape🌱從 IAM 到 Compliance 的完整堆疊;雲地差異

❓ 為什麼需要

#主題SlugStage大綱
02為什麼 root / admin 不能當日常02-why-least-privilege🌱單點失控整個組織暴露;稽核 trail 混亂;最小權限原則實作難點
03為什麼 secret 不能寫死在 code / config03-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;一堆技術債

🕰️ 演進

#主題SlugStage大綱
05IAM 演進⛔️ infra/security-governance/04-identity-access🌿跨系列
06Secret 管理演進⛔️ 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

#主題SlugStage大綱
08IAM 基礎⛔️ infra/security-governance/04-identity-access🌿跨系列
09K8s 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 對照
11Zero Trust Network 架構11-zero-trust-architecture🌱概念層:不信任 network perimeter;每個 request 都要驗;實作落地(BeyondCorp / Tailscale 類);具體 workload identity 機制見 #12
12SPIFFE / SPIRE Workload Identity12-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)整合
13SSO / SAML / OIDC 部署13-sso-deployment🌱Keycloak / Okta / Auth0 自架 vs SaaS;企業單簽 infra

F06-B Secret / 憑證管理

#主題SlugStage大綱
14Secret / Config 基礎⛔️ infra/security-governance/09-secrets-config🌿跨系列
15Secret 憑證管理深入⛔️ infra/security-governance/27-secrets-certificate-management🌿跨系列
16Vault 深入部署16-vault-deploy🌱HA / Auto-unseal / HSM / Namespace;跨 cluster Vault
17External 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
19Secret / Config 集中管理(吸收 backend B08 #38)19-secret-config-centralized🌱從 backend 吸收:每服務 rotation / 輪替 cost;跨環境 config 策略
20Secret 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 漏洞掃描 & 應用資安

#主題SlugStage大綱
21Security Scanning 全景⛔️ infra/security-governance/26-security-scanning🌿跨系列
22SAST / DAST / SCA / Secret Scan22-scan-types🌱靜態 / 動態 / 相依性 / secret leak 四種 scan;CI 整合策略
23Container Image Scanning23-image-scan-ops🌱Trivy / Grype / Snyk;admission webhook 擋漏洞 image
24Dependency 管理策略24-dependency-mgmt-ops🌱Dependabot / Renovate;supply chain attack(xz utils 2024)後的對策
25Application Security(infra 層視角)⛔️ infra/security-governance/30-application-security🌿跨系列
26Scanner 結果 Triage 流程26-scanner-triage-ops🌱實戰流程:false positive / false negative 處理;CVSS 評分跟 exploitability 實際風險 gap;誰負責修(dev / sec / ops);SLA 分級(P0-P3);exception process;跟 ticket 系統串接(見 I05 #26 監控→告警→Ticket 鏈)
27Supply 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

#主題SlugStage大綱
28NetworkPolicy(K8s)28-network-policy🌱Pod-to-pod 限制;CNI 支援;Calico / Cilium NetworkPolicy
29Service Mesh mTLS(infra 視角)29-mesh-mtls-ops🌱Istio / Linkerd mTLS 自動化;憑證輪替
30VPC / Subnet / Security Group30-vpc-security🌱infra/cloud/aws/02-aws-vpc-networking 連動;網路層隔離

F06-E Compliance

#主題SlugStage大綱
31Compliance 基礎(SOC 2 / ISO 27001 / HIPAA / PCI-DSS)31-compliance-basics🌱infra 層要做什麼支援 audit;從 backend B16 F16-F 視角反看(真的運維落地)
32Audit Log 平台32-audit-log-platform🌱不可竄改 log;保留年限;跟 I05 observability 區隔(audit log vs app log)
33Data Residency 實作33-data-residency-impl🌱GDPR / PIPL 地域限制;跟 I08 Multi-region 連動
34Compliance 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 系統做守門。

#主題SlugStage大綱
35AI / 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 層守門)
36AI Gateway / RAG Security36-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 連動

🔧 小實作注意事項

#主題SlugStage大綱
37本機起 Vault 測試37-local-vault🌱Docker Compose + dev mode;跟 app 整合 demo
38K8s Pod Security Standards 導入38-pod-security-standards🌱Restricted / Baseline / Privileged;漸進式 enforce
39Secret Rotation 演練39-secret-rotation-drill🌱DB 密碼 rotation 不停機演練;K8s ESO reload;失敗 fallback 驗證

💣 Anti-pattern

#主題SlugStage大綱
40資安治理 Anti-patterns40-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

🧰 對應檢查工具

#主題SlugStage大綱
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

📎 補充

#主題SlugStage大綱
S01Policy as Code(OPA / Kyverno)s01-policy-as-code🌱強制 enforce best practice;admission webhook;跟 backend/auth/ B10 #20 連動但視角不同
S02Compliance as Codes02-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)