SAP / macOS-enterprise-privileges

For Mac users in enterprise environments, this application gives users control over the administration of their machine by elevating their level of access to administrator privileges on macOS. Users can set a timeframe in the application's settings to perform specific tasks, such as installing or removing an application.
Apache License 2.0
1.4k stars 150 forks source link

Do not ignore ToggleTimer when not using the Dock to elevate privileges. #53

Closed cvgs closed 5 months ago

cvgs commented 2 years ago

This pull request addresses issue #40.

Privileges are automatically removed after the configured timeout regardless how they have been acquired, either by

Privileges are automatically removed after the timeout, even it the computer has been asleep or switched off. This is done by creating a LaunchAgent for the user after privileges have been elevated, which will be triggered in the following circumstances:

The LaunchAgent calls PrivilegesCLI with a new command line parameter called "expire". This will demote the user only if the timer has elapsed, otherwise do nothing. After demotion the LaunchAgent file will be removed so that it is not executed again.

This is a drop-in replacement for older installations and should even coexist with other methods for demotion, as it simply uses a triggered call to PrivilegesCLI. There are no attempts to detect or prevent "sneaky" behavior , it's simply an extension of the current behaviour.

However, to be able to create and remove the LaunchAgent in ~/Library/LaunchAgents, the sandboxing entitlement for this app needed to be disabled. As the app itself is designed to elevate privileges this probably can be considered acceptable, but needs discussion.

cla-assistant[bot] commented 2 years ago

CLA assistant check
All committers have signed the CLA.

ntauthy commented 1 year ago

Would love to see this integrated into the main app. I'm no dev but I've been looking for this functionality for a while.

paulstasiuk commented 6 months ago

bump. it would be great to see this merged.

mthielemann commented 5 months ago

This will be implemented in Privileges 2.0.0, which will be available later this year.