Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
341 views
in Technique[技术] by (71.8m points)

java - Custom Security Plugin for Apache Ignite

I am trying to use Apache Ignite as in-memory database.
To enable the security, I created own security plugin by following link http://smartkey.co.uk/development/securing-an-apache-ignite-cluster/

Below are my implementation details

public class IgniteSecurityConfiguration implements PluginConfiguration{
        public class<? extends PluginProvider> providerClass(){
          return IgniteSecurityProvider.class;
        }
    }
public class IgniteSecurityProvider implements PluginProvider{
    @Override
    public IgnitePlugin plugin(){
      return new CASCachePlugin();
    }
} 

    public Object createComponent(PluginContext pluginContext, Class aClass){
       if(aClass.isAssignableFrom(GridSecuriytProcessor.class)){
       return new PasswordSecurityProcessor();
    } else {return null;}
   }

public class PasswordSecurityProcessor implements GridSecurityProcessor,IgnitePlugin
{
@Override
public SecurityContext authenticateNode(ClusterNode clusterNode, SecurityCredentials securityCredentials){
   return new SecurityContext(){
         public SecuritySubject subject(){
           return new SecuritySubjext(){
             //implement methods
           };
         }
        //other implementation methods
    };
}

getting exception when I am starting ignite using examples/config/example-ignite.xml

Caused by: class org.apache.ignite.IgniteCheckedException: Failed to start SPI: TcpDiscoverySpi
at org.apache.ignite.internal.managers.GridManagerAdapter.startSpi (GridManagerAdapter.java:300)
...
...
Caused by: class org.apache.ignite.spi.IgniteSpiException: Failed to authenticate local node( will shutdown local node).
at org.apache.ignite.spi.discovery.tcp.ServerImpl.localAuthentication(ServerImpl.java:975)
at org.apache.ignite.spi.discovery.tcp.ServerImpl.joinTopology(ServerImpl.java:863)
.....
Cuased by class org.apache.ignite.IgniteCheckedException: Failed to serialize objext: com.x.x.x.PasswordSecurityProcessor
at org.apache.ignite.marshaller.jdk.JdkMarshller.marshl0(JDkMarahsller.java:85)

Any idea on what I am missing? Tried the PasswordSecurityProcessor class to implement Serializable but still it did not help.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Ignite does not provide security capabilities out of the box, you need to implement a plugin for this. Here is a good blog about this that you can use as an example: http://smartkey.co.uk/development/securing-an-apache-ignite-cluster/

To get the security support you need to look at commercial products built on top of Ignite: https://docs.gridgain.com/docs/security-and-audit


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...