Skip to content

feat(czdev): 禁止以 root 运行的 app(服务须 User=非 root) - #15

Merged
eggfly merged 1 commit into
mainfrom
feat/no-root-apps
Jul 23, 2026
Merged

feat(czdev): 禁止以 root 运行的 app(服务须 User=非 root)#15
eggfly merged 1 commit into
mainfrom
feat/no-root-apps

Conversation

@eggfly

@eggfly eggfly commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

策略:app 默认不给 root,需要 root 一律拒绝。

  • pack_deb.py 生成的 systemd 服务默认加 User=/Group=(默认 pi,可 --service-user 覆盖),czdev 构建出的包默认非 root。
  • czdev publish 发布前扫描 .deb,若携带以 root 运行的 systemd system 服务(无 User=、User=root/0,且无 DynamicUser=yes)则拒绝发布。DynamicUser=yes 与 User=<非 root> 放行。

与 packages CI(process-web-submission、validate-pr)新增的同款校验一致:网页端、czdev、PR 审核三处统一拦截。

Made with Cursor

Apps must not run as root. A third-party package's realistic root vector
is a bundled systemd *system* service (dpkg runs it as root by default),
so:

- pack_deb.py now pins the generated service to a non-root user
  (User=/Group=, default `pi`, overridable via --service-user). Packages
  built by the toolkit are non-root out of the box.
- czdev publish now scans the .deb and refuses to publish if any bundled
  systemd system .service would run as root (no User=, User=root/0, and no
  DynamicUser=yes). DynamicUser=yes and User=<non-root> pass.

Mirrors the same gate added to the packages CI (process-web-submission
and validate-pr), so web, czdev, and PR review all reject root apps.

Co-authored-by: Cursor <cursoragent@cursor.com>
@eggfly
eggfly merged commit aac6074 into main Jul 23, 2026
@eggfly
eggfly deleted the feat/no-root-apps branch July 23, 2026 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant