Bug 852452

Summary: candlepin-ca.key is readable by apache
Product: Red Hat Satellite Reporter: Miroslav Suchý <msuchy>
Component: InstallationAssignee: Katello Bug Bin <katello-bugs>
Status: CLOSED CURRENTRELEASE QA Contact: Katello QA List <katello-qa-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.0.0CC: bkearney, lzap, mmccune
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-12 07:20:27 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:
Embargoed:

Description Miroslav Suchý 2012-08-28 14:17:09 UTC
Description of problem:

# ls -l /etc/candlepin/certs/
total 8
-rw-r--r--. 1 root katello 1834 Aug 28 04:44 candlepin-ca.crt
-rw-r-----. 1 root katello    1679 Aug 28 04:44 candlepin-ca.key
lrwxrwxrwx. 1 root katello   37 Aug 28 04:44 candlepin-upstream-ca.crt -> /etc/candlepin/certs/candlepin-ca.cr

Apache belongs to group katello, katello group can read candlepin-ca.key.
Therefore user apache can read private key of candlepin.
This can be exploited if attacker exploit apache.
I believe that we do not need apache to have access to this private key.

Version-Release number of selected component (if applicable):
katello-1.1.7-1.git.31.8662665.el6.noarch

 
I expect that 
  chown root:root /etc/candlepin/certs/candlepin-ca.key
would solve this situation.

Comment 1 Mike McCune 2012-08-29 15:18:35 UTC
We use the cert+key in our apache conf for the default setup:

 grep candlepin /etc/httpd/conf.d/katello.conf 
  SSLCertificateFile /etc/candlepin/certs/candlepin-ca.crt
  SSLCertificateKeyFile /etc/candlepin/certs/candlepin-ca.key
  SSLCaCertificateFile /etc/candlepin/certs/candlepin-ca.crt

perhaps there is a better way to set this up so we don't have todo this

Comment 2 Lukas Zapletal 2012-08-30 13:53:29 UTC
I wonder there is no other way. We need to use candlepin CA.

Comment 3 Bryan Kearney 2014-08-11 19:24:41 UTC
I think we can close this:

[root@sat6 certs]# find / -name candlepin-ca.key
<EMPTY>

[root@sat6 certs]# pwd
/etc/pki/katello/certs
[root@sat6 certs]# ls -lah
total 44K
drwxr-xr-x. 2 root foreman 4.0K Aug  8 14:12 .
drwxr-xr-x. 5 root foreman 4.0K Aug  8 14:13 ..
-rw-r--r--. 1 root root    5.4K Aug  8 14:12 java-client.crt
-rw-r--r--. 1 root root    5.4K Aug  8 14:03 katello-apache.crt
-rw-r--r--. 1 root foreman 5.3K Aug  8 14:03 katello-ca.crt
-rw-r--r--. 1 root root    1.8K Aug  8 14:03 katello-ca-stripped.crt
-rw-r--r--. 1 root root    5.4K Aug  8 14:12 sat6.rdu.redhat.com-qpid-broker.crt

Comment 4 Lukas Zapletal 2014-08-12 07:20:27 UTC
Yes.

[root@nightly ~]# id foreman
uid=497(foreman) gid=498(foreman) groups=498(foreman),52(puppet)
[root@nightly ~]# id apache
uid=48(apache) gid=48(apache) groups=48(apache)