The easiest way to have a fully custom security plugin is by using securityConfig.config.securityConfigSecret in values.yml
However, since this is not a demo configuration, you need to add a few more things.
- Disable demo configuration and set initial admin password
extraEnvs:
- name: OPENSEARCH_INITIAL_ADMIN_PASSWORD
value: Eliatra123
- name: DISABLE_INSTALL_DEMO_CONFIG
value: "true"
- Create a secret with certificates
certs/
โโโ esnode-key.pem
โโโ esnode.pem
โโโ kirk-key.pem
โโโ kirk.pem
โโโ root-ca.pem
kubectl create secret generic securitysecrets --from-file=/sg_testing/kubernetes/helmchart/opensearch-charts-current/certs
- Set secret with certificates
secretMounts:
- name: securitycerts
secretName: securitysecrets
path: /usr/share/opensearch/config/certs
- Create a secret with the security configuration
security-config/
โโโ action_groups.yml
โโโ config.yml
โโโ internal_users.yml
โโโ roles_mapping.yml
โโโ roles.yml
โโโ tenants.yml
kubectl create secret generic securityconfig --from-file=/sg_testing/kubernetes/helmchart/opensearch-charts-current/security-config
- Set a secret with the security configuration
securityConfig:
enabled: true
path: "/usr/share/opensearch/config/opensearch-security"
actionGroupsSecret:
configSecret:
internalUsersSecret:
rolesSecret:
rolesMappingSecret:
tenantsSecret:
config:
securityConfigSecret: "securityconfig"
- Uncomment the security configuration in opensearch.yml and point all certificate options to the mount folder from step 3.
opensearch.yml: |
cluster.name: opensearch-cluster
# Bind to all interfaces because we don't know what IP address Docker will assign to us.
network.host: 0.0.0.0
# Setting network.host to a non-loopback address enables the annoying bootstrap checks. "Single-node" mode disables them again.
# Implicitly done if ".singleNode" is set to "true".
# discovery.type: single-node
# Start OpenSearch Security Demo Configuration
# WARNING: revise all the lines below before you go into production
plugins:
security:
ssl:
transport:
pemcert_filepath: certs/esnode.pem
pemkey_filepath: certs/esnode-key.pem
pemtrustedcas_filepath: certs/root-ca.pem
enforce_hostname_verification: false
http:
enabled: true
pemcert_filepath: certs/esnode.pem
pemkey_filepath: certs/esnode-key.pem
pemtrustedcas_filepath: certs/root-ca.pem
allow_unsafe_democertificates: true
allow_default_init_securityindex: true
authcz:
admin_dn:
- CN=kirk,OU=client,O=client,L=test,C=de
audit.type: internal_opensearch
enable_snapshot_restore_privilege: true
check_snapshot_restore_write_privileges: true
restapi:
roles_enabled: ["all_access", "security_rest_api_access"]
system_indices:
enabled: true
indices:
[
".opendistro-alerting-config",
".opendistro-alerting-alert*",
".opendistro-anomaly-results*",
".opendistro-anomaly-detector*",
".opendistro-anomaly-checkpoints",
".opendistro-anomaly-detection-state",
".opendistro-reports-*",
".opendistro-notifications-*",
".opendistro-notebooks",
".opendistro-asynchronous-search-response*",
]