The 'names' field must be a list of index names, but here it is a string.
Step 2: Verify other fields
Privileges including 'write' is valid, 'role' key exists, and JSON syntax is correct.
Final Answer:
"names" should be a list, not a string -> Option B
Quick Check:
Index names must be in a list [OK]
Hint: Index names must be inside square brackets [OK]
Common Mistakes:
Using a string instead of a list for 'names'
Thinking 'write' privilege is invalid
Missing the 'role' key
Assuming JSON syntax error without checking
5. You want to protect sensitive customer data in Elasticsearch so only users with the 'customer_read' role can view it. Which setup best achieves this?
hard
A. Create a role with 'read' privilege on the customer data index and assign it to users.
B. Create a role with 'write' privilege on all indices and assign it to users.
C. Disable security to allow all users to access data freely.
D. Create a role with 'manage' privilege on the cluster only.
Solution
Step 1: Define the goal for data protection
Only users with 'customer_read' role should view sensitive customer data.
Step 2: Choose the correct role setup
A role with 'read' privilege on the customer data index limits access to viewing only, assigned to authorized users.
Step 3: Eliminate incorrect options
'Write' privilege allows changes, disabling security removes protection, and 'manage' privilege controls cluster, not data access.
Final Answer:
Create a role with 'read' privilege on the customer data index and assign it to users -> Option A
Quick Check:
Read role + assign users = protected data access [OK]
Hint: Assign read role to users for safe data viewing [OK]