mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-11-03 18:47:41 +01:00
filer: say jwt.filer_signing.key gates only the IAM gRPC service (#12353)
* filer: say jwt.filer_signing.key gates only the IAM gRPC service The key never covered the rest of the filer gRPC port, which can read and write the IAM store under /etc/iam. Point operators at [grpc.filer] mTLS for a port reachable beyond a trusted network instead of the key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * filer: note the IAM gRPC OIDC provider and role RPCs are refused without the key Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
cc71cc9585
commit
c2ca83c0bf
3 files changed
+13
-14
No files matched your search
@@ -506,12 +506,9 @@ func (fo *FilerOptions) startFiler() {
|
|||||||
grpcS := pb.NewGrpcServer(security.LoadServerTLS(util.GetViper(), "grpc.filer"))
|
grpcS := pb.NewGrpcServer(security.LoadServerTLS(util.GetViper(), "grpc.filer"))
|
||||||
filer_pb.RegisterSeaweedFilerServer(grpcS, fs)
|
filer_pb.RegisterSeaweedFilerServer(grpcS, fs)
|
||||||
|
|
||||||
// Register the IAM gRPC service. Auth is opt-in: when
|
// IAM RPCs require a Bearer token signed with jwt.filer_signing.key when it
|
||||||
// jwt.filer_signing.key is configured the service requires a Bearer token
|
// is set. The key does not protect the rest of this port; that needs
|
||||||
// signed with that key; otherwise it runs unauthenticated, matching the
|
// [grpc.filer] mTLS.
|
||||||
// rest of the filer's gRPC surface. Operators who expose the filer gRPC
|
|
||||||
// port beyond a trusted network should set jwt.filer_signing.key on both
|
|
||||||
// the filer and the admin server.
|
|
||||||
if credentialManager != nil {
|
if credentialManager != nil {
|
||||||
adminSigningKey := security.SigningKey(util.GetViper().GetString("jwt.filer_signing.key"))
|
adminSigningKey := security.SigningKey(util.GetViper().GetString("jwt.filer_signing.key"))
|
||||||
iamGrpcServer := weed_server.NewIamGrpcServer(credentialManager, adminSigningKey)
|
iamGrpcServer := weed_server.NewIamGrpcServer(credentialManager, adminSigningKey)
|
||||||
|
|||||||
@@ -57,9 +57,11 @@ expires_after_seconds = 10 # seconds
|
|||||||
# CreateAccessKey, ...). When set, every IAM RPC must carry a Bearer
|
# CreateAccessKey, ...). When set, every IAM RPC must carry a Bearer
|
||||||
# token signed with this key in its "authorization" gRPC metadata; mint
|
# token signed with this key in its "authorization" gRPC metadata; mint
|
||||||
# such a token with security.GenJwtForFilerAdmin. When empty, the IAM
|
# such a token with security.GenJwtForFilerAdmin. When empty, the IAM
|
||||||
# gRPC service runs unauthenticated, like the rest of the filer's gRPC
|
# gRPC service runs unauthenticated and refuses its OIDC provider and
|
||||||
# surface — set the key on both filer and admin if the gRPC port is
|
# role RPCs. When set, set it on both filer and admin.
|
||||||
# reachable beyond a trusted network.
|
# The key does not protect the other filer gRPC RPCs, which can read and
|
||||||
|
# write the IAM store under /etc/iam; if the filer gRPC port is reachable
|
||||||
|
# beyond a trusted network, enable [grpc.filer] mTLS below.
|
||||||
# the jwt defaults to expire after 10 seconds.
|
# the jwt defaults to expire after 10 seconds.
|
||||||
[jwt.filer_signing]
|
[jwt.filer_signing]
|
||||||
key = ""
|
key = ""
|
||||||
|
|||||||
@@ -17,11 +17,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// IamGrpcServer implements the IAM gRPC service on the filer.
|
// IamGrpcServer implements the IAM gRPC service on the filer.
|
||||||
// Auth is opt-in: when jwt.filer_signing.key is set in security.toml the
|
// When jwt.filer_signing.key is set, every RPC requires a Bearer token signed
|
||||||
// service requires a Bearer token in the "authorization" metadata signed with
|
// with it; otherwise RPCs run unauthenticated, except the OIDC provider and
|
||||||
// that key; when it is empty every RPC is accepted unauthenticated, matching
|
// role RPCs, which are refused. The key gates only this service: the filer RPCs
|
||||||
// the rest of SeaweedFS's gRPC surface. Operators who expose the filer gRPC
|
// on the same port can still read and write the IAM store under /etc/iam.
|
||||||
// port beyond a trusted network should configure the key.
|
// Protect a filer gRPC port reachable by untrusted clients with [grpc.filer] mTLS.
|
||||||
type IamGrpcServer struct {
|
type IamGrpcServer struct {
|
||||||
iam_pb.UnimplementedSeaweedIdentityAccessManagementServer
|
iam_pb.UnimplementedSeaweedIdentityAccessManagementServer
|
||||||
credentialManager *credential.CredentialManager
|
credentialManager *credential.CredentialManager
|
||||||
|
|||||||
Reference in new issue
Block a user