-
Notifications
You must be signed in to change notification settings - Fork 25.6k
[Kerberos] Add bootstrap checks for kerberos realm #31548
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
[Kerberos] Add bootstrap checks for kerberos realm #31548
Conversation
As there are some system properties like `java.security.krb5.kdc` , `java.security.krb5.realm` which can specify values that are applicable to whole JVM. This is the reason for having only one instance of KerberosRealm. Each ES node will have a kerberos keytab with credentials. This keytab must exist for kerberos authentication to work. `KerberosRealmBootstrapCheck` performs these checks for given configuration.
|
Pinging @elastic/es-security |
set bootstrap failure when `type` not specified for realm
|
|
||
| @Override | ||
| public BootstrapCheckResult check(final BootstrapContext context) { | ||
| final Settings realmsSettings = RealmSettings.get(context.settings); |
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 recommend using RealmSettings.getRealmSettings instead.
It slightly reduces your reliance on the underlying realm config model.
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.
Thanks, Tim. Addressed this.
|
Hi, @tvernum I have addressed your review comment. Please take another look when you get some time. Thank you. |
tvernum
left a comment
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
jaymode
left a comment
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 left a request for improved javadocs on the class level. Otherwise LGTM
| import java.util.Map.Entry; | ||
|
|
||
| /** | ||
| * This class is used to perform bootstrap checks for kerberos realm. |
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.
can you be more detailed here about the checks and why we have these checks?
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.
Thanks, addressed the javadocs.
As there are some system properties like
java.security.krb5.kdc,
java.security.krb5.realm,java.security.krb5.confwhich canspecify values that are applicable to whole JVM. This is the reason
for having only one instance of Kerberos realm.
Each ES node will have a Kerberos keytab with credentials. This
keytab must exist for Kerberos authentication to work.
KerberosRealmBootstrapCheckperforms these checks for givenconfiguration.