Bird
Raised Fist0

This role definition has an error. What is it?

medium📝 Debug Q14 of Q15
Elasticsearch - Security
This role definition has an error. What is it?
{
  "role": {
    "indices": [
      {
        "names": "sensitive-data",
        "privileges": ["read", "write"]
      }
    ]
  }
}
A"privileges" cannot include "write".
B"names" should be a list, not a string.
C"role" key is missing.
DThe JSON syntax is invalid.
Step-by-Step Solution
Solution:
  1. Step 1: Check the data type of 'names'

    The 'names' field must be a list of index names, but here it is a string.
  2. Step 2: Verify other fields

    Privileges including 'write' is valid, 'role' key exists, and JSON syntax is correct.
  3. Final Answer:

    "names" should be a list, not a string -> Option B
  4. Quick Check:

    Index names must be in a list [OK]
Quick Trick: Index names must be inside square brackets [OK]
Common Mistakes:
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

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes