Bird
Raised Fist0

You want to create an API key for authentication in Elasticsearch using this request:

hard🚀 Application Q15 of Q15
Elasticsearch - Security
You want to create an API key for authentication in Elasticsearch using this request:
POST /_security/api_key
{"name": "my-key", "role_descriptors": {"my-role": {"cluster": ["all"]}}}

What is the correct way to authenticate this request?
AUse basic authentication with a user having the 'manage_api_key' privilege
BNo authentication is needed to create API keys
CUse the API key itself in the request header
DUse anonymous access enabled in Elasticsearch
Step-by-Step Solution
Solution:
  1. Step 1: Understand API key creation requirements

    Creating API keys requires authentication with a user having 'manage_api_key' privilege.
  2. Step 2: Identify correct authentication method

    Basic authentication with such a user is needed; API key or anonymous access won't work for creation.
  3. Final Answer:

    Use basic authentication with a user having the 'manage_api_key' privilege -> Option A
  4. Quick Check:

    API key creation requires privileged user auth [OK]
Quick Trick: API key creation needs privileged user auth [OK]
Common Mistakes:
MISTAKES
  • Trying to create API key without authentication
  • Using API key before it exists
  • Assuming anonymous access allows API key creation

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Elasticsearch Quizzes