|
| 1 | +### Required environment for Kerberos authentication ### |
| 2 | +1. Kerberos server |
| 3 | +2. DNS server |
| 4 | +3. Opensearch Core & Dashboards server |
| 5 | +4. Client browser with SPNEGO ( I testing on google-chrome ) |
| 6 | + |
| 7 | +--- |
| 8 | +### KEBEROS SERVER ### |
| 9 | +Required |
| 10 | +1. User principle to be authenticate |
| 11 | +2. Service principle eg. HTTP/<server_host> ( When created with kadmin should get as HTTP/<server_host>@<your_domain>) |
| 12 | +3. Keytab for Service principle ( Make sure to give owner to opensearch core ) |
| 13 | + |
| 14 | +**NOTE** |
| 15 | +1. I only test both core and dashboards on the same host. |
| 16 | +2. Dashboards isn't the one authenticate with Kerberos but the core did so keytab doesn't need for dashboards. |
| 17 | + |
| 18 | +--- |
| 19 | + |
| 20 | +### DNS SERVER ### |
| 21 | +Required |
| 22 | +1. DNS Service if using **bind9** should have dns address to opensearch & kerberos like |
| 23 | +``` |
| 24 | +_kerberos._udp.<YOUR DOMAIN>. IN SRV 1 0 88 kdc.<your domain>. |
| 25 | +_kerberos._tcp.<YOUR DOMAIN>. IN SRV 1 0 88 kdc.<your domain>. |
| 26 | +_kerberos-adm._tcp.<YOUR DOMAIN>. IN SRV 1 0 749 kdc.<your domain>. |
| 27 | +_kpasswd._udp.<YOUR DOMAIN>. IN SRV 1 0 464 kdc.<your domain>. |
| 28 | +
|
| 29 | +kdc IN A <kerberos kdc server address> |
| 30 | +opensearch IN A <opensearch server address> |
| 31 | +``` |
| 32 | + |
| 33 | +--- |
| 34 | + |
| 35 | +### Opensearch core ### |
| 36 | +Required |
| 37 | +1. set DNS point to your DNS server |
| 38 | +2. Add config to opensearch.yml |
| 39 | +``` |
| 40 | +plugins.security.kerberos.krb5_filepath: '/etc/krb5.conf' # this is your kerberos config location |
| 41 | +plugins.security.kerberos.acceptor_keytab_filepath: '<path to keytab file>' # keytab file for kerberos ( don't forget to give owner to opensearch ) |
| 42 | +plugins.security.kerberos.acceptor_principal: 'HTTP/<server_host>' # this is your service principle on your kerberos for opensearch |
| 43 | +``` |
| 44 | + |
| 45 | +3. Configuration Opensearch-security config file ( don't forget to apply ) |
| 46 | +``` |
| 47 | + authc: |
| 48 | + kerberos_auth_domain: |
| 49 | + http_enabled: true # enable this |
| 50 | + transport_enabled: false |
| 51 | + order: 6 |
| 52 | + http_authenticator: |
| 53 | + type: kerberos |
| 54 | + challenge: false |
| 55 | + config: |
| 56 | + krb_debug: true |
| 57 | + strip_realm_from_principal: true |
| 58 | + authentication_backend: |
| 59 | + type: noop |
| 60 | +
|
| 61 | +
|
| 62 | + jwt_auth_domain: |
| 63 | + description: "Authenticate via Json Web Token" |
| 64 | + http_enabled: true |
| 65 | + transport_enabled: false |
| 66 | + order: 0 |
| 67 | + http_authenticator: |
| 68 | + type: jwt |
| 69 | + challenge: false |
| 70 | + config: |
| 71 | + signing_key: "<encoded secret key>" # edit this to your key (encoded by base64) |
| 72 | + jwt_header: "Authorization" |
| 73 | + jwt_url_parameter: null |
| 74 | +# jwt_clock_skew_tolerance_seconds: 30 |
| 75 | + roles_key: roles |
| 76 | + subject_key: user |
| 77 | + authentication_backend: |
| 78 | + type: noop |
| 79 | +``` |
| 80 | + |
| 81 | +--- |
| 82 | + |
| 83 | +### Opensearch Dashboards ### |
| 84 | +Required |
| 85 | +Edit config file for dashboards |
| 86 | + |
| 87 | +``` |
| 88 | +# define auth type |
| 89 | +opensearch_security.auth.type: kerberos |
| 90 | +
|
| 91 | +# set your secret key |
| 92 | +opensearch_security.kerberos.jwt_siging_key: '<your secret key>' #NOTE as plain text not encoded |
| 93 | +
|
| 94 | +``` |
| 95 | + |
| 96 | +--- |
| 97 | + |
| 98 | +### Client Browser ### |
| 99 | +Required ( For google chrome ) |
| 100 | +1. Make sure to that browser have **SPNEGO** |
| 101 | +1. Edit policy section for ```AuthServerAllowlist``` |
| 102 | + |
| 103 | +For google chrome debian package should locate at ```/etc/opt/chrome/policies/managed/``` |
| 104 | +create your policy file eg. |
| 105 | +``` |
| 106 | +{ |
| 107 | + "AuthServerAllowlist" : "<opensearch_hostname>" |
| 108 | +} |
| 109 | +``` |
| 110 | + |
| 111 | +**NOTE** |
| 112 | +- When search on browser you must access hostname according to policies your defined. |
| 113 | + |
| 114 | +- Make sure that you already use **kinit** and see your tokens via **klist** |
| 115 | + |
| 116 | +- You can test with curl for checking kerberos by |
| 117 | +```curl <opensearch_hostname>:<port> -u ':' --negotiate -v``` |
| 118 | +( You should see Negotiate token when request to server. If not it may problem with misconfiguration kerberos (usually principle) or DNS ) |
| 119 | + |
| 120 | +- **Don't forget** to add permission to user name same as kerberos principle of that user. |
0 commit comments