如何“绑定” .NET Remoting 服务器中特定通道(tcp、http、ipc)的服务?

发布于 2024-07-08 01:16:07 字数 431 浏览 7 评论 0原文

我有一个复杂的 .NET Remoting 服务器应用程序,它提供了一些服务。 客户端当前可以使用 tcp 和 http 通道连接到服务器。

现在我需要实现一些新的管理服务,但我想限制它们对本地计算机的可用性,即我想创建一个可以使用这些新服务的管理工具,但我不希望敏感数据物理离开服务器,所以我需要限制在同一台服务器计算机上运行管理工具。

我考虑过添加新服务并向服务器注册 ipc 通道以供管理工具使用。 现在问题来了:如何防止远程客户端使用 tcp 或 http 通道连接到这些新的管理服务? 我可以说“注册服务x,由程序集A中的类C实现,只能通过ipc使用”,“注册服务y,由程序集A中的类D实现,可通过tcp / http使用”在app.config中(或使用远程处理基础设施类)?

令我困惑的是“只能通过 ipc 使用”部分。 (不,现在不能选择移植到 WCF。)

I have a complex .NET Remoting server app that provides a couple of services. Clients can currently use tcp and http channels to connect to the server.

Now I need to implement some new administration services, but I want to restrict their availability to the local machine, i.e. I want to create an administration tool that can use these new services, but I do not want sensitive data to physically leave the server, so I need to restrict running the admin tool on the same server computer.

I thought about adding the new services and also registering the ipc channel with the server for use by the admin tool. Now comes the problem: how can I prevent remote clients connecting to these new admin services using the tcp or http channel? Can I say something like "register service x, implemented by class C in assembly A, usable only via ipc", "register service y, implemented by class D in assembly A, usable via tcp/http" in app.config (or using remoting infrastructure classes)?

It's the "usable only via ipc" part that baffles me. (And no, porting to WCF is not an option right now.)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

梦萦几度 2024-07-15 01:16:07

RegisterWellKnownServiceType 没有重载允许您指定要注册的通道,IPCServerChannel 上也没有任何方法来注册服务,因此这些都不起作用。

我能想到的最好的方法是编写一个 ChannelSink 来过滤消息或提供安全性。 可以将它们添加到 TcpChannel 和 HttpChannel 的构造函数中,以过滤掉仅管理调用。

There are no overloads for RegisterWellKnownServiceType that allow you to specify which channel to register on, nor are there any methods on the IPCServerChannel to register a service, so none of that will work.

The best I can think of is writing a ChannelSink that filters your messages or provides security. These can be added to the constructor of your TcpChannel and HttpChannel to filter out admin only calls.

薄荷梦 2024-07-15 01:16:07

获取调用它的服务的 IP 地址。 如果不是 127.0.0.1,则拒绝呼叫。

Get the IPAddress of the service calling it. If it is anything other than 127.0.0.1 reject the call.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文