Bird
Raised Fist0

Which of the following is the correct syntax to define field-level security in an Elasticsearch role?

easy📝 Syntax Q12 of Q15
Elasticsearch - Security
Which of the following is the correct syntax to define field-level security in an Elasticsearch role?
A"fields": ["title", "author"]
B"field_security": { "deny": ["title", "author"] }
C"field_security": { "grant": ["title", "author"] }
D"field_access": { "allow": ["title", "author"] }
Step-by-Step Solution
Solution:
  1. Step 1: Recall correct field-level security syntax

    Elasticsearch uses "field_security" with a "grant" array to specify allowed fields.
  2. Step 2: Eliminate incorrect options

    "deny" is not valid here; "fields" and "field_access" are incorrect keys.
  3. Final Answer:

    "field_security": { "grant": ["title", "author"] } -> Option C
  4. Quick Check:

    Use "field_security" with "grant" for allowed fields [OK]
Quick Trick: Use "field_security" with "grant" to allow fields [OK]
Common Mistakes:
MISTAKES
  • Using "deny" instead of "grant"
  • Wrong key names like "fields" or "field_access"
  • Confusing syntax with document-level security

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes