fix(daemon): harden launchd plist with umask 077 (#31919)

* fix(daemon): add launchd umask hardening

* fix: finalize launchd umask changelog + thanks (#31919) (thanks @liuxiaopai-ai)

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
This commit is contained in:
Mark L
2026-03-03 02:13:41 +08:00
committed by GitHub
parent 16df7ef4a9
commit 718d418b32
3 changed files with 9 additions and 2 deletions

View File

@@ -1,6 +1,9 @@
import { PassThrough } from "node:stream";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { LAUNCH_AGENT_THROTTLE_INTERVAL_SECONDS } from "./launchd-plist.js";
import {
LAUNCH_AGENT_THROTTLE_INTERVAL_SECONDS,
LAUNCH_AGENT_UMASK_DECIMAL,
} from "./launchd-plist.js";
import {
installLaunchAgent,
isLaunchAgentListed,
@@ -201,6 +204,8 @@ describe("launchd install", () => {
expect(plist).not.toContain("<key>SuccessfulExit</key>");
expect(plist).toContain("<key>ThrottleInterval</key>");
expect(plist).toContain(`<integer>${LAUNCH_AGENT_THROTTLE_INTERVAL_SECONDS}</integer>`);
expect(plist).toContain("<key>Umask</key>");
expect(plist).toContain(`<integer>${LAUNCH_AGENT_UMASK_DECIMAL}</integer>`);
});
it("restarts LaunchAgent with bootout-bootstrap-kickstart order", async () => {