Files
nexus/wiki/concepts/Defense-in-Depth.md

43 lines
1.8 KiB
Markdown
Raw 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.
---
title: "Defense-in-Depth"
type: concept
tags: [security, devsecops, ai-agents, risk-management]
date: 2026-04-22
---
## Definition
Defense-in-Depth纵深防御是一种信息安全策略通过叠加多层独立的安全控制措施确保任何单一安全措施的失效不会导致系统完全沦陷。每层防线相互补足即使攻击者突破一层仍面临其他层的阻挡。
## In AI Agent Security Context
在 [[self-healing-home-server]] 中,纵深防御针对 AI Agent 的特殊风险构建(特别是 [[OpenClaw]] 的 [[TruffleHog]] 第1天 API Key 泄露教训):
### 多层防御架构
```
Layer 1: Pre-push hooks (TruffleHog)
↓ 阻止内嵌 secrets 的 commit
Layer 2: Local-first Git (私有 Gitea)
↓ 所有代码先到私有仓库
Layer 3: CI Scanning Pipeline
↓ TruffleHog + 依赖漏洞扫描
Layer 4: Human Review
↓ 必须人工审核 main 分支
Layer 5: 1Password AI Vault
↓ Agent 只能读取专用 vault 中的凭证
Layer 6: Network Segmentation
↓ 敏感服务网络隔离
Layer 7: Daily Security Audit
↓ 每日自动检查特权容器/过度权限
```
## Key Principle
> "Never trust a single security control." — 纵深防御的核心哲学
AI Agent 的风险在于它们**缺乏人类的"常识性危险感知"**——Agent 会在代码中直接写入 API Key而不产生"直觉性警告"。因此,安全防线必须设计为即使 Agent 无意识地绕过一层,仍有多层阻止最终损害。
## Connections
- [[TruffleHog]] — 第1层防线pre-push secrets 检测
- [[Local-first Git]] — 第2-3层防线私有仓库 + CI 扫描
- [[1Password]] — 第5层防线凭证安全管理
- [[OpenClaw]] — 需要纵深防御保护的 Agent 平台
- [[Agentic AI]] — 纵深防御是对 AI Agent 固有风险的主动应对