I have an admin app that runs with elevated privileges and I need it to store some sensitive files in a directory that only system administrators can access.
It probably has to do with the following call but I am not sure how to configure it.
Directory.CreateDirectory(@"C:\SomePath", new AccessControl.DirectorySecurity() { AccessRightType = ?, AccessRuleType = ?, AuditRuleType = ?);
If there is a better way to achieve the same, please let me know. Thanks.
EDIT: Found a good implementation here. Will leave the question open for a day in case there are any other suggestions.
Found a good solution here.