Windows:在进程级粒度设置安全属性

发布于 2024-12-04 06:13:48 字数 536 浏览 6 评论 0原文

背景:我有一个在后台运行的 Windows 服务(显然),并使用 执行特定交互任务并发回数据的实用程序 通过命名管道连接到服务。每当服务启动时,实用程序就会运行 认为合适,并且只存在几秒钟。

问题始于 Vista,程序无法自由打开命名管道 不再具有写入权限(请参阅Windows 服务强化)。

我计划通过创建具有安全属性的命名管道来解决问题 这样就可以在 who 的上下文中向当前登录的用户授予写访问权限 程序开始了,我的脑海中浮现出一个问题: 我是否可以仅允许使用其(或其线程)的进程访问该命名管道 处理?

或者换句话说:Windows(Vista/7/更高版本)的安全机制可以归结为 进程级粒度?

我是该领域的新手,有关安全性的文档让我非常头疼,因此欢迎任何启发。

提前致谢。

Background: I have a windows service that works in the background (obviously), and uses
a utility program to perform a certain interactive task and send back the data
to the service over a named pipe. The utility program runs whenever the service
sees fit, and lives only for a few seconds.

The problem begins in Vista where the program could not freely open the named pipe
for write access anymore (see Windows Service Hardening).

I plan to solve the problem by creating the named pipe with security attributes
such that grant write-access to the currently logged-in user under whos context
the program is started, while a question rose to my mind:
Could I allow access to that named pipe to only the process using its (or its thread's)
handle?

Or to put differently: Can windows' (Vista/7/later) security mechanism go down to
process-level granularity?

I'm a novice in that area and the docs about security are giving me quite a headache, so any enlightenment is welcome.

Thanks in advance.

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

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

发布评论

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

评论(1

东京女 2024-12-11 06:13:48

您无法通过进程 ID 保护对象(因为进程不是安全主体),但您可以在建立连接后使用 GetNamedPipeClientProcessId ,如果进程 ID 不是您喜欢的 ID,则所有请求都会失败。

You can't secure an object via process id (because processes are not security principals), but you can use GetNamedPipeClientProcessId after the connection is established, and fail all requests if the process id is not one you like.

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