Access control of privileged operations for ordinary users should be handled ''exclusively'' by a centrally managed authority. Usermode/consolehelper should be phased out and be replaced entirely by PolicyKit.

+

Access control of privileged operations for ordinary users should be handled ''exclusively'' by a centrally managed authority.

+

+

Usermode/consolehelper should be phased out and be replaced entirely by polkit.

== Owner ==

== Owner ==

Line 10:

Line 12:

* Name: [[User:Kay| Kay Sievers]]

* Name: [[User:Kay| Kay Sievers]]

* Email: kay@redhat.com

* Email: kay@redhat.com

+

+

* Name: [[User: Notting| Bill Nottingham]]

+

* Email: notting@redhat.com

== Current status ==

== Current status ==

−

* Targeted release: [[Releases/18 | Fedora 18]]

+

* Targeted release: [[Releases/19 | Fedora 19]]

−

* Last updated: 2012-04-03

+

* Last updated: 2012-10-16

* Percentage of completion: 20%

* Percentage of completion: 20%

Line 19:

Line 24:

The usermode/consolehelper program is a setuid-root wrapper around a couple of system tools, providing superuser privileges to ordinary users. Its policy is controlled by text files in /etc.

The usermode/consolehelper program is a setuid-root wrapper around a couple of system tools, providing superuser privileges to ordinary users. Its policy is controlled by text files in /etc.

−

These days, most privileged system operations are already controlled by PolicyKit, a well-established, fine-grained, (possibly) network-transparent service for managing privileged operations by ordinary users. Enterprise environments need to be able to centrally define access control policy for the organization, and automatically apply it to all connected workstations.

+

These days, most privileged system operations are already controlled by polkit, a well-established, fine-grained, (possibly) network-transparent service for managing privileged operations by ordinary users. Enterprise environments need to be able to centrally define access control policy for the organization, and automatically apply it to all connected workstations.

−

* PolicyKit can be used by privileged processes to decide if it should execute privileged operations on behalf of the requesting user. For directly executed tools, PolicyKit provides a setuid-root helper program called ‘’pkexec’’.The hooks to ask the user for authorizations are well-integrated into text environments, and native in all major graphical environments.

+

* polkit can be used by privileged processes to decide if it should execute privileged operations on behalf of the requesting user. For directly executed tools, polkit provides a setuid-root helper program called ‘’pkexec’’.The hooks to ask the user for authorizations are well-integrated into text environments, and native in all major graphical environments.

−

* The concept of a ''console user'' (that usermode/consolehelper implements) is no longer a sufficient concept to derive privileges from. OTOH PolicyKit authorizations can properly distinguish between multiple active sessions and seats: e.g. an untrusted user’s reboot request is only granted if only a single user session runs at that time.

+

* The concept of a ''console user'' (that usermode/consolehelper implements) is no longer a sufficient concept to derive privileges from. OTOH polkit authorizations can properly distinguish between multiple active sessions and seats: e.g. an untrusted user’s reboot request is only granted if only a single user session runs at that time.

<!-- What work do the developers have to accomplish to complete the feature in time for release? Is it a large change affecting many parts of the distribution or is it a very isolated change? What are those changes?-->

<!-- What work do the developers have to accomplish to complete the feature in time for release? Is it a large change affecting many parts of the distribution or is it a very isolated change? What are those changes?-->

−

* Document how to convert consolehelper to PolicyKit:

+

* Document how to convert consolehelper to polkit:

** python: put a pkexec invocation in the wrapping shell script

** python: put a pkexec invocation in the wrapping shell script

** C tools: re-exec with pkexec in C code

** C tools: re-exec with pkexec in C code

** C tools: move original to /usr/lib/<pkg>/<tool>, and wrap /usr/bin/<tool> with a pkexec shell script (ugly!)

** C tools: move original to /usr/lib/<pkg>/<tool>, and wrap /usr/bin/<tool> with a pkexec shell script (ugly!)

−

* Open tracker bug and file bugs against all individual packages.

+

