Grant privileges and roles needed for publishing
Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud. Availability This functionality is generally available and ready for production usage. Serverless interfaces and procedures might differ from classic Elastic Stack deployments. The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability This functionality is generally available and ready for production usage. Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.
Serverless
Generally available
Stack
Generally available
Users who publish events to Elasticsearch need to create and write to Auditbeat indices. To minimize the privileges required by the writer role, use the setup role to pre-load dependencies. This section assumes that you’ve run the setup.
When using ILM, turn off the ILM setup check in the Auditbeat config file before running Auditbeat to publish events:
setup.ilm.check_exists: false
To grant the required privileges:
Create a writer role, called something like
auditbeat_writer, that has the following privileges:NoteThe
monitorcluster privilege and thecreate_docandauto_configureprivileges onauditbeat-*indices are required in every configuration.Type Privilege Purpose Cluster monitorRetrieve cluster details (e.g. version) Cluster read_ilmRead the ILM policy when connecting to clusters that support ILM.Not needed when setup.ilm.check_existsisfalse.Index create_doconauditbeat-*indicesWrite events into Elasticsearch Index auto_configureonauditbeat-*indicesUpdate the datastream mapping. Consider either disabling entirely or adding therule -{{beat_default_index_prefix}}-*to the cluster settingsaction.auto_create_indexto prevent unwanted indices creations from the agents.Omit any privileges that aren’t relevant in your environment.
Assign the writer role to users who will index events into Elasticsearch.