Bug 1883666 - libreswan moved NSS directory requires selinux-policy change
Summary: libreswan moved NSS directory requires selinux-policy change
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 32
Hardware: All
OS: Linux
high
medium
Target Milestone: ---
Assignee: Zdenek Pytela
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1895436 (view as bug list)
Depends On:
Blocks: 1895436
TreeView+ depends on / blocked
 
Reported: 2020-09-29 19:48 UTC by Paul Wouters
Modified: 2021-01-19 01:51 UTC (History)
13 users (show)

Fixed In Version: selinux-policy-3.14.5-46.fc32
Clone Of:
: 1895436 (view as bug list)
Environment:
Last Closed: 2021-01-19 01:51:41 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1903154 0 medium CLOSED SELinux is preventing pluto from 'open' accesses on the file /var/lib/ipsec/nss/cert9.db. 2021-02-22 00:41:40 UTC

Description Paul Wouters 2020-09-29 19:48:43 UTC
As of libreswan 4.0, the NSS database used is moved from /etc/ipsec.d to /var/lib/nss/ipsec/

This requires a selinux policy addition:


/var/lib/ipsec(/.*)?       gen_context(system_u:object_r:ipsec_key_file_t,s0)

Comment 1 Remco Luitwieler 2020-11-06 06:02:28 UTC
Fedora 32 has the same problem

Comment 2 Stuart 2020-11-06 11:05:55 UTC
I'm also experiencing this on Fedora 32 after downgrading(reinstalling) from 33

Comment 3 Paul Wouters 2020-11-06 13:38:39 UTC
as a workaround, you can specify nssdir=/etc/ipsec.d   in /etc/ipsec.conf  in "config setup"

Comment 4 Stuart 2020-11-06 13:44:16 UTC
Thats good to know. I've already posted this on the libswan's github tracker and a kind sole there gave me the following SELinux workaround:

semanage fcontext --add --type ipsec_key_file_t '/var/lib/ipsec(/.*)?'
restorecon -rv /var/lib/ipsec

And to undo after the package is fixed

semanage fcontext --delete --type ipsec_key_file_t '/var/lib/ipsec(/.*)?'

Comment 5 Zdenek Pytela 2020-11-06 18:44:42 UTC
In the bz description I can see contradicting path specification, I suppose it should be this one, but I'd rather have if confirmed: /var/lib/ipsec/nss

If keys are only in the nss subdirectory, I will set the file context only for this one.

I've just submitted a Fedora PR to address the issue:
https://github.com/fedora-selinux/selinux-policy/pull/472

Comment 6 Paul Wouters 2020-11-06 20:45:32 UTC
Yes, key material (public, private keys and certs) will only appear in /var/lib/ipsec/nss/

libreswna currently stores only the nss dir in /var/lib/ipsec/
We would have prefered to store it all there, but the debian maintainer wanted a seperate dir for nss, so we think it is better now to stick to one place instead of ending up with different places.

Setting it for only the nss directory is fine.

Comment 7 Zdenek Pytela 2020-12-03 14:28:03 UTC
Changing version for this BZ. This fix was backported.

Comment 8 Zdenek Pytela 2020-12-07 18:44:39 UTC
*** Bug 1895436 has been marked as a duplicate of this bug. ***

Comment 9 Fedora Update System 2021-01-13 20:01:20 UTC
FEDORA-2021-3036e7bf00 has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2021-3036e7bf00

Comment 10 Fedora Update System 2021-01-14 02:22:43 UTC
FEDORA-2021-3036e7bf00 has been pushed to the Fedora 32 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-3036e7bf00`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-3036e7bf00

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 11 Fedora Update System 2021-01-19 01:51:41 UTC
FEDORA-2021-3036e7bf00 has been pushed to the Fedora 32 stable repository.
If problem still persists, please make note of it in this bug report.


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