通过 RMI 对客户端进行安全身份验证

问题描述 投票:0回答:1

我正在考虑像这样对我的 RMI 服务的用户进行身份验证

interface RemoteService extends Remote { ... }
interface RemoteServiceProvider extends Remote { ... }
class RemoteServiceProviderImpl implements RemoteServiceProvider {
   RemoteService getService(String authCode) throws RemoteException {
     if (check(authCode)) return (RemoteService) UnicastRemoteObject.export(theRemoteService, 0);
     else throw ...;
   }

}

但是,这可能并不真正安全。我怀疑当真正的服务被

export
ed时,任何猜到正确端口的人都可以获取它。

我怎样才能正确地做到这一点?

java security authentication rmi
1个回答
1
投票

看起来当真正的服务被导出时,任何人 猜测正确的端口可以获取它。

不。他们还必须猜测远程对象 UID,并且有一个系统属性导致它们通过安全 RNG 生成。他们还必须具有远程接口类,并且还必须能够使用正确的 IP:端口、远程接口和远程 UID 构造对象的远程存根。不容易。然而,如果您有严重的安全问题,那么您当然应该考虑采用相互身份验证的 SSL,如果您对安全 RMI 非常认真,也许还应该考虑完整的 Jini/Secure JERI。另请参阅本白皮书

© www.soinside.com 2019 - 2024. All rights reserved.