Repository navigation
feat: sign in to Silo with tailnet identity and remove Funnel - #2
Conversation
People whose device reaches Silo over Tailscale can sign in as the device's owner with no password. The plugin declares an auth_provider.v1 capability with the SDK's "network" mode, stamps X-Silo-Ingress-Peer on proxied requests, and serves AuthenticatePeer (WhoIs) and CheckAccount (the node's peer list). The tailnet policy decides access and role through siloserver.org/cap/silo grants; "Who can sign in" chooses between anyone who reaches the node and only granted people. A person's role is the highest any of their devices is granted, at sign-in and re-check alike. Tagged devices and expired devices never count. A request that carries another proxy's forwarding headers gets no peer: it came through a relay on someone's device, and that device's owner is not the requester. Funnel is removed so every proxied connection comes from a tailnet peer. A saved funnel setting is ignored, and starting the node clears any Serve or Funnel configuration an earlier release left behind. go.mod pins the SDK commit that adds NetworkIdentityAuth until that SDK release is tagged. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Quick104
left a comment
There was a problem hiding this comment.
Inline review findings below. These came from a single pass without a separate verification step; the routing comment on identity.go:82 depends on Silo server code I didn't check.
| if who.Node.IsTagged() { | ||
| return refuse(pluginv1.AuthDenial_AUTH_DENIAL_NOT_PERMITTED, "tagged device"), nil | ||
| } | ||
| role, granted := grantedRole(who.CapMap) |
There was a problem hiding this comment.
In policy mode, granted comes from the requesting device at sign-in but from any of the person's devices in CheckAccount, and the role is the highest across all devices. Device-scoped grants (posture or source-IP selectors) stop meaning anything after sign-in.
Scenario: the policy grants {"role":"admin"} only from a managed laptop and {"role":"user"} from a shared TV. Signing in from the TV yields ADMIN. Separately, a device with no grant is refused at sign-in, while CheckAccount reports the same person ACTIVE because another device holds a grant. Access and role follow two different rules.
There was a problem hiding this comment.
This is by design, and the limit comes from Silo: an account has one role, so it can't hold admin on the laptop and user on the TV. Using the requesting device's role made the role flip at every sign-in and re-check, which the person-wide role fixed. The split between a per-device gate at sign-in and a per-person re-check is also deliberate. The policy decides which devices may start a session, and the re-check decides whether the account is still entitled. Silo re-checks per account and can't end only one device's sessions. 59fb341 adds a README note: a grant that depends on the device decides which devices can sign in, not which role a device gets. If posture-scoped admin needs to hold, the alternative is the lowest role across devices, which lets any device demote the person. That's a product decision, so I'm leaving this open.
| } | ||
| // The role is the person's, as CheckAccount answers it, so signing in | ||
| // from a device with a narrower grant does not flip it. | ||
| person, err := personAccess(ctx, source, who.UserProfile.ID) |
There was a problem hiding this comment.
Unconfirmed: this depends on how Silo routes the sign-in RPC, which I didn't check.
AuthenticatePeer and CheckAccount answer from the local node's WhoIs and peer list, but a request can arrive through a different node (a silo-proxy-<id> node). Grants and shares are then evaluated against whichever node handles the RPC, not the node the person connected to.
Scenario: someone is shared only the proxy node, or the policy grants siloserver.org/cap/silo with dst set to the proxy node. They connect through the proxy, which stamps X-Silo-Ingress-Peer, and AuthenticatePeer runs on the API host's plugin, whose node can't see that peer or sees a different CapMap. The result is "unknown peer" or the wrong role or grant decision.
There was a problem hiding this comment.
Checked against the server, and this can't happen. Proxy nodes serve only stream routes: internal/proxy/server.go in silo-server registers /stream/..., /downloads/..., health and the node admin routes. Sign-in and linking exist only on the API host. A request stamped by a proxy node's plugin never reaches network sign-in, so AuthenticatePeer and CheckAccount always run on the API host's instance, which is the node the person connected to for sign-in. Someone shared only the proxy node can't reach the sign-in route at all. A grant with dst set to the proxy node gives nothing at the API node, and both RPCs agree on that. I'm leaving this open in case you see a path I missed.
…tity on shutdown Sign-in now refuses a device whose key expired, a subnet router (its LAN traffic arrives as the router's owner), and a person CheckAccount would not find. It reuses the requesting device's WhoIs instead of asking again. A siloserver.org/cap/silo value grants access only as an object whose one optional key, role, is admin or user. Null, unknown keys and unknown roles such as "Admin" grant nothing instead of user access. The overlay withdraws its identity before the tsnet node closes and whenever its listeners close, including on a rename whose certificate is not issued yet, so sign-in answers "not connected" rather than reading a node that serves nothing. RPCs before Configure fail with FailedPrecondition through one helper. The SDK moves to the commit that requires CheckAccount for network sign-in. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Sign-in refused every device with subnet routes on the grounds that a router masquerades its LAN. Tailscale's SNAT covers traffic into the LAN, not out of it: LAN traffic a router forwards into the tailnet keeps its LAN source address, and WhoIs matches only a node's own addresses, so that traffic already finds no identity. The refusal mostly blocked the router's owner, a common home setup. Routers now sign in as their owner by default. The new Subnet routers setting (subnet_routers: allow or refuse) keeps refusing them for tailnets whose routers rewrite forwarded traffic to their own address. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Problem
Sharing Silo over Tailscale gets people onto the server, but they still type a Silo password, or approve a TV code from a phone. Tailscale already knows who owns each device that connects, and Silo can now take that answer as a sign-in (Silo-Server/silo-server#1828). This makes the plugin give that answer, so a TV signed in to Tailscale shows "Continue as {name}" and signs in with one press.
Funnel stood in the way. A Funnel connection comes from Tailscale's relay rather than from a person's device, and a public Silo is better served by a reverse proxy, so this removes it.
Depends on: Silo-Server/silo-plugin-sdk#36, Silo-Server/silo-server#1828
Approach
manifest.jsonadds anauth_provider.v1capability with the SDK'snetworkmode. The process servesNetworkIdentityAuth.AuthenticatePeer, which asks WhoIs about the device that made the request, andCheckAccount, which reads the node's peer list (internal/tailscale/identity.go). The subject is<control host>|<user ID>, so a person signs in to the same account from every device. Tagged devices, devices whose key has expired and peopleCheckAccountwouldn't find never sign in. A subnet router signs in as its owner: LAN traffic it forwards keeps its LAN address, which WhoIs matches to no one. The Subnet routers setting refuses routers for tailnets where one rewrites that traffic to its own address. The login name becomes the email only when it is one (alice@githubisn't), andemail_verifiedstays unset, so Silo never matches accounts by it.sign_in_access) defaults to anyone whose device reaches the node, including people the node is shared with. It can be set to people the tailnet policy grantssiloserver.org/cap/silo. Grants also set the Silo role:{"role":"admin"}or{"role":"user"}. Any other value, such as null, a misspelled key orAdmin, grants nothing. A person's role is the highest any of their devices is granted, at sign-in and at re-check alike, so it doesn't flip between devices. A Silo account has one role, so a grant that depends on the device decides which devices can sign in, not the role.X-Silo-Ingress-Peerwith the connection's tailnet address. A request that carries another proxy's forwarding headers (X-Forwarded-For,Forwarded,Via,X-Real-IP, Cloudflare's, or Tailscale Serve'sTailscale-*) gets no peer: it came through a relay, and the relay device's owner isn't the person making the request. The README asks for relays to be tagged, since a plain TCP forwarder adds no headers.funnelsetting is accepted and ignored, and starting the node clears any Serve or Funnel configuration an earlier release left.Authenticaterefuses every password. A Silo release that predates thenetworkmode would otherwise route passwords here.Validation
make checkpasses: unit tests with-race, the patched-Tailscale ACME test,go vet, and gofmt.TestSignInIdentifiesTailnetPeersruns two realtsnetnodes against Tailscale's test control server, with no real tailnet. A second node dials the Silo node, WhoIs names its owner, a globalsiloserver.org/cap/silogrant makes them admin, andCheckAccountreports them active.autogroup:shared), and Headscale.Risks
go.mod. An older Silo doesn't know thenetworkmode and lists the plugin as a password sign-in provider. Every password it receives is refused, but an admin could enable it there by mistake.AI Disclosure
🤖 Generated with Claude Code