Repository navigation
feat(release): package hardened services and scan pinned images - #175
Conversation
…LS status port With the season list at about 3.5 MB, a north gate whose download is lost in a path-MTU black hole keeps the hub's single TLS status listener busy for about six seconds once per 20-second fetch cycle. Venue gates that ask during that time give up after 300 ms. The drill fails until 8444 serves more than one connection at a time.
… every gate Port 8444 serves one connection at a time, so a client that asks for /tickets and stops reading makes every other gate wait seconds for /status. A connection beyond the work queue should be closed at once and counted.
…ist-version test If the gate fetches the new list after the hub installs it and before the test reads the metrics, the assertion that the gate became stale does not hold. Pausing the gate while the hub changes its list removes that window.
Port 8444 served one connection at a time, so one client that stopped reading held /status and ticket fetches for every gate for seconds. It now hands accepted connections to a bounded queue of 16 served by four workers, closes and counts a connection when the queue is full, and keeps the 2 s step and 10 s connection deadlines. Port 8081 stays one thread for staff. The TLS slow-reader check in the status deadline test described the one-thread behaviour: status waited until the slow reader was cut; it now requires an answer within 1 s.
The hub now mails when the data centre is unreachable or the uplink watcher stops.
This review covers the north entrance ticket list failure, the lab reproductions, recovery work, and remaining limitations.
Clarify when extra tickets are needed to reproduce the sender hold.
This decision preserves path-MTU feedback and makes each gate's installed list visible. It also aligns the hub's served and decision lists and bounds the TLS status listener. Co-authored-by: Yuki Tanaka <yuki.tanaka@elsworne.example>
|
Ingrid Larsen · reviewer Does installing the package start the gate service? 安装软件包会启动闸机服务吗? |
|
Yuki Tanaka · author No. 不会。 |
|
Ingrid Larsen · reviewer Trivy runs with Trivy 带了 |
|
Yuki Tanaka · author HIGH or CRITICAL vulnerabilities that have a fix available, in either the build or the lab image; 构建镜像或实验镜像里有修复版本的 HIGH 或 CRITICAL 漏洞; |
Why
There was no installable form of the services: nothing packaged the binaries, the configuration or a service user, and the only unit file was the lab's
lab/systemd/gated.service. A release also needs its build and lab images checked for known vulnerabilities.What changed
install()rules and CPack produce two Debian packages,gatepost-gatedandgatepost-gate-hub. Each carries its binary, a launcher in/usr/lib/gatepost, a systemd unit, and example configuration under/etc/gatepostmarked as conffiles.packaging/postinstcreates thegatepostsystem user and group,/var/lib/gatepost, a root-only/etc/gatepost/credentialsand a group-readable/etc/gatepost/mac-keys, then runssystemctl daemon-reload. It does not enable or start a service.gatepostwithNoNewPrivileges,ProtectSystem=strict,ProtectHome,PrivateTmp, kernel and cgroup protections andStateDirectory=gatepost, and receive their TLS files throughLoadCredential=.gated.serviceisType=notifywithWatchdogSec=10and onlyCAP_NET_RAW.packaging/run-gated.shandpackaging/run-gate-hub.shmap the credential directory to theGATEPOST_TLS_*variables and start the daemons from the environment file;run-gatedrefuses to start withoutGATEPOST_HUB..github/workflows/release.yml, onv*tags or manual dispatch: build and test thereleasepreset, build the packages, generate an SPDX SBOM with Syft 1.55.0, and fail on HIGH or CRITICAL vulnerabilities with an available fix in the build and lab images, found by Trivy 0.71.1. Actions and scanner images are pinned by digest.docs/operations/packages.mdanddocs/operations/logging.mdwith Chinese versions, linked from both READMEs.How to verify
Requires Docker. From the repository root:
Check the two package names, their dependencies, the unit files, launchers and conffiles. On a systemd target, run
systemd-analyze verifyon the installed units as the packages page describes. The package version still comes fromproject(), which is 0.3.0 here.背景
之前服务没有可安装的形式:没有东西把程序、配置和服务用户打包,唯一的服务单元是实验环境里的
lab/systemd/gated.service。发布还需要检查构建镜像和实验镜像有没有已知漏洞。改动
install()规则和 CPack 生成两个 Debian 软件包:gatepost-gated和gatepost-gate-hub。每个包含程序本身、/usr/lib/gatepost下的启动脚本、systemd 服务单元,以及/etc/gatepost下标记为 conffile 的示例配置。packaging/postinst创建gatepost系统用户和组、/var/lib/gatepost、只有 root 能访问的/etc/gatepost/credentials和组可读的/etc/gatepost/mac-keys,然后执行systemctl daemon-reload。它不会启用或启动服务。gatepost身份运行,设置NoNewPrivileges、ProtectSystem=strict、ProtectHome、PrivateTmp、内核与 cgroup 保护以及StateDirectory=gatepost,TLS 文件通过LoadCredential=传入。gated.service为Type=notify,带WatchdogSec=10,只保留CAP_NET_RAW。packaging/run-gated.sh和packaging/run-gate-hub.sh把凭据目录映射到GATEPOST_TLS_*变量,按环境文件启动守护进程;没有GATEPOST_HUB时run-gated拒绝启动。.github/workflows/release.yml在推送v*标签或手动触发时运行:构建并测试releasepreset,打包,用 Syft 1.55.0 生成 SPDX SBOM,并用 Trivy 0.71.1 扫描构建镜像和实验镜像,发现有修复版本的 HIGH 或 CRITICAL 漏洞即失败。各 action 和扫描工具镜像都按 digest 固定。docs/operations/packages.md、docs/operations/logging.md及中文版,两个 README 都加了链接。怎么验证
需要 Docker。在仓库根目录运行:
核对两个包名、依赖、服务单元、启动脚本和 conffile。在使用 systemd 的目标机上,按软件包文档对安装好的服务单元运行
systemd-analyze verify。包的版本仍取自project(),这里还是 0.3.0。