1
0
Fork 0
tuned/com.redhat.tuned.policy
Ondřej Lysoněk 829c7de36c Support sending logs over DBus
Add two DBus calls:
log_capture_start(log_level, timeout)
 * This will instruct Tuned to create a new log handler, which will
   start writing log messages with level 'log_level' and higher to
   a buffer. The log levels are standard Python log levels (e.g.
   logging.INFO) or Tuned's custom log level LOG_LEVEL_CONSOLE which
   is defined as 60. The handler will be destroyed after 'timeout' seconds
   if contents of the buffer are not collected using log_capture_finish()
   before the timeout. If 'timeout' <= 0, log messages will be collected
   for as long as it takes before log_capture_finish() is called (use
   with care, so that you don't fill up memory with Tuned logs). This
   call returns a string ID of the log handler, a token, which should
   be passed to log_capture_finish().

log_capture_finish(token)
 * This will return (as a string) log messages collected by a log handler
   associated with the 'token'. It will also destroy the log handler.

These calls are privileged. They can only be called by the root user or
by a user logged in on a local console (just like the change-profile DBus
calls). This restriction is meant to prevent ordinary users from forcing
Tuned to allocate an insane amount of memory for the log buffers and crash
it (or other processes). In the future we may wish to replace this
restriction with a configurable policy which determines how many (and how
big) log buffers can a user with a given UID create. We may also want to
destroy the log handler when the original caller disconnects from DBus.

Signed-off-by: Ondřej Lysoněk <olysonek@redhat.com>
2018-06-11 09:23:20 +02:00

179 lines
6.1 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC "-//freedesktop//DTD polkit Policy Configuration 1.0//EN"
"http://www.freedesktop.org/software/polkit/policyconfig-1.dtd">
<policyconfig>
<vendor>Tuned</vendor>
<vendor_url>https://fedorahosted.org/tuned/</vendor_url>
<icon_name>tuned</icon_name>
<action id="com.redhat.tuned.active_profile">
<description>Show active profile</description>
<message>Authentication is required to show active profile</message>
<defaults>
<allow_any>yes</allow_any>
<allow_inactive>yes</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
</action>
<action id="com.redhat.tuned.profile_mode">
<description>Show current profile selection mode</description>
<message>Authentication is required to show current profile selection mode</message>
<defaults>
<allow_any>yes</allow_any>
<allow_inactive>yes</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
</action>
<action id="com.redhat.tuned.disable">
<description>Disable Tuned</description>
<message>Authentication is required to disable Tuned</message>
<defaults>
<allow_any>auth_admin</allow_any>
<allow_inactive>auth_admin</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
</action>
<action id="com.redhat.tuned.is_running">
<description>Check whether Tuned is running</description>
<message>Authentication is required to check whether Tuned is running</message>
<defaults>
<allow_any>yes</allow_any>
<allow_inactive>yes</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
</action>
<action id="com.redhat.tuned.profile_info">
<description>Show information about Tuned profile</description>
<message>Authentication is required to show information about Tuned profile</message>
<defaults>
<allow_any>yes</allow_any>
<allow_inactive>yes</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
</action>
<action id="com.redhat.tuned.profiles">
<description>List Tuned profiles</description>
<message>Authentication is required to list Tuned profiles</message>
<defaults>
<allow_any>yes</allow_any>
<allow_inactive>yes</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
</action>
<action id="com.redhat.tuned.profiles2">
<description>List Tuned profiles</description>
<message>Authentication is required to list Tuned profiles</message>
<defaults>
<allow_any>yes</allow_any>
<allow_inactive>yes</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
</action>
<action id="com.redhat.tuned.recommend_profile">
<description>Show Tuned profile name which is recommended for your system</description>
<message>Authentication is required to show recommended profile name</message>
<defaults>
<allow_any>yes</allow_any>
<allow_inactive>yes</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
</action>
<action id="com.redhat.tuned.reload">
<description>Reload Tuned configuration</description>
<message>Authentication is required to reload Tuned configuration</message>
<defaults>
<allow_any>auth_admin</allow_any>
<allow_inactive>auth_admin</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
</action>
<action id="com.redhat.tuned.start">
<description>Start Tuned daemon</description>
<message>Authentication is required to start Tuned daemon</message>
<defaults>
<allow_any>auth_admin</allow_any>
<allow_inactive>auth_admin</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
</action>
<action id="com.redhat.tuned.stop">
<description>Stop Tuned daemon</description>
<message>Authentication is required to stop Tuned daemon</message>
<defaults>
<allow_any>auth_admin</allow_any>
<allow_inactive>auth_admin</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
</action>
<action id="com.redhat.tuned.switch_profile">
<description>Switch Tuned profile</description>
<message>Authentication is required to switch Tuned profile</message>
<defaults>
<allow_any>auth_admin</allow_any>
<allow_inactive>auth_admin</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
</action>
<action id="com.redhat.tuned.log_capture_start">
<description>Start log capture</description>
<message>Authentication is required to start log capture</message>
<defaults>
<allow_any>auth_admin</allow_any>
<allow_inactive>auth_admin</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
</action>
<action id="com.redhat.tuned.log_capture_finish">
<description>Stop log capture and return captured log</description>
<message>Authentication is required to stop log capture</message>
<defaults>
<allow_any>auth_admin</allow_any>
<allow_inactive>auth_admin</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
</action>
<action id="com.redhat.tuned.auto_profile">
<description>Enable automatic profile selection mode</description>
<message>Authentication is required to change profile selection mode</message>
<defaults>
<allow_any>auth_admin</allow_any>
<allow_inactive>auth_admin</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
</action>
<action id="com.redhat.tuned.verify_profile">
<description>Verify Tuned profile</description>
<message>Authentication is required to verify Tuned profile</message>
<defaults>
<allow_any>yes</allow_any>
<allow_inactive>yes</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
</action>
<action id="com.redhat.tuned.verify_profile_ignore_missing">
<description>Verify Tuned profile, ignore missing values</description>
<message>Authentication is required to verify Tuned profile</message>
<defaults>
<allow_any>yes</allow_any>
<allow_inactive>yes</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
</action>
</policyconfig>