The FDP team is no longer accepting new bugs in Bugzilla. Please report your issues under FDP project in Jira. Thanks.
Bug 2054323 - OVS IPsec daemon - permission denied by sellinux
Summary: OVS IPsec daemon - permission denied by sellinux
Keywords:
Status: CLOSED DUPLICATE of bug 2042911
Alias: None
Product: Red Hat Enterprise Linux Fast Datapath
Classification: Red Hat
Component: openvswitch-selinux-extra-policy
Version: FDP 22.L
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: ---
Assignee: Aaron Conole
QA Contact: Jean-Tsung Hsiao
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-02-14 17:10 UTC by Harel Braha
Modified: 2024-11-24 13:26 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-03-11 16:51:59 UTC
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)
audit.log (847.77 KB, text/plain)
2022-02-14 17:10 UTC, Harel Braha
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker FD-1786 0 None None None 2022-02-21 13:02:21 UTC

Description Harel Braha 2022-02-14 17:10:46 UTC
Created attachment 1861023 [details]
audit.log

Description of problem:

Selinux blocks the ipsec deamon from accessing /etc/ipsec.conf. 

How reproducible:
every time

Steps to Reproduce:
1. run ovirt-host-deploy playbook 
failure when invokes
ovirt-provider-ovn-driver role - configure.yml - task : "Configure OVN for oVirt".

Actual results:

journalctl -xeu openvswitch-ipsec.service
ovs|  2  | ovs-monitor-ipsec | ERR | traceback
Traceback (most recent call last):
File "/usr/share/openvswitch/scripts/ovs-monitor-ipsec", line 12>
 main()
 File "/usr/share/openvswitch/scripts/ovs-monitor-ipsec", line 12>
 monitor = IPsecMonitor(root_prefix, args.ike_daemon,
 File "/usr/share/openvswitch/scripts/ovs-monitor-ipsec", line 98>
 self.ike_helper.restart_ike_daemon()
 File "/usr/share/openvswitch/scripts/ovs-monitor-ipsec", line 46>
f = open(self.IPSEC_CONF, "w")
 PermissionError: [Errno 13] Permission denied: '/etc/ipsec.conf'

Expected results:
no errors

Additional info:
attached audit.log

Comment 1 Zdenek Pytela 2022-02-21 12:55:06 UTC
Switching the component to openswitch to be assessed and possibly addressed there - I am not completely sure about the openvswitch-selinux-extra-policy status.

Do you think these permissions requests are reasonable?
For those which are, should they be a part of openvswitch-selinux-extra-policy or selinux-policy?

Please ignore the lldpad-related denials.

Comment 2 Mike Pattrick 2022-03-10 16:57:25 UTC
I see the following block, which appears related:

type=AVC msg=audit(1644857302.735:2071): avc:  denied  { write } for  pid=7057 comm="ovs-monitor-ips" name="ipsec.conf" dev="vda10" ino=1786537 scontext=system_u:system_r:openvswitch_t:s0 tcontext=system_u:object_r:ipsec_conf_file_t:s0 tclass=file permissive=0

The OVS selinux policy is supposed to add:

allow openvswitch_t ipsec_conf_file_t:file { getattr ioctl open read write };

Which would allow this action. Can you confirm which version of openvswitch-selinux-extra-policy is installed?

Comment 3 Ales Musil 2022-03-11 06:22:25 UTC
I can see openvswitch-selinux-extra-policy-1.0-30.el9s.noarch on the host.

Comment 4 Mike Pattrick 2022-03-11 16:47:06 UTC
Thank you for that.

I installed the 1.0.30 rpm on RHEL9 and confirmed that it wasn't working, I got the following error when trying to load it:

# semodule -i  /usr/share/selinux/packages/openvswitch-custom.pp
Failed to resolve allow statement at /var/lib/selinux/targeted/tmp/modules/400/openvswitch-custom/cil:74
Failed to resolve AST
semodule:  Failed!

I then compiled 1.0.30 from source code myself and it seemed to work fine. Finally, I tried the most recent release, which is 1.0.31, and it also worked.

For now, I recommend upgrading to 1.0.31, which can be downloaded from here: http://download.eng.bos.redhat.com/brewroot/vol/rhel-9/packages/openvswitch-selinux-extra-policy/1.0/31.el9fdp/noarch/openvswitch-selinux-extra-policy-1.0-31.el9fdp.noarch.rpm

I'll look into why the 1.0.30 package had this issue.

Comment 5 Mike Pattrick 2022-03-11 16:51:59 UTC

*** This bug has been marked as a duplicate of bug 2042911 ***


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