-
Notifications
You must be signed in to change notification settings - Fork 724
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
Allow optional SSL client authentication setting #6440
Allow optional SSL client authentication setting #6440
Conversation
e6c30de
to
740e013
Compare
|
||
func validateClientAuthentication(config *common.CanonicalConfig, index int) field.ErrorList { | ||
type ClientAuthSetting struct { | ||
Value string `config:"xpack.security.http.ssl.client_authentication"` |
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.
Let me know if there is an easier / generic way to access a setting given the key as string, so we don't need to define a struct for it.
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 think we could expose func (c *Config) String(name string, idx int, opts ...Option) (string, error)
in the CanonicalConfig
wrapper:
func (c *CanonicalConfig) String(name string) (string, error) {
return c.asUCfg().String(name, -1, Options...)
}
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.
Does this resolve path separators correctly ? I.e. xpack.security.http...
I don't remember.
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.
Looks like it works as expected! I added the wrapper and a few basic test cases.
740e013
to
e1a26c4
Compare
@@ -22,7 +22,6 @@ The following Elasticsearch settings are managed by ECK: | |||
* `xpack.security.authc.reserved_realm.enabled` | |||
* `xpack.security.enabled` | |||
* `xpack.security.http.ssl.certificate` | |||
* `xpack.security.http.ssl.client_authentication` |
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 wonder if it's best to leave this our from the list of ECK managed settings, or if we should explain what values are supported / not supported.
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 would probably add new section "Partially restricted settings" and say xpack.security.http.ssl.client_authentication
(supported values none
, optional
)
|
||
func validateClientAuthentication(config *common.CanonicalConfig, index int) field.ErrorList { | ||
type ClientAuthSetting struct { | ||
Value string `config:"xpack.security.http.ssl.client_authentication"` |
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 think we could expose func (c *Config) String(name string, idx int, opts ...Option) (string, error)
in the CanonicalConfig
wrapper:
func (c *CanonicalConfig) String(name string) (string, error) {
return c.asUCfg().String(name, -1, Options...)
}
e1a17a6
to
ff32292
Compare
* `xpack.security.http.ssl.enabled` | ||
* `xpack.security.http.ssl.key` | ||
* `xpack.security.transport.ssl.certificate` | ||
* `xpack.security.transport.ssl.enabled` | ||
* `xpack.security.transport.ssl.key` | ||
* `xpack.security.transport.ssl.verification_mode` | ||
|
||
The following Elasticsearch settings are not supported by ECK: | ||
|
||
* `xpack.security.http.ssl.client_authentication`: `required` |
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.
This is also good 👍
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.
LGTM
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.
Nice work!
Elasticsearch supports a few different settings for client authentication settings for https. This PR allows
xpack.security.http.ssl.client_authentication
to be set to eitheroptional
ornone
, but it will keep emitting an unsupported warning in case it is set torequired
.Fixes: #6369