Skip to content

feat: sign in to Silo with tailnet identity and remove Funnel - #2

Merged
Quick104 merged 4 commits into
mainfrom
feat/tailscale-sign-in
Oct 3, 2026
Merged

Quick104 merged 4 commits into
mainfrom
feat/tailscale-sign-in

Conversation

@Quick104

@Quick104 Quick104 commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

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

  • Identity. manifest.json adds an auth_provider.v1 capability with the SDK's network mode. The process serves NetworkIdentityAuth.AuthenticatePeer, which asks WhoIs about the device that made the request, and CheckAccount, 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 people CheckAccount wouldn'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@github isn't), and email_verified stays unset, so Silo never matches accounts by it.
  • Access and roles. The new Who can sign in setting (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 grants siloserver.org/cap/silo. Grants also set the Silo role: {"role":"admin"} or {"role":"user"}. Any other value, such as null, a misspelled key or Admin, 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.
  • Proxy. The proxy replaces any client-sent X-Silo-Ingress-Peer with 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's Tailscale-*) 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.
  • Funnel removed. The listener is tailnet-only. A saved funnel setting is accepted and ignored, and starting the node clears any Serve or Funnel configuration an earlier release left.
  • Passwords. Authenticate refuses every password. A Silo release that predates the network mode would otherwise route passwords here.

Validation

  • make check passes: unit tests with -race, the patched-Tailscale ACME test, go vet, and gofmt.
  • TestSignInIdentifiesTailnetPeers runs two real tsnet nodes against Tailscale's test control server, with no real tailnet. A second node dials the Silo node, WhoIs names its owner, a global siloserver.org/cap/silo grant makes them admin, and CheckAccount reports them active.
  • Unit tests cover:
    • refusals (tagged, expired, subnet router when the setting refuses routers, unknown, no user, not in the peer list, policy without a grant, WhoIs or peer list down), and exit nodes and subnet routers signing in by default;
    • the person-wide role, with one WhoIs per device;
    • malformed grants (null, unknown keys, unknown roles, trailing data);
    • the identity withdrawn before the node closes and while a renamed node has no certificate;
    • subject scoping;
    • the peer header for direct requests vs. each kind of relay.
  • Live on a maintainer's tailnet against feat(auth): sign in with network identity through network access plugins Silo-Server/silo-server#1828, before the review fixes in 59fb341 (they add refusals and stricter grant parsing, covered by the tests above):
    • discovery and one-press sign-in;
    • a forged peer header refused;
    • re-checks against the real peer list;
    • policy mode hiding the button, refusing sign-in and revoking at re-check;
    • an admin grant promoting the account.
    • The Android TV, iPhone and Android phone apps signed in on physical devices.
  • Not run: a node shared into a second tailnet (whether grants reach shared-in users through autogroup:shared), and Headscale.

Risks

  • Release order. Release this after a Silo release with network sign-in, and after the SDK tag replaces the pinned SDK commit (01bb145) in go.mod. An older Silo doesn't know the network mode 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.
  • Funnel users. An install that served Silo publicly through Funnel stops answering publicly after the update. The README says so.
  • Trust model. Anyone using a device signed in to the tailnet as someone acts as that person in Silo, with their role, and anyone whose traffic is relayed through that device does too unless the relay is tagged. The README spells this out.

AI Disclosure

  • Harness: Claude Code, run inside T3 Code
  • Tool(s): Claude Code with subagents (exploration, adversarial review)
  • Model(s): claude-opus-5-5
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: a separate agent reviewed this change and the Silo side. Fixed here:
    • relayed requests signed in as the relay device's owner;
    • sign-in used only the requesting device's grant while re-check used all of the person's devices, so the role flipped;
    • expired devices counted as present at re-check.
  • Review comments on this PR were fixed in 59fb341 or answered in their threads.

🤖 Generated with Claude Code

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 Quick104 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread internal/tailscale/identity.go Resolved
if who.Node.IsTagged() {
return refuse(pluginv1.AuthDenial_AUTH_DENIAL_NOT_PERMITTED, "tagged device"), nil
}
role, granted := grantedRole(who.CapMap)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread internal/tailscale/identity.go Outdated
}
// 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)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread internal/tailscale/identity.go Resolved
Comment thread internal/tailscale/network.go Resolved
Comment thread internal/tailscale/network.go Resolved
Comment thread internal/tailscale/identity.go Resolved
Comment thread go.mod Resolved
Comment thread main.go Resolved
Quick104 and others added 3 commits October 2, 2026 20:28
…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]>
@Quick104
Quick104 merged commit a79ee13 into main Oct 3, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant