Adinternal/cron is unauthorized for user _system


i have setup a normal 7.10.0 elasticsearch cluster, kibana and beats (metric- and filebeat on clusterserver) with multiple nodes which all communicate SSL-encrypted.

On every node of the elasticsearch cluster i installed open-distro-anomaly-detection and opendistro-job-scheduler in the version and i installed opendistroAnomalyDetectionKibana@ on kibana.
This works fine, but every hour i get the following error. Have i forgotten to install or configure something wrong?

[2021-01-29T00:49:46,203][ERROR][c.a.o.a.c.HourlyCron     ] [bdp-node-12] Hourly maintenance has exception.
org.elasticsearch.ElasticsearchSecurityException: action [cluster:admin/opendistro/adinternal/cron] is unauthorized for user [_system]
        at ~[x-pack-core-7.10.0.jar:7.10.0]
        at ~[x-pack-security-7.10.0.jar:7.10.0]
        at [x-pack-security-7.10.0.jar:7.10.0]
        at [x-pack-security-7.10.0.jar:7.10.0]
        at [x-pack-security-7.10.0.jar:7.10.0]
        at$applyInternal$3( [x-pack-security-7.10.0.jar:7.10.0]
        at org.elasticsearch.action.ActionListener$1.onResponse( [elasticsearch-7.10.0.jar:7.10.0]
        at$Authenticator.lambda$authenticateAsync$2( [x-pack-security-7.10.0.jar:7.10.0]
        at$Authenticator.lambda$lookForExistingAuthentication$6( [x-pack-security-7.10.0.jar:7.10.0]
        at$Authenticator.lookForExistingAuthentication( [x-pack-security-7.10.0.jar:7.10.0]
        at$Authenticator.authenticateAsync( [x-pack-security-7.10.0.jar:7.10.0]
        at$Authenticator.access$000( [x-pack-security-7.10.0.jar:7.10.0]
        at [x-pack-security-7.10.0.jar:7.10.0]
        at [x-pack-security-7.10.0.jar:7.10.0]
        at$apply$1( [x-pack-security-7.10.0.jar:7.10.0]
        at [x-pack-core-7.10.0.jar:7.10.0]
        at [x-pack-security-7.10.0.jar:7.10.0]
        at$RequestFilterChain.proceed( [elasticsearch-7.10.0.jar:7.10.0]
        at [elasticsearch-7.10.0.jar:7.10.0]
        at [elasticsearch-7.10.0.jar:7.10.0]
        at org.elasticsearch.client.node.NodeClient.executeLocally( [elasticsearch-7.10.0.jar:7.10.0]
        at org.elasticsearch.client.node.NodeClient.doExecute( [elasticsearch-7.10.0.jar:7.10.0]
        at [elasticsearch-7.10.0.jar:7.10.0]
        at [opendistro-anomaly-detection-]
        at org.elasticsearch.threadpool.Scheduler$ReschedulingRunnable.doRun( [elasticsearch-7.10.0.jar:7.10.0]
        at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun( [elasticsearch-7.10.0.jar:7.10.0]
        at [elasticsearch-7.10.0.jar:7.10.0]
        at java.util.concurrent.ThreadPoolExecutor.runWorker( [?:?]
        at java.util.concurrent.ThreadPoolExecutor$ [?:?]
        at [?:?]

I have seen, that Open Distro alert plugin elasticsearch exception has a similar exception and thats it not possible with xpack, but kibana - Enable xpack features on Open Distro For Elasticsearch - Stack Overflow stated, that some xpack features are included in BASIC version.

So doesn’t it definitely work with xpack installed or can these ERRORs be safely ignored, because the installation and kibana visualisation seems to work.

Thanks @vielfarbig for reaching out.
All opendistro plugins are not compatible with x-pack enabled features, in this case x-pack enabled security.
That said, we haven’t tested it with x-pack and cron in ad is a frequent job which runs to take care of some critical pieces of Anomaly Detection where we manage cleaning up of checkpoints, models etc. If this user does not have enough permissions to run the cron, Anomaly Detection plugin might be impaired.

Thanks @vemsarat for your reply.
If i actually try to use the ad plugin i get Elasticsearch security config - #4 by bpavani as well. So is there a way around to somehow “only use” the security plugin for opendistro plugins and xpack for the other elasticsearch components? As i understand
disable TLS for Transport, enable for Rest · Issue #37 · opendistro-for-elasticsearch/security · GitHub is an issue regarding this and #issuecomment-747491504 says that its on the way. Is there a time plan? Is there a current somehow “hacky” solution?

If there is no option to get ad plugin with xpack woring on the same cluster, can one setup a second opendistro cluster besides a normal elastiseach cluster and use the ad plugin on the opendistro cluster and let the opendistro and elasticsearch cluster exchange data. So are opendistro and elasticsearch cluster fully integrated with each other?

Thats a great question. I did look into the post from bpavani@.
There is no official plan on ODFE to work with x-pack enabled security. ODFE community members might have out of the box solutions, but we haven’t seen any so far.

To answer the second part of the question, from my intuition i believe it will be tricky to get things working with 1 elasticsearch node and other as odfe node. Again as I said, we haven’t tested it so cannot confirm if it can really work but I believe there are going to be some challenges to get it work especially with security.