Bug 1368346

Summary: Wrong permission for defined config file /etc/virt-who.d/XXX
Product: Red Hat Enterprise Linux 7 Reporter: Liushihui <shihliu>
Component: virt-whoAssignee: Radek Novacek <rnovacek>
Status: CLOSED NOTABUG QA Contact: Eko <hsun>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.3CC: gxing, ovasik, sgao
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-23 11:36:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Liushihui 2016-08-19 06:52:40 UTC
Description of problem:
Configuration file under folder /etc/virt-who.d/ may contain passwords but its permissions are 644 (rw-r--r--). It should be 600 (rw-------) to prevent non-root users to read the configuration file.

Version-Release number of selected component (if applicable):
virt-who-0.17-7.el7.noarch
subscription-manager-1.17.10-1.el7.x86_64
python-rhsm-1.17.6-1.el7.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Create any config file under /etc/virt-who.d/
# vim /etc/virt-who.d/hyperv
2.Check the permission of this config file.
[root@cloud-qe-16-vm-03 virt-who.d]# ll /etc/virt-who.d/hyperv 
-rw-r--r--. 1 root root 114 Aug 19 02:43 /etc/virt-who.d/hyperv

Actual results:
its permissions are 644 (rw-r--r--)

Expected results:
Any file under /etc/virt-who.d/ should be 600 (rw-------) to prevent non-root users to read the configuration file.

Additional info:

Comment 1 Radek Novacek 2016-08-23 11:36:05 UTC
I don't think this is necessary. The /etc/virt-who.d directory has drwx------ perms, so non-root users can't access anything in the directory and it does't matter what perms those files have.