feat: Unix group-based socket access control (H1 proper fix) #18
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "doxios/avault:feat/socket-group-auth"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds Unix group-based access control for the daemon socket — the proper kernel-enforced solution for audit finding H1 from #16.
This is the follow-up to PR #17 (token-based auth). As k9ert pointed out, token files just move the goalpost — you're storing a secret to access the secrets. Unix user:group isolation lets the kernel enforce access without any shared secrets.
How It Works
Configuration
CLI flag (highest priority):
config.json (persistent):
No flag (default): unchanged behavior — socket is chmod
0600, owner-only.Setup on olymp
Changes
scripts/avault.pyserve()acceptssocket_groupparam; socket + run dir getchgrp+chmod 0660;daemon_start()reads group from CLI flag or config;--group/-gflag ondaemon start;doctorshows socket permissionsscripts/test_avault.pyWhy This Over Tokens
avault.tokenThe token PR (#17) is still useful as defense-in-depth / MVP. This PR is the proper solution.
Tests
5 new tests, all passing. 63/64 total pass (1 pre-existing QR failure).
Refs
PR by Doxios 🦊
Add --group/-g flag to 'avault daemon start' that sets the socket to chmod 0660 and chgrp's it to the specified group. This enables proper multi-user isolation: # Daemon runs as 'avault' user avault daemon start --group vault-users # Agent (running as 'cobot' user, member of 'vault-users' group) # can connect to the socket — kernel enforces access How it works: - --group flag or 'socket_group' in config.json - Socket: chmod 0660, chgrp to specified group - Run directory: chmod 0750, chgrp to specified group - Invalid group name: prints warning, falls back to owner-only (0600) - No --group: unchanged behavior (chmod 0600, owner-only) This is the proper solution for H1 (No Authentication on Unix Socket): the kernel enforces access via standard Unix permissions, no shared secrets or tokens needed. Setup example for olymp: groupadd vault-users usermod -aG vault-users alpha usermod -aG vault-users doxios # In .avault/config.json: {"socket_group": "vault-users"} Doctor command updated with socket_perms health check. 5 new tests added (all passing). Ref: nazim/avault#16 (security audit, H1)View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.