Arellia has two built-in tasks that set security descriptors and will accomplish most of what you are trying to accomplish:
- Set Restrictive Service Security Client Task - removes the ability for Administrators to stop or modify a service.
- Set Standard Service Security Client Task - sets the service security to the Windows default, giving Administrators the ability to stop or modify a service.
To apply restrictive service security:
- Navigate to Tasks > Client Tasks > Local Security > Set Restrictive Service Security Client Task
- (optional) Clone the client task
- Set the Service to the service you are targeting (ie. the Arellia Agent)
- (optional) Set the security descriptor to a custom one
- Save the client task
- Select Run Now and execute the task on endpoints