Harden basic auth implementation
After consideration, the basic authentication implementation has been simplified to only support bcrypt entries in an htpasswd file. This greatly increases the security of the implementation by reducing the possibility of timing attacks and other problems trying to detect the password hash type. Also, the htpasswd file is only parsed at startup, ensuring that the file can be edited and not effect ongoing requests. Newly added passwords take effect on restart. Subsequently, password hash entries are now stored in a map. Test cases have been modified accordingly. Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
parent
427c457801
commit
14f3b07db0
5 changed files with 164 additions and 124 deletions
|
@ -147,6 +147,7 @@ func NewApp(ctx context.Context, configuration configuration.Configuration) *App
|
|||
panic(fmt.Sprintf("unable to configure authorization (%s): %v", authType, err))
|
||||
}
|
||||
app.accessController = accessController
|
||||
ctxu.GetLogger(app).Debugf("configured %q access controller", authType)
|
||||
}
|
||||
|
||||
return app
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue