foxly-it/rootguard-unbound
GitHub: foxly-it/rootguard-unbound
一个经过安全强化的多架构 Unbound Docker 镜像,提供内置 DNSSEC 验证的递归 DNS 解析服务。
Stars: 0 | Forks: 0
# RootGuard Unbound

**RootGuard Unbound 是一个经过强化的、多架构的递归 DNS 解析器容器,并支持 DNSSEC 验证。** 它跟踪官方的 Debian Unbound 包,每天重新构建以获取安全更新,并提供不可变的基础配置以及一个可安全更新的模块化配置层。
[](https://github.com/foxly-it/rootguard-unbound/actions/workflows/build.yml)
[](https://github.com/foxly-it/rootguard-unbound/pkgs/container/rootguard-unbound)
[](#verify-dnssec)
[](LICENSE)
[容器镜像](https://github.com/foxly-it/rootguard-unbound/pkgs/container/rootguard-unbound) ·
[RootGuard](https://github.com/foxly-it/rootguard) ·
[手册](https://rootguard.foxly.de/docs.html#unbound) ·
[安全](#security-model)
## 快速开始
```
docker run -d \
--name rootguard-unbound \
-p 127.0.0.1:5335:5335/tcp \
-p 127.0.0.1:5335:5335/udp \
ghcr.io/foxly-it/rootguard-unbound:latest
```
测试递归解析:
```
dig @127.0.0.1 -p 5335 example.com A
```
完整的 RootGuard 技术栈将 AdGuard Home 连接到此解析器,并通过经过验证的预览、版本控制和回滚工作流来管理其模块化配置。
## 功能特性
- `stable-slim` 上的官方 Debian `unbound` 包。
- 适用于 `amd64` 和 `arm64` 的多架构镜像。
- 每日重新构建以获取 Debian 安全更新。
- DNSSEC 验证以及可写的 RFC 5011 trust-anchor 状态。
- 非 root 运行时、兼容只读文件系统,且未添加额外 capabilities。
- 私有网络访问控制和私有地址保护。
- 不可变的基础配置,包含位于
`/etc/unbound/unbound.d/` 下的模块化 includes。
- 源自所安装 Debian 包的版本标签。
## Docker Compose
```
services:
unbound:
image: ghcr.io/foxly-it/rootguard-unbound:latest
restart: unless-stopped
ports:
- "127.0.0.1:5335:5335/tcp"
- "127.0.0.1:5335:5335/udp"
read_only: true
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
volumes:
- unbound-config:/etc/unbound/unbound.d
- unbound-state:/var/lib/unbound
volumes:
unbound-config:
unbound-state:
```
## 配置模型
| 路径 | 用途 |
| --- | --- |
| `/etc/unbound/unbound.conf` | 不可变的安全和网络基线 |
| `/etc/unbound/unbound.d/` | 模块化、可安全更新的受管配置 |
| `/var/lib/unbound/root.key` | 可写的 DNSSEC trust-anchor 状态 |
基础配置监听 `5335` 端口,允许 localhost 和私有容器网段,验证 DNSSEC,并保护私有地址。RootGuard 仅生成模块化 includes,并在激活前使用 `unbound-checkconf` 验证完整结果。
## 验证 DNSSEC
```
dig @127.0.0.1 -p 5335 example.com A
dig @127.0.0.1 -p 5335 dnssec-failed.org A
```
有效的签名响应应包含 `ad` 标志。故意配置错误的域名 `dnssec-failed.org` 必须返回 `SERVFAIL`。
## 镜像标签和构建
GitHub Actions 流水线会验证配置,发布两种架构,并使用 Debian 包版本对镜像打标签:
- `latest`
- 完整的 Debian 包版本
- 上游 Unbound 版本
- 主要/次要 Unbound 版本
- 可选的 RootGuard 发布标签
## 安全模型
- 以 Debian 打包的非 root `unbound` 用户身份运行。
- 支持只读根文件系统,并丢弃所有 Linux capabilities。
- 未配置为公共开放解析器。
- 隐藏解析器身份并最小化响应。
- 默认应用 DNSSEC 和私有地址保护。
如需私下报告漏洞,请参阅 [SECURITY.md](SECURITY.md) 中的说明。
## 贡献
在提交 pull request 之前,请阅读 [CONTRIBUTING.md](CONTRIBUTING.md)。建议从带有以下标签的 issue 开始:
[`good first issue`](https://github.com/foxly-it/rootguard-unbound/labels/good%20first%20issue)
或 [`help wanted`](https://github.com/foxly-it/rootguard-unbound/labels/help%20wanted)。
## 许可证
RootGuard Unbound 基于
[GNU AGPL-3.0-or-later](LICENSE) 授权。该软件许可证并未授予使用 RootGuard 或 Foxly IT 名称及徽标的权利。
标签:DNSSEC, Docker, Unbound, 安全防御评估, 系统安全加固, 网络基础设施, 请求拦截, 递归DNS