Secure a registry key via ACL to remove all access to non administrators

做~自己de王妃 提交于 2019-12-06 13:42:21

Be very careful with deny rules - they're only rarely necessary.

If the only ACE in the ACL is for administrators giving them the access you want them to have, then no one else will have access to the key since there's no ACE granting them access.

It's unclear to me from the documentation for AddAccessRule() if it'll guarantee that a new rule (or ACE) will be added to the end of the ACL or not. This is likely to be the case, but if it's happens to not work that way and your deny ACE ends up before the ACE granting access to Admins, then the deny ACE will 'override' the one granting access (the first system stops looking at the ACL once it hits the first ACE that grants or denies permission). This is why using deny ACE's can be tricky. And since an ACL that doesn't explicitly grant permission causes the access check to fail, you generally only need to specify who is permitted access.

You will likely want to ensure that the owner is set to the admin group - an owner can have no access to a key (or whatever object), but an owner always has the right to change the ACL (makes sense if you think about it for a moment).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!