Bug 632851 - [PATCH] fence_virsh: add option --use-sudo
[PATCH] fence_virsh: add option --use-sudo
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: fence-agents (Show other bugs)
19
All Linux
low Severity low
: ---
: ---
Assigned To: Marek Grac
Fedora Extras Quality Assurance
: Patch
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-09-11 09:12 EDT by Niels de Vos
Modified: 2015-01-12 04:28 EST (History)
1 user (show)

See Also:
Fixed In Version: fence-agents-3.1.10-1.fc19
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-01-12 04:28:11 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
Initial patch for --use-sudo for fence_virsh (2.62 KB, application/octet-stream)
2010-09-11 09:12 EDT, Niels de Vos
no flags Details

  None (edit)
Description Niels de Vos 2010-09-11 09:12:02 EDT
Created attachment 446663 [details]
Initial patch for --use-sudo for fence_virsh

Description of problem:

fence_virsh logs in on the host (bare metal) running the guest (virtual) and executes 'virsh <action> <guest>'. It is required that the system that executed the fencing, can log in as a user with the privileges to run 'virsh'. Allowing 'virsh' to work correctly, requires on standard installations 'root' privileges.

However it may not always be acceptable that a virtual machine executing fence-operations can gain 'root' access on the physical host. Separating privileges with 'sudo' is easy to setup, but requires fence_virsh to be able to execute 'sudo virsh ...' instead of the plain 'virsh ...'.

The attached patch implements a --use-sudo (or -U) option in fencing.py and uses this option in fence_virsh.

A simple /etc/sudoers.d/fence_virsh allows any user in the 'virtadmin' group to execute (any) virsh commands. It would be possible to fine-tune this on user basis and only allow some users fence some virtual-machines.

Example of /etc/sudoers.d/fence_virsh:
# configuration to allow the group virtadmin execute virsh commands
%virtadmin	ALL = NOPASSWD : /usr/bin/virsh


Please consider this patch (or similar) for inclusion (an email to cluster-devel@redhat.com was sent yesterday, but is not in the archives yet...).
Comment 1 Marek Grac 2012-08-09 09:06:34 EDT
@Niels:

sorry that it took so long. Patch based on your proposion is in upstream now and it will be part of next minor version.

http://git.fedorahosted.org/cgit/fence-agents.git/commit/?id=b2afa6263795d06bbfc027444c812a7c20d500c7
Comment 2 Niels de Vos 2012-08-09 11:03:38 EDT
Thanks!
Comment 3 Fedora End Of Life 2013-04-03 16:34:35 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19
Comment 4 Fedora End Of Life 2015-01-09 17:28:25 EST
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Note You need to log in before you can comment on or make changes to this bug.