Skip to content

Commit 173b78a

Browse files
committed
kerberos kubernetes
1 parent a39fb1e commit 173b78a

File tree

1 file changed

+47
-17
lines changed
  • deploy-manage/users-roles/cluster-or-deployment-auth

1 file changed

+47
-17
lines changed

deploy-manage/users-roles/cluster-or-deployment-auth/kerberos.md

Lines changed: 47 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,13 @@ In Kerberos, users authenticate with an authentication service and later with a
6767

6868
### Prerequisites [kerberos-realm-prereq]
6969

70-
* Deploy Kerberos.
71-
72-
You must have the Kerberos infrastructure set up in your environment.
73-
74-
::::{note}
75-
Kerberos requires a lot of external services to function properly, such as time synchronization between all machines and working forward and reverse DNS mappings in your domain. Refer to your Kerberos documentation for more details.
76-
::::
70+
Before you set up a Kerbberos realm, you must have the Kerberos infrastructure set up in your environment.
7771

72+
::::{note}
73+
Kerberos requires a lot of external services to function properly, such as time synchronization between all machines and working forward and reverse DNS mappings in your domain. Refer to your Kerberos documentation for more details.
74+
::::
7875

79-
These instructions do not cover setting up and configuring your Kerberos deployment. Where examples are provided, they pertain to an MIT Kerberos V5 deployment. For more information, see [MIT Kerberos documentation](http://web.mit.edu/kerberos/www/index.md)
76+
These instructions do not cover setting up and configuring your Kerberos deployment. Where examples are provided, they pertain to an MIT Kerberos V5 deployment. For more information, see [MIT Kerberos documentation](http://web.mit.edu/kerberos/www/index.md)
8077

8178
If you're using a self-managed cluster, then perform the following additional steps:
8279

@@ -112,7 +109,7 @@ To configure a Kerberos realm in {{es}}:
112109
{{es}} uses Java GSS framework support for Kerberos authentication. To support Kerberos authentication, {{es}} needs the following files:
113110
114111
* `krb5.conf`: The Kerberos configuration file (`krb5.conf`) provides information such as the default realm, the Key Distribution Center (KDC), and other configuration details required for Kerberos authentication. For more information, see [krb5.conf](https://web.mit.edu/kerberos/krb5-latest/doc/admin/conf_files/krb5_conf.html).
115-
* **A keytab**: A keytab is a file that stores pairs of principals and encryption keys. {{es}} uses the keys from the keytab to decrypt the tickets presented by the user. You must create a keytab for {{es}} by using the tools provided by your Kerberos implementation. For example, some tools that create keytabs are `ktpass.exe` on Windows and `kadmin` for MIT Kerberos.
112+
* `keytab`: A keytab is a file that stores pairs of principals and encryption keys. {{es}} uses the keys from the keytab to decrypt the tickets presented by the user. You must create a keytab for {{es}} by using the tools provided by your Kerberos implementation. For example, some tools that create keytabs are `ktpass.exe` on Windows and `kadmin` for MIT Kerberos.
116113

117114
The configuration requirements depend on your Kerberos setup. Refer to your Kerberos documentation to configure the `krb5.conf` file.
118115

@@ -191,18 +188,51 @@ For detailed information of available realm settings, see [Kerberos realm settin
191188

192189
::::{tab-item} ECK
193190

194-
% TODO: jvm setup
195-
% podTemplate with a mount that shadows /usr/share/elasticsearch/config/jvm.options.d/
196-
% set `java.security.krb5.conf`
197-
% 1. Configure the JVM to find the Kerberos configuration file.
191+
1. Install your `krb5.conf` and `keytab` files as a [custom configuration file](/deploy-manage/deploy/cloud-on-k8s/custom-configuration-files-plugins#use-a-volume-and-volume-mount-together-with-a-configmap-or-secret).
192+
193+
2. Configure the JVM to find the Kerberos configuration file.
198194

199-
% {{es}} uses Java GSS and JAAS Krb5LoginModule to support Kerberos authentication using a Simple and Protected GSSAPI Negotiation (SPNEGO) mechanism. When the JVM needs some configuration properties, it tries to find those values by locating and loading the `krb5.conf` file. The JVM system property to configure the file path is `java.security.krb5.conf`. If this system property is not specified, Java tries to locate the file based on the conventions.
195+
{{es}} uses Java GSS and JAAS Krb5LoginModule to support Kerberos authentication using a Simple and Protected GSSAPI Negotiation (SPNEGO) mechanism. When the JVM needs some configuration properties, it tries to find those values by locating and loading the `krb5.conf` file. The JVM system property to configure the file path is `java.security.krb5.conf`. If this system property is not specified, Java tries to locate the file based on the conventions.
200196

201-
1. Install your `krb5.conf` and `keytab` files as a [custom configuration file](/deploy-manage/deploy/cloud-on-k8s/custom-configuration-files-plugins#use-a-volume-and-volume-mount-together-with-a-configmap-or-secret).
197+
To provide JVM setting overrides to your cluster:
202198

203-
2. Edit your cluster configuration to define your Kerberos settings:
199+
1. Create a new ConfigMap. The source file should contain a key named `java.security.krb5.conf` pointing to your configuration file:
200+
201+
```
202+
kubectl create configmap jvm-options --from-file=opts
203+
```
204204

205-
```sh
205+
2. Reference the ConfigMap in your [cluster specification](/deploy-manage/deploy/cloud-on-k8s/update-deployments.md):
206+
207+
```yaml
208+
apiVersion: elasticsearch.k8s.elastic.co/v1
209+
kind: Elasticsearch
210+
metadata:
211+
name: test-cluster
212+
spec:
213+
version: 8.17.0
214+
nodeSets:
215+
- name: default
216+
count: 3
217+
config:
218+
# this allows ES to run on nodes even if their vm.max_map_count has not been increased, at a performance cost
219+
node.store.allow_mmap: false
220+
podTemplate:
221+
spec:
222+
containers:
223+
- name: elasticsearch
224+
volumeMounts:
225+
- name: jvm-opts
226+
mountPath: /usr/share/elasticsearch/config/jvm.options.d
227+
volumes:
228+
- name: jvm-opts
229+
configMap:
230+
name: jvm-options
231+
```
232+
233+
3. Edit your cluster configuration to define your Kerberos settings:
234+
235+
```yaml
206236
xpack.security.authc.realms.kerberos.cloud-krb:
207237
order: 2
208238
keytab.path: es.keytab

0 commit comments

Comments
 (0)