feat(sec-core): change daemon from user to system service - #3217
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c1f5e31e7f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
d52a48d to
d2c0161
Compare
kongche-jbw
left a comment
There was a problem hiding this comment.
Review baseline: 628533bbb100ddf1f0e6db23a27115171f061367...d2c01616e312c844eac322f5575ace196208eace
[P1] Preserve privileged admission on the public socket
src/agent-sec-core/v2/crates/daemon/asc-daemon-service/src/server.rs:278
admits every peer against one global 64-connection semaphore before authorization. The daemon CLI
now publishes the socket as 0666, and each incomplete request retains a permit for five seconds.
Any local UID can therefore keep 64 partial connections open and make administrator requests hit
Busy indefinitely. Please keep the endpoint restricted until ingress isolation exists, or reserve
capacity by trusted peer identity. Add a cross-UID saturation test proving an administrator request
still completes while an ordinary UID holds its quota.
[P1] Update the public guides for the new service contract
src/agent-sec-core/README.md:37 still says the packaged daemon is a systemd user unit, while
docs/user-guide/en/agent-security/agent-sec-core/policy-cli.md:88 still marks --socket as
required; the Chinese mirrors have the same mismatches. The RPM now installs a system unit and both
binaries default to /run/agent-sec-core/daemon.sock, so users following the canonical install and
CLI docs get the wrong lifecycle and endpoint contract. Please update the paired README and
quick-start and Policy CLI pages with startup, authorization, upgrade/rollback, and socket-default
guidance, and
extend the documentation contract checks to lock these facts.
[P2] Isolate default-socket tests from the ambient environment
src/agent-sec-core/v2/apps/asc-cli/tests/commands.rs:300 and
src/agent-sec-core/v2/apps/asc-daemon/src/cli.rs:163 call the production parser and then assert
the hard-coded fallback without controlling AGENT_SEC_DAEMON_SOCKET. For example,
AGENT_SEC_DAEMON_SOCKET=/tmp/x cargo test default_socket_matches_the_system_service fails. This
makes the suite depend on the invoking shell or CI environment. Please inject the environment value
into a pure parser helper, and cover unset, empty, set, and explicit-argument precedence there.
37d4805 to
a8813de
Compare
Preserve privileged admission on the public socket: TODO already added in previous PR |
71025ca to
a7d136d
Compare
a7d136d to
d1d0889
Compare
5d2ff1f to
26b066d
Compare
Why
What changed
Related issue
User / Agent impact
Risk and compatibility
Validation
Documentation and rollback