Skip to content

Fix ACL documentation discrepancies from source code audit#305

Open
sscarduzio wants to merge 2 commits intodevelopfrom
fix/acl-docs-discrepancies
Open

Fix ACL documentation discrepancies from source code audit#305
sscarduzio wants to merge 2 commits intodevelopfrom
fix/acl-docs-discrepancies

Conversation

@sscarduzio
Copy link
Copy Markdown
Contributor

@sscarduzio sscarduzio commented Mar 18, 2026

Summary

Cross-referenced the public documentation against the plugin source code and found several discrepancies. This PR fixes the verified issues:

  • maxBodyLengthmax_body_length: The YAML key was incorrectly documented in camelCase. The actual plugin key is snake_case.
  • Missing response_headers rule: This rule exists in the plugin but had zero documentation. Added description and usage example.
  • Group rule aliases undocumented: The canonical group rule names (groups_any_of, groups_all_of, etc.) have widely-used aliases (groups, roles, any_of, etc.) that were not mentioned. Added an alias reference table.
  • external_authorization alias missing: This alias for groups_provider_authorization was not mentioned.
  • Incompatible rule combinations undocumented: Added a new section documenting which rules cannot coexist in a single block (e.g. kibana_access + actions/filter/fields/response_fields), plus the auth-only rule pairing requirement.

Test plan

  • Verify max_body_length is the correct key name in the plugin source
  • Verify response_headers rule description matches plugin behavior
  • Verify group aliases table matches Rule.Name(...) definitions in source
  • Verify incompatible combinations match IncompatibleRules checks in source
  • Review rendered markdown for formatting issues

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Added backward-compatible YAML aliases for group rules and external authorization (including headers alias and provider alias "external_authorization").
    • Standardized config key naming (maxBodyLength → max_body_length).
    • Added response_headers examples to set custom HTTP response headers.
    • Documented incompatible rule combinations and authorization-only rule requirements.
    • Expanded dynamic variables with acl, header, and jwt contexts and updated Groups examples/readability.

- Fix `maxBodyLength` → `max_body_length` (correct snake_case key name)
- Add missing `response_headers` rule documentation
- Add group rule aliases table (groups, roles, any_of, all_of, etc.)
- Add `external_authorization` alias note for `groups_provider_authorization`
- Add "Incompatible rule combinations" section (kibana_access conflicts)
- Document auth-only rule requirement (must pair with authentication rule)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

Add sentence clarifying that groups/roles aliases apply only to ACL rule
keys inside access blocks, not to the users section groups field.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment thread elasticsearch.md
coderabbitai[bot]

This comment was marked as resolved.

@sscarduzio sscarduzio requested a review from coutoPL March 18, 2026 22:24
Comment thread elasticsearch.md
- then we check whether the authorized user groups are permitted in context of the rule

{% hint style="info" %}
**Groups rule aliases**: For backwards compatibility, the following YAML key aliases are recognized and treated identically to their canonical names:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We intentionally didn't mention it. We do care about backward compatibility, but we want our users to migrate to the new format. And most importantly, we don't want our new users (or existing users who are starting to use the feature) to not use the older format.

IMO, we should remove this section.

Comment thread elasticsearch.md

#### `groups_provider_authorization`

Also available as the alias `external_authorization`.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as above

Comment thread elasticsearch.md

A list of api keys expected in the header `X-Api-Key`

#### `response_headers`
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no such rule in the ROR ES code 🙃

Comment thread elasticsearch.md

| Rule A | Rule B | Reason |
|--------|--------|--------|
| `kibana_access` | `actions` | Kibana access internally manages action filtering |
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The kibana_access rule is deprecated. We should not focus so much on it. The access level is now part of the kibana rule

Comment thread elasticsearch.md
| `kibana_access` | `response_fields` | Kibana access conflicts with response field filtering |

{% hint style="info" %}
The composite `kibana` rule does **not** have these conflicts — it replaces the legacy separate rules (`kibana_access`, `kibana_index`, `kibana_hide_apps`, `kibana_template_index`) and handles these interactions internally.
Copy link
Copy Markdown
Collaborator

@coutoPL coutoPL Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not true.

The table should look like this:

Rule A Rule B Additional condition Reason
kibana actions when kibana.access != unrestricted Kibana access internally manages action filtering
kibana filter Kibana access conflicts with Document Level Security
kibana fields Kibana access conflicts with Field Level Security
kibana response_fields Kibana access conflicts with response field filtering

@coutoPL
Copy link
Copy Markdown
Collaborator

coutoPL commented Apr 8, 2026

@sscarduzio kindly reminder about this one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants