Update AGENTS.md: Security Audit Phase 9 documentation
This commit is contained in:
63
AGENTS.md
63
AGENTS.md
@@ -1546,6 +1546,69 @@ cargo test -p markbase-core --lib # 135 passed, 0 failed
|
||||
|
||||
---
|
||||
|
||||
**最後更新**:2026-06-19 01:00
|
||||
**版本**:1.18(安全審計 Phase 9 完成)
|
||||
|
||||
## 安全審計 Phase 9 完成(2026-06-19)⭐⭐⭐⭐⭐
|
||||
|
||||
**完成時間**:約 30 分鐘
|
||||
**新增代碼量**:305 行
|
||||
**新增測試**:18 個安全測試
|
||||
**Git commit**:963513e
|
||||
|
||||
### 实施内容 ⭐⭐⭐⭐⭐
|
||||
|
||||
**security_audit 模塊**(`markbase-core/src/security_audit/`):
|
||||
|
||||
| 子模塊 | 測試數 | 功能 |
|
||||
|-------|-------|------|
|
||||
| auth_security.rs | 4 | Password brute force、Public key、User status、Home dir security |
|
||||
| crypto_security.rs | 5 | AES-CTR、HMAC-SHA256、Curve25519、Ed25519、Key uniqueness |
|
||||
| file_access_security.rs | 5 | Path traversal、Absolute path、Symlink attack、Directory escape、Hidden files |
|
||||
| channel_security.rs | 4 | Manager creation、Window limits、Request validation、Data integrity |
|
||||
|
||||
### 安全測試詳情 ⭐⭐⭐⭐⭐
|
||||
|
||||
**認證安全測試**:
|
||||
- ✅ Password brute force prevention(正確密碼成功、錯誤密碼失敗)
|
||||
- ✅ Public key authentication security(空 keys list 測試)
|
||||
- ✅ User status check(active user status=1)
|
||||
- ✅ Home directory security(禁止 ..、/etc、/root)
|
||||
|
||||
**加密安全測試**:
|
||||
- ✅ AES-CTR encryption/decryption consistency
|
||||
- ✅ HMAC-SHA256 authentication(MAC 生成 + 驗證)
|
||||
- ✅ Curve25519 key exchange(shared secret 匹配)
|
||||
- ✅ Ed25519 signature verification(簽名長度 64 bytes)
|
||||
- ✅ Encryption key derivation uniqueness(不同密鑰產生不同 ciphertext)
|
||||
|
||||
**文件訪問安全測試**:
|
||||
- ✅ Path traversal prevention(檢查路徑不逃離 root)
|
||||
- ✅ Absolute path prevention(絕對路徑不逃離 root)
|
||||
- ✅ Symlink attack prevention(symlink 目標在 root 内)
|
||||
- ✅ Directory escape prevention(../../ 檢查)
|
||||
- ✅ Hidden file access(.hidden 文件安全訪問)
|
||||
|
||||
**Channel 安全測試**:
|
||||
- ✅ Channel manager creation
|
||||
- ✅ Window size limits(max 1MB)
|
||||
- ✅ Request validation(exec、shell、subsystem、env)
|
||||
- ✅ Data integrity(data 不超過 window size)
|
||||
|
||||
### 測試結果 ✅
|
||||
|
||||
```bash
|
||||
cargo test -p markbase-core --lib # 153 passed, 0 failed
|
||||
```
|
||||
|
||||
### Git 提交
|
||||
|
||||
**Commit 963513e**: "Add Security Audit Phase 9: comprehensive SSH security tests"
|
||||
|
||||
**推送到**:✅ m5max128gitea + ✅ m4minigitea
|
||||
|
||||
---
|
||||
|
||||
**最後更新**:2026-06-18 16:00
|
||||
**版本**:1.13(VFS/DataProvider/Config 重構 Phase 1-6 完成)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user