We have opened X-Pack which gives you access to the source code for the X-Pack SecurityExtension feature, and also our test cases for that.
Those test cases are maintained on an ongoing basis, and will always match the latest state of the X-Pack code. As such, we are no longer maintaining this sample realm repository. If you wish to see an example realm, you can see a working, maintained example in the Elasticsearch repository
The blog post How to Develop Your Own Security Extensions and Custom Realms for Elasticsearch also provides an example for implementing a custom realm in Elasticsearch 6.3 or above, with commentary to assist.
The “master” branch of the Elasticsearch git repository tracks the most recent deveopment, including unreleased features and changes. The security extension example from master
is unlikely to work on any released version of Elasticsearch.
It is important that you browse to the correct version/branch for the version of Elasticsearch that you are running.
This repository contains versions of the custom realm extension that work with Elasticsearch releases from as far back as 2.0
Branch | Elasticsearch Version |
---|---|
6.2 | 6.2.x |
6.0 | 6.0.x |
5.6 | 5.6.x |
5.5 | 5.5.x |
5.4 | 5.4.x |
5.3 | 5.3.x |
5.2 | 5.2.x |
5.1 | 5.1.x |
5.0 | 5.0.x |
2.4 | 2.4.x |
2.3 | 2.3.x |
2.2 | 2.2.x |
2.1 | 2.1.x |
2.0 | 2.0.x |
For versions prior to 6.3 please follow the instructions in the README.textile
file on the correct branch of this repository (see table above).
For versions 6.3.0 and later, Security Extensions have changed and can be loaded using standard Elasticsearch plugin mechanisms.
Please read Elasticsearch’s plugin author instructions
In order to registry your SecurityExtension
with X-Pack, it must be included in the resources/META-INF/services/org.elasticsearch.xpack.core.security.SecurityExtension
file of your main jar file, as per the example project
If you have questions about custom realms, please join us in our discussion forums where we will be able to help you.