Access denied ("" "localhost:0" "listen,resolve")

i have a custom plugin processor with socket and i create file
grant {
permission “*”, “connect,resolve”;
still occur
access denied (“” “localhost:0” “listen,resolve”)
when i use my processor

Assuming you have a custom plugin for OpenSearch. You would need to set security policies to allow socket permissions.
Take a look at Anomaly Detection plugin example: anomaly-detection/plugin-security.policy at main · opensearch-project/anomaly-detection · GitHub

You might have to use

grant {
permission “*”, “listen,resolve”;
1 Like

thanks for the reply, i have tried listen,resolve. but same error as before. my opensearch was started with docker-compose, so i installed plugin in docker cmdline

thanks already solved

Awesome, so how did you solve this problem?
It would probably help other folks lurking around in the forums.

any codes may used SecurityManager.checkxx should be writtern in AccessController.doPrivileged(()->{…});

grant {
permission “*”, “listen,resolve”;
is also needed

hi bro, i have a new question. :joy:
fatal error in thread [opensearch[opensearch-node1][management][T#3]], exiting
opensearch-node1 | java.lang.ExceptionInInitializerError
opensearch-node1 | at$execute$0(
opensearch-node1 | at java.base/
opensearch-node1 | at
opensearch-node1 | at org.opensearch.ingest.Processor.execute(
opensearch-node1 | at org.opensearch.ingest.CompoundProcessor.innerExecute(
opensearch-node1 | at org.opensearch.ingest.CompoundProcessor.execute(
opensearch-node1 | at org.opensearch.ingest.Pipeline.execute(
opensearch-node1 | at org.opensearch.ingest.IngestDocument.executePipeline(
opensearch-node1 | at org.opensearch.action.ingest.SimulateExecutionService.executeDocument(
opensearch-node1 | at org.opensearch.action.ingest.SimulateExecutionService.lambda$execute$3(
opensearch-node1 | at org.opensearch.action.ActionRunnable$2.doRun(
opensearch-node1 | at org.opensearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(
opensearch-node1 | at
opensearch-node1 | at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(
opensearch-node1 | at java.base/java.util.concurrent.ThreadPoolExecutor$
opensearch-node1 | at java.base/
opensearch-node1 | Caused by: access denied (“java.lang.reflect.ReflectPermission” “”)
opensearch-node1 | at java.base/
opensearch-node1 | at java.base/
opensearch-node1 | at java.base/java.lang.SecurityManager.checkPermission(
opensearch-node1 | at java.base/java.lang.reflect.Proxy.checkNewProxyPermission(
opensearch-node1 | at java.base/java.lang.reflect.Proxy.newProxyInstance(
opensearch-node1 | at java.base/java.lang.reflect.Proxy.newProxyInstance(
opensearch-node1 | at com.sun.jna.Native.loadLibrary(
opensearch-node1 | at com.sun.jna.Native.loadLibrary(
opensearch-node1 | at org.graylog2.syslog4j.impl.unix.UnixSyslog.loadLibrary(
opensearch-node1 | at org.graylog2.syslog4j.impl.unix.UnixSyslog.initialize(
opensearch-node1 | at org.graylog2.syslog4j.impl.AbstractSyslog.initialize(
opensearch-node1 | at org.graylog2.syslog4j.Syslog.createInstance(
opensearch-node1 | at org.graylog2.syslog4j.Syslog.initialize(
opensearch-node1 | at org.graylog2.syslog4j.Syslog.(

i try
grant {
permission java.lang.reflect.ReflectPermission “”;
and still code in AccessController.doPrivileged()
but it doesn’t work.
just find only one related issue with azure jdk

can you help me to solve this? :joy:

Hello @feng! Can you update us if you have

grant {
  permission java.lang.RuntimePermission "accessDeclaredMembers";

in your security policy file of the plugin?