api-authz

Configure Kibana API route authorization with requiredPrivileges and privilege-based branching.

21.2k|8.6k|Updated Jan 26, 2013
One-click install
npx skills add https://github.com/elastic/kibana --skill api-authz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-authz
Source: https://github.com/elastic/kibana/tree/main/.agents/skills/api-authz
Command: npx skills add https://github.com/elastic/kibana --skill api-authz

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill ensures that all API routes within Kibana are properly secured with authorization checks, preventing unauthorized access to sensitive data and functionality.

Core Features & Use Cases

  • Route Security Configuration: Define authorization requirements for API endpoints using requiredPrivileges.
  • Privilege Naming Conventions: Enforces a consistent <operation>_<subject> format for clear and maintainable privilege definitions.
  • Conditional Logic: Enables dynamic route behavior based on user privileges using request.authzResult.
  • Opting Out: Provides mechanisms to safely disable authorization for specific routes when necessary, with clear reasons.
  • Use Case: When developing a new API endpoint that should only be accessible by administrators, you would use this Skill to define the necessary administrative privileges in the route's security configuration.

Quick Start

Configure the '/api/users' route to require the 'admin_users' privilege for access.

Frequently Asked Questions about api-authz

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I secure Kibana API routes with authorization checks?

To secure Kibana API routes, you define authorization requirements using the `requiredPrivileges` property in your route configuration. This mandates that only users with specified privileges can access the endpoint, preventing unauthorized access to sensitive data and functionality.

What is the correct naming convention for custom Kibana privileges?

The correct naming convention for custom Kibana privileges is the `<operation>_<subject>` format. This structure ensures privilege definitions remain clear and maintainable across your codebase, such as defining an administrative privilege like `admin_users` for a user management endpoint.

Can I implement conditional logic in Kibana routes based on user privileges?

Yes, you can implement conditional logic in Kibana routes based on user privileges using the `request.authzResult` object. This enables dynamic route behavior, allowing your API to branch its execution path depending on the specific privileges the authenticated user currently holds.

Is it possible to opt out of authorization for a specific Kibana API route?

Yes, it is possible to opt out of authorization for a specific Kibana API route when necessary. The skill provides mechanisms to safely disable authorization checks, although you must provide clear reasons to maintain adherence to established security best practices.

Why do all Kibana API routes need authorization configuration?

All Kibana API routes need authorization configuration to prevent unauthorized access to sensitive data and functionality. Mandating authorization checks ensures adherence to security best practices across the platform, blocking unauthenticated interactions with your endpoints by default.