fix: more hardening
This commit is contained in:
23 files changed
+929
-99
No files matched your search
@@ -330,6 +330,7 @@ services.proxy-suite = {
|
||||
userControl = {
|
||||
enable = false;
|
||||
group = "proxy-suite";
|
||||
groups = { };
|
||||
scopes = [ ];
|
||||
};
|
||||
warp = {
|
||||
|
||||
@@ -9,6 +9,9 @@ Part of the [proxy-suite options reference](./index.md).
|
||||
- userControl
|
||||
- [enable](#services-proxy-suite-usercontrol-enable)
|
||||
- [group](#services-proxy-suite-usercontrol-group)
|
||||
- [groups](#services-proxy-suite-usercontrol-groups)
|
||||
- `<name>`
|
||||
- [scopes](#services-proxy-suite-usercontrol-groups-name-scopes)
|
||||
- [scopes](#services-proxy-suite-usercontrol-scopes)
|
||||
|
||||
<a id="services-proxy-suite-usercontrol-enable"></a>
|
||||
@@ -27,6 +30,34 @@ Group whose members can run privileged ` proxy-ctl ` commands\.
|
||||
**Type:** string matching the pattern ^\[a-z_]\[a-z0-9_-]\*$\
|
||||
**Default:** `"proxy-suite"`
|
||||
|
||||
<a id="services-proxy-suite-usercontrol-groups"></a>
|
||||
## services\.proxy-suite\.userControl\.groups
|
||||
|
||||
More groups, each with scopes of its own, alongside ` userControl.group `\. A member gets
|
||||
what all of their groups allow\. ` group ` stays the one that owns proxy-suite’s files;
|
||||
these are given access to them through POSIX ACLs, so the file systems of
|
||||
` /var/lib/proxy-suite ` and ` /run ` must support them (the defaults do)\.
|
||||
|
||||
**Type:** attribute set of (submodule)\
|
||||
**Default:** `{ }`\
|
||||
**Example:**
|
||||
|
||||
```nix
|
||||
{
|
||||
proxy-admins.scopes = [ ];
|
||||
proxy-users.scopes = [ "perApp" "routing" ];
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
<a id="services-proxy-suite-usercontrol-groups-name-scopes"></a>
|
||||
## services\.proxy-suite\.userControl\.groups\.\<name>\.scopes
|
||||
|
||||
What this group may do, as in ` userControl.scopes `\. Empty allows everything\.
|
||||
|
||||
**Type:** list of (one of “services”, “perApp”, “routing”, “outbounds”, “secrets”, “autoProxy”, “zapret”, “stats”, “inbounds”, “whitelistBypass”, “amneziaWg”)\
|
||||
**Default:** `[ ]`
|
||||
|
||||
<a id="services-proxy-suite-usercontrol-scopes"></a>
|
||||
## services\.proxy-suite\.userControl\.scopes
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
services.proxy-suite = {
|
||||
enable = true;
|
||||
proxy = {
|
||||
enable = true;
|
||||
outbounds = [ { tag = "my-vps"; urlFile = "/run/secrets/my-vps-url"; } ];
|
||||
};
|
||||
userControl = {
|
||||
enable = true;
|
||||
scopes = [ "routing" ];
|
||||
groups = {
|
||||
proxy-admins.scopes = [ ];
|
||||
proxy-users.scopes = [ "perApp" "outbounds" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
users.users.alice.extraGroups = [ "proxy-admins" ];
|
||||
users.users.bob.extraGroups = [ "proxy-users" ];
|
||||
}
|
||||
@@ -47,6 +47,40 @@ Members of the group get the listed scopes. An empty `scopes` list grants all of
|
||||
Log out and back in after joining the group. Without `userControl`, a change asks for an
|
||||
admin password, or you run `proxy-ctl` with sudo.
|
||||
|
||||
### Several groups
|
||||
|
||||
`userControl.groups` adds more groups, each with scopes of its own. A member gets what all
|
||||
of their groups allow:
|
||||
|
||||
```nix
|
||||
services.proxy-suite = {
|
||||
enable = true;
|
||||
proxy = {
|
||||
enable = true;
|
||||
outbounds = [ { tag = "my-vps"; urlFile = "/run/secrets/my-vps-url"; } ];
|
||||
};
|
||||
userControl = {
|
||||
enable = true;
|
||||
scopes = [ "routing" ];
|
||||
groups = {
|
||||
proxy-admins.scopes = [ ];
|
||||
proxy-users.scopes = [ "perApp" "outbounds" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
users.users.alice.extraGroups = [ "proxy-admins" ];
|
||||
users.users.bob.extraGroups = [ "proxy-users" ];
|
||||
```
|
||||
|
||||
`userControl.group` still owns proxy-suite's files. The other groups reach them through
|
||||
POSIX ACLs, so `/var/lib/proxy-suite` and `/run` need a file system that supports ACLs. ext4,
|
||||
btrfs, xfs and tmpfs all do.
|
||||
|
||||
The sing-box Clash API's secret stays readable by root only. Other users reach the API
|
||||
through `proxy-suite-clash-api`, which decides per request. Any member can read the
|
||||
outbounds and test them. Switching a selector through the API needs `routing`, and live
|
||||
connections (`proxy-ctl where`) need `secrets`. Nothing else in the API is open to them.
|
||||
|
||||
## Runtime changes and the Nix config
|
||||
|
||||
| Change | Lasts |
|
||||
@@ -81,6 +115,7 @@ back, `F` follows again and `q` quits.
|
||||
## See also
|
||||
|
||||
- [`userControl.scopes`](../options/userControl.md#services-proxy-suite-usercontrol-scopes)
|
||||
- [`userControl.groups`](../options/userControl.md#services-proxy-suite-usercontrol-groups)
|
||||
- [`gui.enable`](../options/gui.md#services-proxy-suite-gui-enable)
|
||||
- [`tui.enable`](../options/tui.md#services-proxy-suite-tui-enable)
|
||||
- [The full `proxy-ctl help`](../../README.md), at the end of the README
|
||||
Reference in new issue
Block a user