* File bugs against all individual packages, and add them to tracker bug [https://bugzilla.redhat.com/show_bug.cgi?id=502765 502765]

−

* Convert all packages where it makes sense to use polkit, to pkexec.

+

* Convert all packages where it makes sense to use polkit to pkexec.

−

* For the unconverted rest, drop the usermode part and recommend to use pkexec on the command line, similar to the usual usage of sudo.

+

* If all packages are successfully converted, userhelper may be removed

−

=== How to convert ===

+

=== How to Convert ===

A quick and easy way to convert a former consolehelper program is the use of pkexec.

A quick and easy way to convert a former consolehelper program is the use of pkexec.

−

As an example we convert system-config-date to PolicyKit:

+

As an example we convert system-config-date to polkit:

<pre>

<pre>

# ls -l /usr/bin/system-config-date

# ls -l /usr/bin/system-config-date

Line 81:

Line 86:

<action id="org.fedoraproject.config.date.pkexec.run">

<action id="org.fedoraproject.config.date.pkexec.run">

−

<description>Run System Config Date</description>

+

<_description>Run System Config Date</_description>

−

<message>Authentication is required to run system-config-date</message>

+

<_message>Authentication is required to run system-config-date</_message>

Make sure, you can call all the tools, which used to use usermode and be asked the appropriate password.

+

Make sure you can call all the tools which used to use usermode and are asked the appropriate authentication.

== User Experience ==

== User Experience ==

Line 183:

Line 188:

== Contingency Plan ==

== Contingency Plan ==

<!-- If you cannot complete your feature by the final development freeze, what is the backup plan? This might be as simple as "None necessary, revert to previous release behaviour." Or it might not. If you feature is not completed in time we want to assure others that other parts of Fedora will not be in jeopardy. -->

<!-- If you cannot complete your feature by the final development freeze, what is the backup plan? This might be as simple as "None necessary, revert to previous release behaviour." Or it might not. If you feature is not completed in time we want to assure others that other parts of Fedora will not be in jeopardy. -->

−

Even if we cannot drop usermode for F18 (because not all packages have been converted) the changes in the packages do not have to be reverted.

+

Even if we cannot drop usermode for F19 (because not all packages have been converted) the changes in the packages do not have to be reverted.

* The following packages now use the polkit policy configuration instead of the usermode/consolehelper configuration. Please migrate any policy, which you have created for those packages. Documentation about polkit can be found on http://www.freedesktop.org/software/polkit/docs/latest/

+

+

<list of packages>

== Comments and Discussion ==

== Comments and Discussion ==

* See [[Talk:Features/UsermodeMigration]]

* See [[Talk:Features/UsermodeMigration]]

−

[[Category:FeatureReadyForWrangler]]

+

[[Category:FeatureAcceptedF19]]

<!-- When your feature page is completed and ready for review -->

<!-- When your feature page is completed and ready for review -->

<!-- remove Category:FeaturePageIncomplete and change it to Category:FeatureReadyForWrangler -->

<!-- remove Category:FeaturePageIncomplete and change it to Category:FeatureReadyForWrangler -->

<!-- After review, the feature wrangler will move your page to Category:FeatureReadyForFesco... if it still needs more work it will move back to Category:FeaturePageIncomplete-->

<!-- After review, the feature wrangler will move your page to Category:FeatureReadyForFesco... if it still needs more work it will move back to Category:FeaturePageIncomplete-->

<!-- A pretty picture of the page category usage is at: https://fedoraproject.org/wiki/Features/Policy/Process -->

<!-- A pretty picture of the page category usage is at: https://fedoraproject.org/wiki/Features/Policy/Process -->

Current status

Detailed Description

The usermode/consolehelper program is a setuid-root wrapper around a couple of system tools, providing superuser privileges to ordinary users. Its policy is controlled by text files in /etc.

These days, most privileged system operations are already controlled by polkit, a well-established, fine-grained, (possibly) network-transparent service for managing privileged operations by ordinary users. Enterprise environments need to be able to centrally define access control policy for the organization, and automatically apply it to all connected workstations.

polkit can be used by privileged processes to decide if it should execute privileged operations on behalf of the requesting user. For directly executed tools, polkit provides a setuid-root helper program called ‘’pkexec’’.The hooks to ask the user for authorizations are well-integrated into text environments, and native in all major graphical environments.

The concept of a console user (that usermode/consolehelper implements) is no longer a sufficient concept to derive privileges from. OTOH polkit authorizations can properly distinguish between multiple active sessions and seats: e.g. an untrusted user’s reboot request is only granted if only a single user session runs at that time.

This will not export the DISPLAY variable, so we have to add a policy file, although starting a GUI as root is not encouraged.
The important part is: <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>

Documentation

Release Notes

The following packages now use the polkit policy configuration instead of the usermode/consolehelper configuration. Please migrate any policy, which you have created for those packages. Documentation about polkit can be found on http://www.freedesktop.org/software/polkit/docs/latest/