# Document level Privileges Not Working

**URL:** https://discuss.elastic.co/t/document-level-privileges-not-working/340649
**Category:** APM
**Tags:** elastic-stack-security, java
**Created:** [August 11, 2023, 3:08pm UTC](https://discuss.elastic.co/t/document-level-privileges-not-working/340649 "2023-08-11T15:08:51Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Namita\_Jaokar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/namita_jaokar/32/104106_2.png) [@Namita\_Jaokar](https://discuss.elastic.co/u/Namita_Jaokar)
#### Post date: [August 11, 2023, 3:08pm UTC](https://discuss.elastic.co/t/document-level-privileges-not-working/340649/1 "2023-08-11T15:08:51Z")

</div>

Hi All,

I am using ELK version 8.6.2 and need to implement user security in APM agents.  
I want only privileged user to view or edit data for the APM Agent.  
Example: if there are 2 users using 2 different APM Agents on a the same ELK and apm-server then their Data should be restricted to user level and they should not view or edit other users Data.

For the same , I tried implementing document level security. Below is the query used:

POST /\_security/role/read-role  
{  
"indices" : [  
{  
"names" : ["\*"],  
"privileges" : ["read"],  
"query" : {  
"term" : { "service.name": "my\_agent" }  
}  
}  
]

**Response of above query:**  
{  
"error": {  
"root\_cause": [  
{  
"type": "security\_exception",  
"reason": "current license is non-compliant for [field and document level security]",  
"license.expired.feature": "field and document level security"  
}  
],  
"type": "security\_exception",  
"reason": "current license is non-compliant for [field and document level security]",  
"license.expired.feature": "field and document level security"  
},  
"status": 403  
}

I have my xpack security enabled in elasticsearch. Below are my properties w.r.t xpack:-

xpack.security.enabled: true  
xpack.security.enrollment.enabled: true  
xpack.security.http.ssl:  
enabled: true

xpack.security.transport.ssl:  
enabled: true  
verification\_mode: certificate  
cluster.initial\_master\_nodes: ["Hostname"]  
http.host: 0.0.0.0  
xpack.security.http.ssl.certificate\_authorities: certs/example.com-ca.pem  
xpack.security.http.ssl.certificate: certs/example.com.pem  
xpack.security.http.ssl.key: certs/example.com.key  
xpack.security.http.ssl.client\_authentication: optional  
xpack.security.authc.realms.pki.pki1.order: 0  
xpack.security.authc.realms.pki.pki1.certificate\_authorities: ["/home/pathTo/ELK/elasticsearch-8.6.2/config/certs/example.com-ca.pem"]  
xpack.security.transport.ssl.certificate\_authorities: certs/example.com-ca.pem  
xpack.security.transport.ssl.certificate: certs/example.com.pem  
xpack.security.transport.ssl.key: certs/example.com.key

Please advise/suggest what is missing from the configuration side to enable document level security.

Best Regards,  
Namita Jaokar

---

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [August 11, 2023, 3:13pm UTC](https://discuss.elastic.co/t/document-level-privileges-not-working/340649/2 "2023-08-11T15:13:59Z")

</div>

> [@Namita\_Jaokar](#):
>
> "type": "security\_exception",  
> "reason": "current license is non-compliant for [field and document level security]",  
> "license.expired.feature": "field and document level security"

What license do you have? Field and Document level is a **paid** feature, you need at least a Platinum license.

---

<div class="post-metadata">

### Author: ![Namita\_Jaokar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/namita_jaokar/32/104106_2.png) [@Namita\_Jaokar](https://discuss.elastic.co/u/Namita_Jaokar)
#### Post date: [August 11, 2023, 3:23pm UTC](https://discuss.elastic.co/t/document-level-privileges-not-working/340649/3 "2023-08-11T15:23:05Z")

</div>

Hi @leandrojmp ,

Thank you for the quick response. 🙂

Currently I am using basic version of ELK. For the platinum version, Is there any trial available or do I need to first upgrade to platinum version to implement this feature.

I am asking because currently I am doing R&D of the requirement in my application and subscription would be based on the results. Hence, wanted to confirm on trial version available for it.

Thanks & Regards,  
Namita Jaokar

---

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [August 11, 2023, 3:31pm UTC](https://discuss.elastic.co/t/document-level-privileges-not-working/340649/4 "2023-08-11T15:31:25Z")

</div>

> [@Namita\_Jaokar](#):
>
> For the platinum version, Is there any trial available or do I need to first upgrade to platinum version to implement this feature.

Yes, there is a 30-day trial if you didn't enable it before.

You can enable it in Kibana, going to Stack Management \> Stack \> License Management.

Or using the \_license API in Elasticsearch as explained in the [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/8.6/start-trial.html).

---

<div class="post-metadata">

### Author: ![Namita\_Jaokar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/namita_jaokar/32/104106_2.png) [@Namita\_Jaokar](https://discuss.elastic.co/u/Namita_Jaokar)
#### Post date: [August 22, 2023, 1:25pm UTC](https://discuss.elastic.co/t/document-level-privileges-not-working/340649/5 "2023-08-22T13:25:51Z")

</div>

Thanks for the reference Documentation.  
Will go through it and try implementing the same.

Thanks & Regards,  
Namita Jaokar

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [September 19, 2023, 1:26pm UTC](https://discuss.elastic.co/t/document-level-privileges-not-working/340649/6 "2023-09-19T13:26:07Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
