Interestingly, I only see ALLOWED messages in the logs. I see an ALLOWED log for msearch for this user, but then I see the subsequent individual search requests (which we only call if msearch hits an auth error) also being ALLOWED. Here is an example for msearch (anonymized):
{"@timestamp":"2024-11-08T17:48:37.508Z", "log.level": "INFO", "message":"\u001B[36mALLOWED by { name: 'Allow read access', policy: ALLOW, rules: [groups_or,actions,indices] req={ ID:15fbd770-110b-4074-b423-3117b1786468-1134655352#13245089, TYP:MultiSearchRequest, CGR:my_group, USR:my_username, BRS:true, KDX:null, ACT:indices:data/read/msearch, OA:omitted/32, XFF:null, DA:omitted32, IDX:index_a1, MET:POST, PTH:/index_a1/_msearch, CNT:<OMITTED, LENGTH=2200.0 B> , HDR:Accept-Encoding=identity, Authorization=<OMITTED>, Content-Length=2200, Host=omitted:9200, accept=application/vnd.elasticsearch+json; compatible-with=8, connection=keep-alive, content-type=application/vnd.elasticsearch+x-ndjson; compatible-with=8, user-agent=elasticsearch-py/8.12.1 (Python/3.9.20; elastic-transport/8.12.0), x-elastic-client-meta=es=8.12.1,py=3.9.20,t=8.12.0,ur=1.26.18, HIS:[OMITTED],}\u001B[0m", "ecs.version": "1.2.0","service.name":"ES_ECS","event.dataset":"elasticsearch.server","process.thread.name":"scala-execution-context-global-1102","log.logger":"tech.beshu.ror.accesscontrol.logging.AccessControlLoggingDecorator","elasticsearch.cluster.uuid":"wBzfElLHTyK6VfR4SL3wvg","elasticsearch.node.id":"08aLNijJQ72_CcYbR-UFuA","elasticsearch.node.name":"data-18","elasticsearch.cluster.name":"my_cluster"}
Here is what the settings look like:
readonlyrest:
audit_collector: false
prompt_for_basic_auth: true
access_control_rules:
- name: "Allow read access"
groups: ["my_group"]
indices: ["index_a*", "indexb_*", "index_c"]
actions:
- indices:data/read/*
- name: "Allow write access"
groups: ["my_group"]
indices: ["index_c"]
actions:
- indices:data/write/bulk
- indices:data/write/index
- name: "Allow update to certain indices"
groups: ["my_group"]
indices: ["indexb_*"]
actions:
- indices:data/write/update
users:
- username: my_username
auth_key_unix: my_username:$6$rounds=656000$OMITTED
groups: ["my_group"]