Asclepius 通过恢复文件并主动测试其可恢复性来验证备份的完整性。它不依赖元数据,而是尝试解析真实的文件格式(文档、图像、视频、归档、电子邮件),以确认备份确实可读且可安全使用。
git clone https://github.com/matank001/asclepius
cd asclepius
uv sync
# macOS
brew install ffmpeg
# Ubuntu/Debian
sudo apt install ffmpeg
# Arch Linux
sudo pacman -S ffmpeg
uv run asclepius -f /path/to/file.pdf
# Validate all files in directory
uv run asclepius -d /path/to/backups
# Randomly sample N files from directory
uv run asclepius -d /path/to/backups --rand-sample 100
与验证仓库结构和数据完整性的 restic check 不同,Asclepius 通过恢复快照并测试文件是否真正可读、可解析来执行功能性验证。
运行元数据检查以验证仓库完整性:
uv run asclepius --restic-repo /path/to/repo --restic-passwd your-password
将每个快照恢复到临时目录并验证所有文件:
# Validate all files in all snapshots
uv run asclepius --restic-repo /path/to/repo --restic-passwd your-password --recover
# Validate random 100 files from each snapshot (faster for large backups)
uv run asclepius --restic-repo /path/to/repo --restic-passwd your-password --recover --rand-sample 100
按 ID 恢复并验证单个快照:
# Validate all files in specific snapshot
uv run asclepius --restic-repo /path/to/repo --restic-passwd your-password --recover --snapshot ab4eb95a
# Validate random 50 files from specific snapshot
uv run asclepius --restic-repo /path/to/repo --restic-passwd your-password --recover --snapshot ab4eb95a --rand-sample 50
验证器在 validators.yaml 中配置。每个验证器指定支持的 MIME 类型、文件扩展名和验证设置。
YARA 验证器扫描所有文件以查找恶意软件特征。要启用它:
git clone [email protected]:embee-research/Yara-detection-rules.git
validators.yaml 中配置路径:settings:
yara_rules_path: "Yara-detection-rules"
如果未找到 YARA 规则或规则编译失败,验证器将在启动时发出一次警告并跳过扫描。
MIT 许可证 - 详见 LICENSE。