# Secure access to data via NEST

**URL:** <https://discuss.elastic.co/t/secure-access-to-data-via-nest/270724>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [April 20, 2021, 2:06pm UTC](https://discuss.elastic.co/t/secure-access-to-data-via-nest/270724 "2021-04-20T14:06:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![joaoantao](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joaoantao/32/6546_2.png) [@joaoantao](https://discuss.elastic.co/u/joaoantao)\
**Post date:** [April 20, 2021, 2:06pm UTC](https://discuss.elastic.co/t/secure-access-to-data-via-nest/270724/1 "2021-04-20T14:06:14Z")

</div>

Currently, I am working with large indexes that contain hierarchical documents. I am trying to restrict read access to some documents (document level security) and certain fields (field level security) of those documents based on roles.  
Some of the document level security restrictions are time-based (now), some field level security depends on values of other fields of that same document.

I am struggling while defining all these security rules. Also, I am using the great NEST client but the authorization is done outside (Identity Server) before performing the NEST search call.

Is there a set of good practices that I should follow or keep in mind while setting this up?  
Thank you.

---

<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:** [May 18, 2021, 2:06pm UTC](https://discuss.elastic.co/t/secure-access-to-data-via-nest/270724/2 "2021-05-18T14:06:51Z")

</div>

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