mirror of
https://github.com/juanfont/headscale.git
synced 2026-11-24 22:26:29 +09:00
policy: allow granting tailscale.com/cap/tailsql
tailsql checks this cap; headscale embeds tailsql.
This commit is contained in:
1 parent
dc0edca887
commit
489526dfcf
2 files changed
+5
No files matched your search
@@ -2486,6 +2486,10 @@ var tailscaleCapAllowlist = map[peercap.Cap]bool{
|
||||
// tailscale.com/cap/secrets is the capability used by setec
|
||||
// (github.com/tailscale/setec); allow it so it can be granted via policy.
|
||||
peercap.Cap("tailscale.com/cap/secrets"): true,
|
||||
|
||||
// tailscale.com/cap/tailsql is the capability tailsql
|
||||
// (github.com/tailscale/tailsql) checks; headscale embeds tailsql.
|
||||
peercap.Cap("tailscale.com/cap/tailsql"): true,
|
||||
}
|
||||
|
||||
// validateGrantSrcDstCombination validates [Grant]-specific source/destination
|
||||
|
||||
@@ -6518,6 +6518,7 @@ func TestValidateCapabilityName(t *testing.T) {
|
||||
{name: "custom domain allowed", cap: "example.com/cap/foo", wantErr: nil},
|
||||
{name: "allowlisted tailscale cap", cap: "tailscale.com/cap/drive", wantErr: nil},
|
||||
{name: "setec secrets cap allowed", cap: "tailscale.com/cap/secrets", wantErr: nil},
|
||||
{name: "tailsql cap allowed", cap: "tailscale.com/cap/tailsql", wantErr: nil},
|
||||
{name: "non-allowlisted tailscale cap rejected", cap: "tailscale.com/cap/nope", wantErr: ErrCapNameTailscaleDomain},
|
||||
{name: "url scheme rejected", cap: "https://tailscale.com/cap/drive", wantErr: ErrCapNameInvalidForm},
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user