opencode-workflow/skills/security-boundary-design/README.zh-TW.md

38 lines
1.7 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 安全邊界設計 (Security Boundary Design) 知識合約指南
## 概述
`security-boundary-design` 是知識合約,用來提供安全邊界設計的原則與模式。涵蓋 Authentication、Authorization、Service Identity、Token Propagation、Tenant Isolation、Secret Management 與 Audit Logging。供 `design-architecture` 在定義 Security Boundaries 時參考。
## 核心原則
### Defense in Depth
- 不要依賴單一安全邊界
- 在每一層套用安全:網路、服務、資料、應用
- 假設已被入侵:設計時讓單層被破壞不會導致全盤被破壞
### Least Privilege
- 服務與使用者應該只有最小必要權限
- 預設拒絕:從無權限開始,明確授予
- 定期輪換與過期憑證
### Zero Trust
- 不要預設信任內部網路流量
- 每次服務對服務呼叫都要認證與授權
- 傳輸中資料必須加密,即使在內部網路也是
## 設計重點
- **Authentication**Token-based、API Key、Certificate-based、Session-based
- **Authorization**RBAC、ABAC、ACL、ReBAC 的選擇與粒度
- **Service Identity**Service Accounts、Workload Identity、Service Mesh Identity
- **Token Propagation**Pass-through、Token Exchange、Token Relay、Impersonation
- **Tenant Isolation**Database-level、Schema-level、Row-level、Application-level
- **Secret Management**Environment Variables、Secret Management Service、Platform-native、Configuration Service
- **Audit Logging**:認證/授權事件、日誌修改操作、行政動作
## 知識合約職責
- 提供安全邊界設計的理論指引
- 不直接產生安全配置或憑證管理設定
## 不應做的事
- 不替系統選擇特定安全技術
- 不定義具體的 RBAC 角色或權限
- 不產生安全設定檔案