Complete the code to enable security in Elasticsearch.
xpack.security.enabled: [1]Setting xpack.security.enabled to true activates security features in Elasticsearch.
Complete the code to set a password for the built-in user.
bin/elasticsearch-setup-passwords [1]The interactive option lets you set passwords manually for built-in users.
Fix the error in the role definition to allow reading data.
"read_data": { "cluster": ["monitor"], "indices": [ { "names": ["*"], "privileges": ["[1]"] } ] }
The privilege read allows users to read data from indices.
Fill both blanks to create a user with the 'read_data' role and a password.
POST /_security/user/[1] { "password": "[2]", "roles": ["read_data"] }
The username is 'alice' and the password is 'secret123' to create a secure user.
Fill all three blanks to configure TLS for the HTTP layer.
xpack.security.http.ssl: enabled: [1] key: [2] certificate: [3]
Enable TLS with true, and provide the key and certificate file paths.
