部署开源漏洞扫描工具 SiriusScan 及问题解决
SiriusScan 的核心代码托管在 GitHub 上,支持开源二次开发。官方网址 Docker 进行。
详细记录了开源漏洞扫描工具 SiriusScan 基于 Docker 的部署全过程,涵盖环境准备、Docker 安装配置、镜像源加速及系统启动步骤。针对构建阶段常见的 Go 模块网络超时、结构体字段错误及 GitHub 克隆失败等典型问题,提供了修改 Dockerfile、清理缓存及使用代理地址的具体解决方案,帮助用户顺利完成本地化部署。

SiriusScan 的核心代码托管在 GitHub 上,支持开源二次开发。官方网址 Docker 进行。
部署 SiriusScan 主要依赖符合版本的 Docker 和 Docker Compose,其他为硬件、网络和系统类要求。
网络方面需配置好 IP 地址和 DNS,特别是 DNS(根据区域配置)。确保能正常更新系统和访问 GitHub 等网站。
如果是新系统最好把系统的源也配置好(以 Debian 12 为例):
# 配置系统源,配置合适的源,debian 源的配置文件是/etc/apt/sources.list
nano /etc/apt/sources.list
# 添加如下内容:
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ trixie main contrib non-free non-free-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ trixie main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ trixie-updates main contrib non-free non-free-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ trixie-updates main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ trixie-backports main contrib non-free non-free-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ trixie-backports main contrib non-free non-free-firmware
deb https://security.debian.org/debian-security trixie-security main contrib non-free non-free-firmware
deb-src https://security.debian.org/debian-security trixie-security main contrib non-free non-free-firmware
根据自己的系统选择安装方式,以下以 Debian 系统为例:
# 运行以下命令卸载所有冲突的包
for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do
sudo apt-get remove $pkg
done
一般有 2 种安装方式,根据自己需要选择一种。
在新主机上首次安装 Docker Engine 之前,需要设置 Docker apt 存储库。
设置 Docker 的 apt 存储库
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
安装 Docker 软件包
安装最新版本(一般推荐这个):
# 如果要安装最新版本,请运行:
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
安装指定版本:
# List the available versions:
root@sirius:~# apt-cache madison docker-ce | awk '{ print $3 }'
5:28.5.1-1~debian.12~bookworm
...
# 选择所需的版本并安装:
VERSION_STRING=5:28.5.1-1~debian.12~bookworm
sudo apt-get install docker-ce=$VERSION_STRING docker-ce-cli=$VERSION_STRING containerd.io docker-buildx-plugin docker-compose-plugin
验证 Docker 是否正在运行,使用:
sudo systemctl status docker
某些系统可能会禁用此行为,并且需要手动启动:
sudo systemctl start docker
查看版本:
docker version
docker compose version
pool/stable/ 并选择适用的架构(amd64、armhf、arm64 或 s390x)。- containerd.io_<version>_<arch>.deb
- docker-ce_<version>_<arch>.deb
- docker-ce-cli_<version>_<arch>.deb
- docker-buildx-plugin_<version>_<arch>.deb
- docker-compose-plugin_<version>_<arch>.deb
以上五个文件都要安装。
安装 .deb 软件包。将以下示例中的路径更新为下载 Docker 软件包的位置。
sudo dpkg -i ./containerd.io_<version>_<arch>.deb \
./docker-ce_<version>_<arch>.deb \
./docker-ce-cli_<version>_<arch>.deb \
./docker-buildx-plugin_<version>_<arch>.deb \
./docker-compose-plugin_<version>_<arch>.deb
要验证 Docker 是否正在运行,使用:
sudo systemctl status docker
某些系统可能会禁用此行为,并且需要手动启动:
sudo systemctl start docker
查看版本:
docker version
docker compose version
在 /etc/docker/ 目录下创建 daemon.json 文件,并添加源的信息。
编辑 daemon.json 文件
nano /etc/docker/daemon.json
添加如下信息:
{
"registry-mirrors": [
"https://do.nark.eu.org",
"https://dc.j8.work",
"https://mirror.aliyuncs.com/",
"https://docker.mirrors.ustc.edu.cn/",
"https://hub-mirror.c.163.com",
"https://mirror.baidubce.com",
"https://docker.m.daocloud.io",
"https://dockerproxy.com",
"https://docker.1panel.live",
"https://docker.1ms.run",
"https://dytt.online",
"https://registry.cyou",
"https://docker.xiaogenban1993.com",
"https://lispy.org",
"https://docker-0.unsee.tech",
"https://docker.mirrors.ustc.edu.cn",
"https://docker.nju.edu.cn"
]
}
载入配置生效
systemctl daemon-reload
重启 docker 服务
systemctl restart docker
# Clone and start Sirius
git clone https://github.com/SiriusScan/Sirius.git
cd Sirius
docker compose up -d
最后成功是这样:
登录地址 http://服务主机 IP:3000
登录凭据:
adminpassword根据官网步骤就三个命令非常简单:
git clone https://github.com/SiriusScan/Sirius.git
cd Sirius
docker compose up -d
在克隆 GitHub 上的 Sirius 项目时一般没什么问题,一遍步行可以多执行几遍就可以了。
大部分的问题都会出现在 docker compose up -d(构建、启动容器以及拉取镜像等等方面)。
这个错误是因为在 Docker 构建过程中,go mod download 步骤无法连接到 Go 模块代理服务器(proxy.golang.org),出现了网络超时问题。
这种情况下需要编辑相应模块的 Dockerfile 文件来添加代理,这里出问题的是 sirius-ui 中的 app-system-monitor 模块,所以要编辑此模块的 Dockerfile 文件,凡是要执行 go mod download 命令的地方都添加代理:
# 编辑 Dockerfile 命令:nano sirius-ui/Dockerfile
# 找到要修改的地方
# Clone and build system monitor
ENV GOPROXY=https://mirrors.aliyun.com/goproxy/,direct
# 这是要添加的信息
ENV GOSUMDB=off
# 这也是要添加的信息
RUN git clone https://github.com/SiriusScan/app-system-monitor.git /tmp/system-monitor &&\
cd /tmp/system-monitor &&\
go mod download &&\
CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -o system-monitor main.go &&\
cp system-monitor /system-monitor/ &&\
chmod +x /system-monitor/system-monitor &&\
rm -rf /tmp/system-monitor
为了防止其他模块出现同样问题,可以把其他模块(sirius-api、sirius-postgres、sirius-engine、sirius-rabbitmq、sirius-valkey)中的 Dockerfile 都添加了代理。或者那个出错就添加那个。
修改完以上信息后再次执行 docker compose up -d 命令。
这是一个 Go 语言编译错误,问题出现在 sirius.Port 结构体的字段不匹配上。
unknown field ID in struct literal of type sirius.Port
这表明 sirius.Port 结构体中没有名为 ID 的字段,但代码中尝试使用这个字段。
解决办法:清理 docker 缓存
# 命令
docker builder prune -a
清理完毕后再执行构建命令
docker compose up -d
再报同样错就清理缓存后,将 Sirius 项目删除后,重新拉取。
Git 在克隆仓库时无法连接到 GitHub,基本原因是网络问题。在上面我们都已经添加了代理,所以现在的办法就是使用 GitHub 代码库的缓存加速站点,需要修改一下克隆的地址,例如将克隆的地址 https://github.com/SiriusScan/app-system-monitor.git
修改如下:
清理一下缓存
docker builder prune -a
再重新执行构建行命令
docker compose up -d
在报相同网络超时的错误时,一般多执行 2 遍 docker compose up -d 命令就可以了。
部署完成后,若登录系统未显示主机,建议检查构建日志或网络防火墙设置。

微信公众号「极客日志」,在微信中扫描左侧二维码关注。展示文案:极客日志 zeeklog
将字符串编码和解码为其 Base64 格式表示形式即可。 在线工具,Base64 字符串编码/解码在线工具,online
将字符串、文件或图像转换为其 Base64 表示形式。 在线工具,Base64 文件转换器在线工具,online
将 Markdown(GFM)转为 HTML 片段,浏览器内 marked 解析;与 HTML转Markdown 互为补充。 在线工具,Markdown转HTML在线工具,online
将 HTML 片段转为 GitHub Flavored Markdown,支持标题、列表、链接、代码块与表格等;浏览器内处理,可链接预填。 在线工具,HTML转Markdown在线工具,online
通过删除不必要的空白来缩小和压缩JSON。 在线工具,JSON 压缩在线工具,online
将JSON字符串修饰为友好的可读格式。 在线工具,JSON美化和格式化在线工具,online