# How to customize plugin-security.policy for custom realm

**URL:** <https://discuss.elastic.co/t/how-to-customize-plugin-security-policy-for-custom-realm/71570>\
**Category:** Elasticsearch\
**Created:** [January 13, 2017, 9:07pm UTC](https://discuss.elastic.co/t/how-to-customize-plugin-security-policy-for-custom-realm/71570 "2017-01-13T21:07:38Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![kldavis4](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kldavis4/32/14562_2.png) [@kldavis4](https://discuss.elastic.co/u/kldavis4)\
**Post date:** [January 16, 2017, 1:50pm UTC](https://discuss.elastic.co/t/how-to-customize-plugin-security-policy-for-custom-realm/71570/5 "2017-01-16T13:50:08Z")

</div>

So, now, after installing the custom realm extension I have a file named  
x-pack-extension-security.policy in  
/usr/share/elasticsearch/plugins/x-pack/extensions/mycustomrealm.

The contents of the file is:

grant {  
permission java.net.NetPermission "getProxySelector";  
};

I am still getting an error: java.security.AccessControlException: access  
denied ("java.net.NetPermission" "getProxySelector") when the client is  
instantiated. Any ideas? This is with 5.1.1.

---

_[View the full topic](https://discuss.elastic.co/t/how-to-customize-plugin-security-policy-for-custom-realm/71570)._
