RodDaSilva
New Member
- Joined
- Apr 9, 2018
- Messages
- 8
- Thread Author
- #1
Hi,
New here but not new to Windows. I have a software requirement that I am surprised I can't seem to find an answer for.
I have written a Windows Service. I have created an installer for this service. This installer (when run as Administrator) creates a new user, provides the user with necessary "SeServiceLogonRight" rights, and then installs the Windows Service to run as this new user. Specifically I do NOT want the Windows Service running as Local Service, Local System or Network Service as I don't want it to have that elevated rights those service accounts enjoy.
The installer goes on to give this new user read/write permissions to the install directory and removes all other inherited permissions on the folder, essentially ensuring that only this user (and the Administrator) can access the installation directory, but no other users.
When I start the service all is well in the world and the service can read/write to the installation directory and other users cannot access this directory.
However, because the new user is a member of the "Authenticated Users" group it still has access to the rest of the machine. For example I can write code in my service to read and write to the C:\. I want NOT to be able to do that.
I want to give confidence to the Admins that install my service that it can ONLY read/write to its designated installation directory- i.e.; that it is IMPOSSIBLE for the Window Service to access any other part of the File System. Essentially I want to sandbox the Windows Service running as this new user to be rooted in that directory. How can I achieve this?
IOWs, how can I ensure my service runs with "least privileges" so that it only has file system permissions rooted at that installation directory and no others. Note that Group Policy isn't an option. The solution must work on a standalone Windows machine (server or client). I am targeting Windows 8.1 & Windows Server 2012 and up.
I believe it would be possible to Deny access to any other directory on the machine to this new user. However, this involves manipulating the security that is already set on the Windows machine. What I am hoping to be able to do is set security only on the new user that the installer has created such that the requirement is met. Does anybody have any ideas how I can achieve that? Seems to me it should be possible but I haven't found a way to pull it off.
Thanks,
Rod
New here but not new to Windows. I have a software requirement that I am surprised I can't seem to find an answer for.
I have written a Windows Service. I have created an installer for this service. This installer (when run as Administrator) creates a new user, provides the user with necessary "SeServiceLogonRight" rights, and then installs the Windows Service to run as this new user. Specifically I do NOT want the Windows Service running as Local Service, Local System or Network Service as I don't want it to have that elevated rights those service accounts enjoy.
The installer goes on to give this new user read/write permissions to the install directory and removes all other inherited permissions on the folder, essentially ensuring that only this user (and the Administrator) can access the installation directory, but no other users.
When I start the service all is well in the world and the service can read/write to the installation directory and other users cannot access this directory.
However, because the new user is a member of the "Authenticated Users" group it still has access to the rest of the machine. For example I can write code in my service to read and write to the C:\. I want NOT to be able to do that.
I want to give confidence to the Admins that install my service that it can ONLY read/write to its designated installation directory- i.e.; that it is IMPOSSIBLE for the Window Service to access any other part of the File System. Essentially I want to sandbox the Windows Service running as this new user to be rooted in that directory. How can I achieve this?
IOWs, how can I ensure my service runs with "least privileges" so that it only has file system permissions rooted at that installation directory and no others. Note that Group Policy isn't an option. The solution must work on a standalone Windows machine (server or client). I am targeting Windows 8.1 & Windows Server 2012 and up.
I believe it would be possible to Deny access to any other directory on the machine to this new user. However, this involves manipulating the security that is already set on the Windows machine. What I am hoping to be able to do is set security only on the new user that the installer has created such that the requirement is met. Does anybody have any ideas how I can achieve that? Seems to me it should be possible but I haven't found a way to pull it off.
Thanks,
Rod