elasticsearch-authz

elasticsearch-authz is a skill for Claude Code, Codex from aspectrr/deer. It costs 44 tokens per session (1,826 once invoked), scanned A, original, MIT.

A tool for controlling who can access data and features in Elasticsearch, a search and analytics database. It manages users, roles, external-directory mappings, and restrictions on documents and fields.

In plain words
What is it for?
Use it to create users and least-privilege roles, connect LDAP or SAML identities, set Kibana permissions, limit records by user or department, and hide fields such as personal information.
Why use it?
It helps prevent users from seeing indexes, records, or sensitive fields they are not allowed to access. It also translates access requests into specific permissions and role assignments.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/aspectrr/deer/elasticsearch-authz
Any agent
npx skills add aspectrr/deer --skill elasticsearch-authz
Clone the repo
git clone --depth 1 https://github.com/aspectrr/deer

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for elasticsearch-authz

README.md
[![agentmods](https://agentmods.dev/badge/skills/aspectrr/deer/elasticsearch-authz.svg)](https://agentmods.dev/skills/aspectrr/deer/elasticsearch-authz)
Your own site
<a href="https://agentmods.dev/skills/aspectrr/deer/elasticsearch-authz"><img src="https://agentmods.dev/badge/skills/aspectrr/deer/elasticsearch-authz.svg" alt="Measured on agentmods" height="20"></a>
Per session 44 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,826 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00044 $0.01826
Opus 5 $0.00022 $0.00913
Sonnet 5 $0.00009 $0.00365
Haiku 4.5 $0.00004 $0.00183

Measured 6d ago against content hash 67ede8eccd00, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

elasticsearch-authz scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -X POST "${ELASTICSEARCH_URL}/_security/user/${USERNAME}" \
deer-cli/internal/skill/defaults/elasticsearch-authz/SKILL.md · 244 lines

How it starts

The opening of the file, as written. The whole thing — 244 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Elasticsearch Authorization

Manage Elasticsearch role-based access control: native users, roles, role assignment, and role mappings for external realms.

For authentication methods and API key management, see the elasticsearch-authn skill.

For detailed API endpoints, see references/api-reference.md.

Jobs to Be Done

  • Create a native user with a specific set of privileges
  • Define a custom role with least-privilege index and cluster access
  • Assign one or more roles to an existing user
  • Create a role with Kibana feature or space privileges
  • Configure a role mapping for external realm users (SAML, LDAP, PKI)
  • Derive role assignments dynamically from user attributes (Mustache templates)
  • Restrict document visibility per user or department (document-level security)
  • Hide sensitive fields like PII from certain roles (field-level security)
  • Implement attribute-based access control (ABAC) using templated role queries
  • Translate a natural-language access request into user, role, and role mapping tasks

Prerequisites

Item Description
Elasticsearch URL Cluster endpoint (e.g. https://localhost:9200 or a Cloud deployment URL)
Kibana URL Required only when setting Kibana feature/space privileges
Authentication Valid credentials (see the elasticsearch-authn skill)
Cluster privileges manage_security is required for user and role management operations

Manage Native Users

Create a user

curl -X POST "${ELASTICSEARCH_URL}/_security/user/${USERNAME}" \
  <auth_flags> \
  -H "Content-Type: application/json" \
  -d '{
    "password": "'"${PASSWORD}"'",
    "roles": ["'"${ROLE_NAME}"'"],
    "full_name": "'"${FULL_NAME}"'",
    "email": "'"${EMAIL}"'",
    "enabled": true
  }'

Read the full file on GitHub · 244 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 244 lines · 44 tokens per session scan A 67ede8eccd00

Subscribe to this mod's changes

elasticsearch-authz is a skill published in the GitHub repository aspectrr/deer (404 stars, last pushed 4mo ago), licensed MIT. It adds 44 tokens to every session and 1,826 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.