filer/iam-grpc: make admin Bearer auth opt-in (fixes #9509) (#9514)

PR #9442 made the filer refuse to register the IAM gRPC service unless
jwt.filer_signing.key was set in security.toml, which broke the admin
UI Users/Groups/Policies pages for every deployment that ships without
a security.toml — weed mini, plain Helm, vanilla weed filer. The Users
tab returns Unimplemented and the page is unusable. Issues #9504,
#9505 and #9509 all trace to this gap.

The rest of the filer's gRPC surface is unauthenticated by default;
treat IAM the same way. The service now always registers, and the
auth gate is a no-op when no signing key is configured. When the key
is set, every RPC still requires an admin-signed Bearer token, matching
the post-#9442 behaviour. Operators who expose the filer gRPC port
beyond a trusted network should set the key on both filer and admin.

The admin client (IamGrpcStore.withIamClient) already skips attaching
the authorization metadata when its key is empty, so no changes there.
This commit is contained in:
Chris Lu authored and GitHub committed 2026-05-15 13:15:20 -07:00
1 parent 7d1b16fbcd
commit 62821964dd
5 files changed
+51 -38

No files matched your search

+5 -9
View File
@@ -194,12 +194,10 @@ func NewAdminServer(masters string, templateFS http.FileSystem, dataDir string,
glog.V(0).Infof("Credential store %s does not support filer address function", store.GetName())
}
// The filer's IAM gRPC service rejects every RPC without an
// admin-signed Bearer token (PR #9442). Mirror the filer's
// jwt.filer_signing.key here so the admin UI's Users/Groups
// pages can talk to it; without this they fail with either
// Unimplemented (filer refuses to register the service) or
// Unauthenticated (missing authorization metadata).
// Mirror the filer's jwt.filer_signing.key so the admin UI's
// Users/Groups pages can present a valid Bearer token when the
// filer enforces IAM gRPC auth. When the key is empty, both
// sides run unauthenticated and no token is sent.
if signer, ok := store.(interface {
SetAdminSigning(security.SigningKey, int)
}); ok {
@@ -207,9 +205,7 @@ func NewAdminServer(masters string, templateFS http.FileSystem, dataDir string,
key := security.SigningKey(viper.GetString("jwt.filer_signing.key"))
expires := viper.GetInt("jwt.filer_signing.expires_after_seconds")
signer.SetAdminSigning(key, expires)
if len(key) == 0 {
glog.Warningf("jwt.filer_signing.key is empty in security.toml; the admin UI Users/Groups pages will fail until this is set on both the filer and the admin server")
} else {
if len(key) > 0 {
glog.V(0).Infof("Credential store configured with admin Bearer token signing")
}
}