I have roles and roles_mapping.yml file which I am using while executing securityadmin.sh
I am executing securityadmin.sh as a docker entrypoint for elasticsearch.
Whenever elasticsearch container gets restarted it is loading the roles mentioned in roles.yml, and removing all other roles which has created from kibana UI-> security->roles, as the roles created from KIBANA UI does not get saved in roles.yml and roles_mappings.yml.
How can I preserve my roles created from KIBANA UI?, though securityadmin.sh gets executed multiple time.
@disha27 the only way to preserve the new config would be to run the script with --retrieve (-r) flag, this will export all the config and append the timestamp to the end of each file. See command below:
/usr/share/elasticsearch/plugins/opendistro_security/tools/securityadmin.sh -cd /usr/share/elasticsearch/plugins/opendistro_security/securityconfig/ -icl -nhnv -cacert /usr/share/elasticsearch/config/root-ca.pem -cert /usr/share/elasticsearch/config/kirk.pem -key /usr/share/elasticsearch/config/kirk-key.pem -h localhost -r
This will save the files into directory specified with -cd, if -cd option is not used it will save the files to the current directory.