-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DBPW 3/5] Add DBv5 plugin serving & management functions #9745
Conversation
1b90ebe
to
5336ddb
Compare
8bce816
to
1d08c2d
Compare
This mirrors what DBv4 is doing, but with the updated interface
1d08c2d
to
dcd0677
Compare
var _ plugin.GRPCPlugin = &GRPCDatabasePlugin{} | ||
|
||
func (d GRPCDatabasePlugin) GRPCServer(_ *plugin.GRPCBroker, s *grpc.Server) error { | ||
proto.RegisterDatabaseServer(s, gRPCServer{impl: d.Impl}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to wrap d.Impl
with DatabaseErrorSanitizerMiddleware
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately we can't at this point in the code. The DatabaseErrorSantizerMiddleware
doesn't know what secret values to redact at this point. It only knows those values within the database plugin itself. Here's an example from the existing MongoDB plugin:
vault/plugins/database/mongodb/mongodb.go
Line 33 in 049c1a7
dbType := dbplugin.NewDatabaseErrorSanitizerMiddleware(db, db.secretValues) |
func (c *mongoDBConnectionProducer) secretValues() map[string]interface{} { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that in this case it's more of a passthrough/no-op in terms of sanitizing secret values, but sanitize
is also performing an specific error check:
vault/sdk/database/dbplugin/databasemiddleware.go
Lines 313 to 315 in 7807d45
if errwrap.ContainsType(err, new(url.Error)) { | |
return errors.New("unable to parse connection url") | |
} |
Overview
This PR is part of a larger feature adding support for password policies into the combined database engine. This feature is being split into multiple PRs to make for smaller reviews & earlier feedback.
Adds plugin serving/handling code for Database v5. This is nearly identical to the Database v4 code, but references the updated interface.
Database v4 version:
sdk/database/dbplugin/plugin.go
sdk/database/dbplugin/server.go
sdk/database/dbplugin/client.go
Prerequisites
master
Related PRs
Original password policies PR
1/X - Database interface & gRPC
2/X - Middleware
4/X - Database engine