Re: RegSetKeySecurity - how to change a registry key to read access only



Let's backtrack a sec...
Right now, I have code that uses the functions....
AllocateAndInitializeSid, InitializeAcl, AddAccessAllowedAce,
InitializeSecurityDescriptor, SetSecurityDescriptorDacl (the whole hideous
confusing bunch)
and of course ::RegSetKeySecurity(hKey, (SECURITY_INFORMATION)
DACL_SECURITY_INFORMATION, &SecDesc);

So, right now I have working code that changes the particular registry entry
to be read only, it works, that's fine...

So now if me or anybody else tries to open up the registry hkey for reading,
that will be fine, but if they try to do so for writing it will
fail....well, so far, so good...

The problem is, there is no way to prevent the changing back of the security
of the registry hkey back to write access again, so what is the point of the
security?

These are for all intents, "public" keys, I want them to be readable but not
changeable, if they were my own private keys, they of course the simplest
and easiest solution would just be to encrypt them.

Logging on and/or off with admin privileges is not the answer (since
everybody has admin rights)....




Basically, I'm asking, can I lock the access rights with let's call it a
"key" (again, I'm not talking about encryption, but access rights), where
only people with the "key" can unlock, and change the access rights of said
registry entry back to write access again. Is this even doable?










"Tom Alter" <Lord2702@xxxxxxx> wrote in message
news:OrvuVp$OFHA.1932@xxxxxxxxxxxxxxxxxxxxxxx
> Use this function when you have Administrator rights, once changed and put
> your security
> bits in the key, logout and then log-in with different user, and try
> changing it. :-;)
> I am just giving you a hint.
>
>
> "Martin Ortiz" <martinortiz@xxxxxxxxxxxxx> wrote in message
> news:%23yKw6K6OFHA.688@xxxxxxxxxxxxxxxxxxxxxxx
>> I know how to use RegSetKeySecurity, to change a registry keys access to
>> read only but is there a way to change to read only, where only I can
>> change
>> it back to read/write?
>>
>> Kinda like a password, you can read, but you can only write if you have
>> correct "password" (note: I can't encryt the key, which it sounds like
>> what
>> I'm asking, it's not)
>>
>>
>> Is there a way to use AllocateAndInitializeSid to do this? It has 8 slots
>> for sub authorities....is there a way to just authorize access with sub
>> authorities so that only if you
>> use same ones again to change access right, can you have write access
>> rights
>> again...?
>>
>>
>>
>>
>>
>>
>>
>>
>>
>
>


.



Relevant Pages

  • Re: SMS 2.0 Component Errors - Pre Upgrade
    ... It's possible that the registry is corrupt, ... The other suggestion is try an upgrade instead of site reset. ... ACLRESET will fix the permissions but will not fix the keys. ... SMS Inventory Data Loader has moved this file to ...
    (microsoft.public.sms.admin)
  • Re: Non admin users cant do things they need to do
    ... You mean they are along with the registry entires? ... i added the keys below to the registry (as administrator) logged off, ... can set the time then they can fake out system event logs by changing ...
    (microsoft.public.windowsxp.embedded)
  • Re: User access rights within process on Vista
    ... A registry key is kernel secured so RegOpenKeyEx will work for you. ... The good and hard way = use AccessCheck. ... but I need it to check access rights to ... procedure ApplyDenyMask(Ace: TAce; var Result: ...
    (microsoft.public.platformsdk.security)
  • Re: 0x80070005 Installation Failure message
    ... I wonder why Microsoft ... it had different permissions than other ... Before you modify the registry, ... > one or more registry keys could not be deleted ...
    (microsoft.public.windowsupdate)
  • Re: Malwarebyte Anti-Malware finds many trojans, while others .... why?
    ... malware is known to alter. ... modified policy keys in place, ... Most users don't know what those registry ... MBAM doesn't alert on me for those changes. ...
    (alt.comp.anti-virus)