I need to create a file that will be used to store sensitive data; the goal is to end up with an ACL that restricts access to the domain \ user running at creation time. But by default, apparently, unrestricted access is also allowed for SYSTEM and for the administrator.
Two questions: firstly, is there anything in Windows or .NET that breaks badly if the System and the Administrator are denied access to the file?
Secondly, from C #, how can I get the necessary permissions? I'm just doing File.Create ("myFile.dat") right now; obviously the version of the API is not the one I should use. I found a very complex alternative, but it seems that I am assuming that I know the current domain name and username; what is really the only way to do this?
Thank!
source
share