summaryrefslogtreecommitdiff
path: root/selinux/openvswitch-custom.te.in
Commit message (Collapse)AuthorAgeFilesLines
* selinux: Add missing permissions for ovs-kmod-ctl.Yi-Hung Wei2020-09-161-0/+2
| | | | | | | | | | | | | | | | | | | | | | | On RHEL 8, a SELinux policy is missing when ovs-kmod-ctl use modprobe to load kernel modules. This patch adds the missing permissions based on /var/log/audit/audit.log Example log of the AVC violations: type=AVC msg=audit(1599075387.136:65): avc: denied { read } for pid=1472 comm="modprobe" name="modules.alias.bin" dev="dm-0" ino=586629 scontext=system_u:system_r:openvswitch_load_module_t:s0 tcontext=system_u:object_r:modules_dep_t:s0 tclass=file permissive=0 type=AVC msg=audit(1599085253.148:45): avc: denied { open } for pid=1355 comm="modprobe" path="/usr/lib/modules/4.18.0-193.el8.x86_64/modules.dep.bin" dev="dm-0" ino=624258 scontext=system_u:system_r:openvswitch_load_module_t:s0 tcontext=unconfined_u:object_r:modules_dep_t:s0 tclass=file permissive=0 VMWare-BZ: #2633569 Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com> Acked-by: Greg Rose <gvrose8192@gmail.com> Acked-by: Ansis Atteka <aatteka@ovn.org> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
* selinux: update for netlink socket typesAaron Conole2019-04-211-0/+8
| | | | | | | | These are used for interfacing with conntrack, as well as by some DPDK PMDs Signed-off-by: Aaron Conole <aconole@redhat.com> Acked-by: Ansis Atteka <aatteka@ovn.org>
* selinux: Add missing permissions for ovs-kmod-ctlYi-Hung Wei2019-01-181-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Starting from OVS 2.10, ovs-vswitchd may fail to run after system reboot since it fails to load ovs kernel module. It is because the conntrack zone limit feature introduced in OVS 2.10 now depends on nf_conntrack_ipv4/6 kernel module, and the SELinux prevents it to load the two kernel modules. Example log of the AVC violations: type=AVC msg=audit(1546903594.735:29): avc: denied { execute_no_trans } for pid=820 comm="modprobe" path="/usr/bin/bash" dev="dm-0" ino=50337111 scontext=system_u:system_r:openvswitch_load_module_t:s0 tcontext=system_u:object_r:shell_exec_t:s0 tclass=file type=AVC msg=audit(1546903594.791:30): avc: denied { module_request } for pid=819 comm="modprobe" kmod="nf_conntrack-2" scontext=system_u:system_r:openvswitch_load_module_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=system This patch adds the missing permissions for modprobe command in ovs-kmod-ctl so that the aforementioned issue is resolved. VMWare-BZ: #2257534 Acked-by: Aaron Conole <aconole@redhat.com> Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
* selinux: more changes to support newer hugetlbfs restrictionsTimothy Redaelli2018-07-311-1/+1
| | | | | | | | | | The new 'map' action is needed for 'hugetlbfs_t:file' too. CC: Aaron Conole <aconole@redhat.com> Fixes: d2675a146130 ("selinux: changes to support newer hugetlbfs restrictions") Signed-off-by: Timothy Redaelli <tredaelli@redhat.com> Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Aaron Conole <aconole@redhat.com>
* selinux: changes to support newer hugetlbfs restrictionsAaron Conole2018-07-291-3/+6
| | | | | | | | | | | | | | | Newer selinux base policies now split out 'map' actions, as well as adding more explicit checks for hugetlbfs objects. Where previously these weren't required, recent changes have flagged the allocation of hugepages and subsequent clearing. This means that the hugepage storage information for the DPDK .rte_config, and clearing actions copying from /dev/zero will trigger selinux denials. This commit allows openvswitch to have more permissions for the hugetlbfs allocation and use. Signed-off-by: Aaron Conole <aconole@redhat.com> Acked-by: Ansis Atteka <aatteka@ovn.org>
* selinux: tag the custom policy versionAaron Conole2018-06-171-1/+3
| | | | | | | | | | | Since the policy is an intermediate file, it can inherit the policy module version from release version. Also include an SPDX identifier. Suggested-by: Ansis Atteka <aatteka@ovn.org> Acked-by: Ansis Atteka <aatteka@ovn.org> Signed-off-by: Aaron Conole <aconole@redhat.com>
* selinux: allow openvswitch_t net_broadcast and net_rawAaron Conole2018-06-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | The ovs-vswitchd daemon requires both CAP_NET_RAW and CAP_NET_BROADCAST, but these are generally policy prevented by selinux. This allows these capabilities to be retained by the openvswitch_t domain. example: type=AVC msg=audit(1527876508.109:3043): avc: denied { net_broadcast } for pid=5368 comm="ovs-vswitchd" capability=11 scontext=system_u:system_r:openvswitch_t:s0 tcontext=system_u:system_r:openvswitch_t:s0 tclass=capability permissive=0 type=AVC msg=audit(1527876508.109:3043): avc: denied { net_raw } for pid=5368 comm="ovs-vswitchd" capability=11 scontext=system_u:system_r:openvswitch_t:s0 tcontext=system_u:system_r:openvswitch_t:s0 tclass=capability permissive=0 Acked-by: Ansis Atteka <aatteka@ovn.org> Signed-off-by: Aaron Conole <aconole@redhat.com>
* selinux: create a transition type for module loadingAaron Conole2018-06-171-5/+78
| | | | | | | | | | | | | | | Defines a type 'openvswitch_load_module_t' used exclusively for loading modules. This means that the 'openvswitch_t' domain won't require access to the module loading facility - such access can only happen after transitioning through the 'openvswitch_load_module_exec_t' transition context. A future commit will instruct the selinux policy on how to label the appropriate script with extended attributes to make use of this new domain. Acked-by: Ansis Atteka <aatteka@ovn.org> Acked-by: Timothy Redaelli <tredaelli@redhat.com> Signed-off-by: Aaron Conole <aconole@redhat.com>
* selinux: include the svirt_t typeAaron Conole2018-02-271-0/+1
| | | | | | | | | | | | The dpdk policy adds support for interacting with libvirt, but failed to include the appropriate svirt_t type. This results in an error like: openvswitch-custom.te:53:ERROR 'unknown type svirt_t' at token ';' on line 1060: Reported-by: Guoshuai Li <ligs@dtdream.com> Signed-off-by: Aaron Conole <aconole@redhat.com> Acked-by: Ansis Atteka <aatteka@ovn.org>
* selinux: allow dpdkvhostuserclient sockets with newer libvirtAaron Conole2018-02-231-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | Newer libvirt and openstack versions will now label the unix socket as an `svirt_tmpfs_t` object. This means that in order to support deploying with the recommended configuration (using a dpdkvhostuserclient socket), additional permissions need to be installed as part of the selinux policy. An example of some of the AVC violations: type=AVC msg=audit(1518752799.102:978): avc: denied { write } for pid=14368 comm="ovs-vswitchd" name="vhost0" dev="dm-0" ino=94 scontext=system_u:system_r:openvswitch_t:s0 tcontext=system_u:object_r:svirt_tmp_t:s0 tclass=sock_file type=AVC msg=audit(1518816172.126:1318): avc: denied { connectto } for pid=32717 comm="ovs-vswitchd" path="/tmp/vhost0" scontext=system_u:system_r:openvswitch_t:s0 tcontext=system_u:system_r:svirt_t:s0:c106,c530 tclass=unix_stream_socket Signed-off-by: Aaron Conole <aconole@redhat.com> Acked-by: Ansis Atteka <aatteka@ovn.org>
* selinux: move chr_file to non-dpdk as wellAaron Conole2017-09-011-1/+1
| | | | | | | | | | | | A last-minute change to the selinux policy caught by testing incorrectly omitted moving a definition from non-dpdk to dpdk. This moves the chr_file definition to a non-dpdk enabled permission, which should allow non-dpdk enabled builds to work. Fixes: 84d272330506 ("selinux: update policy to reflect non-root and dpdk support") Signed-off-by: Aaron Conole <aconole@redhat.com> Acked-by: Ansis Atteka <aatteka@ovn.org>
* selinux: update policy to reflect non-root and dpdk supportAaron Conole2017-08-311-1/+39
| | | | | | | | | | | | The selinux policy that exists in the repository did not specify access to all of the resources needed for Open vSwitch to properly function with an enforcing selinux policy. This update allows Open vSwitch to operate with selinux set to Enforcing mode, even while running as a non-root user. Acked-by: Flavio Leitner <fbl@sysclose.org> Acked-by: Ansis Atteka <aatteka@ovn.org> Signed-off-by: Aaron Conole <aconole@redhat.com> Tested-by: Jean Hsiao <jhsiao@redhat.com>
* rhel: make the selinux policy intermediateAaron Conole2017-08-311-0/+16
This will be used by an upcoming commit to have @begin_ and @end_ dpdk blocks to keep dpdk specific policy decisions only active when dpdk is used. Acked-by: Flavio Leitner <fbl@sysclose.org> Acked-by: Ansis Atteka <aatteka@ovn.org> Signed-off-by: Aaron Conole <aconole@redhat.com> Tested-by: Jean Hsiao <jhsiao@redhat.com>