Bug 1857396
| Summary: | SELinux issue when using secure communication to remote pmcd | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Jan Kurik <jkurik> | ||||
| Component: | pcp | Assignee: | Mark Goodwin <mgoodwin> | ||||
| Status: | CLOSED ERRATA | QA Contact: | Jan Kurik <jkurik> | ||||
| Severity: | low | Docs Contact: | |||||
| Priority: | low | ||||||
| Version: | 8.3 | CC: | agerstmayr, b.prins, jkurik, mgoodwin, nathans, patrickm | ||||
| Target Milestone: | rc | Keywords: | Bugfix, Triaged | ||||
| Target Release: | 8.4 | Flags: | pm-rhel:
mirror+
|
||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | pcp-5.2.2-1.el8 | Doc Type: | No Doc Update | ||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2021-05-18 15:19:32 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: | |||||||
| Attachments: |
|
||||||
|
Description
Jan Kurik
2020-07-15 19:23:17 UTC
Created attachment 1701293 [details]
Audit log containing the AVC records generated by pmcd
In pmproxy/src/deprecated.c: VerifyClient() .. __pmSecureServerHandshake() .. __pmSecureServerIPCFlags() .. __pmSecureServerInit() .. NSS_InitReadWrite() So pmproxy's use of NSS_InitReadWrite() is deprecated. The only other caller is pmcd, which does not require RW. But if you think pmproxy's use might be resurrected one day, then we could allow RW access to the db via an SELinux policy update. The usual recommendation is not to grant access unless it's actually required but afaict we have no clients needing RW access to the cert db. hmm. well in that case 'deprecated' is a misnomer because it isn't. So we need to fix the selinux issue too. So I think 'deprecated' mode should call a new libpcp function to open in RW mode. It would be preferable for pmcd to open in RO mode (as per the current patch). I'll update the deprecated code in pmproxy, add the new function to libpcp and fix the selinux issue. unless anyone has a better suggestion ... like are the UOB people really still likely to be using this? (minnus (name?) has moved on hasn't he?)
I have a new patch for this BZ that does not require an SELinux policy update - basically I don't think we should add a rule for pmcd like "allow [pcp_pmcd_t] [etc_t] : [file] { write };" unnecessarily. Instead my new patch changes __pmSecureServerInit() in libpcp to check an environment variable and if set, only call NSS_Init() rather than NSS_InitReadWrite(). pmcd would set this environment variable (because it only requires read-only access to the NSS db), but pmproxy would not set it. The default behaviour (when the envar is not set) remains unchanged, so no changes needed for pmproxy or any other libpcp apps.
Fixed upstream for pcp-5.2.2. This avoid the AVC and also changes pmcd to initialize NSS read-only instead of read-write when using secure connections.
commit c85528b1865336ad108a211a87f24132cf45d554
Author: Mark Goodwin <mgoodwin>
Date: Tue Oct 13 10:58:49 2020 +1100
pmcd/libpcp: pmcd init NSS read-only when using secure connections
Use an environment variable to specify whether to initialize NSS in
read-only or read-write mode in libpcp:__pmSecureServerInit(),
defaulting to read-write if not set (i.e. no change for existing apps
that do not set the variable).
For pmcd, set PCP_NSS_INIT_MODE=readonly in $PCP_SYSCONFIG_DIR/pmcd
because pmcd does not need read-write access to the NSS certificate
database (though some future DSO/PMDA might).
New test qa/1876 checks pmcd's environment. Document the new variable
in PCPINTRO(1).
Resolves: RHBZ#1857396
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (pcp bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2021:1754 |