Commit Graph

5299 Commits

Author SHA1 Message Date
Chris PeBenito
9e4d323462 Merge pull request #173 from fishilico/mount-fuse3 2020-02-01 14:36:23 -05:00
Chris PeBenito
8cf4002a34 Merge pull request #174 from gtrentalancia/master 2020-02-01 14:36:08 -05:00
Chris PeBenito
d7f3567e4d
Merge pull request #176 from dburgener/remove-unneeded-semicolons
Remove unneeded semicolons after interface and macro calls
2020-02-01 14:35:17 -05:00
Daniel Burgener
03d39a69a1 Remove unneeded semicolons after interface and macro calls
Signed-off-by: Daniel Burgener <dburgener@tresys.com>
2020-01-31 14:41:28 -05:00
Chris PeBenito
54147754d5
Merge pull request #175 from pebenito/perf-event-open
Add perf_event access vectors.
2020-01-29 14:33:15 -05:00
Chris PeBenito
624a63704c Add perf_event access vectors.
Added in Linux v5.5.

Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
2020-01-29 09:58:40 -05:00
Nicolas Iooss
a85ef68b2a
mount: label fusermount3 like fusermount
libfuse 3.0 renamed fusermount to fusermount3 in order to allow both
libfuse 2 and libfuse 3 to be installed together:
695e45a4de

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
2020-01-26 18:47:33 +01:00
Chris PeBenito
7e191b008e storage, systemd: Module version bump.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2020-01-25 14:55:31 -05:00
Chris PeBenito
d3f1e699c9 Merge pull request #149 from fishilico/systemd-logind-bootloader 2020-01-25 14:49:36 -05:00
Chris PeBenito
b00cb2e910 userdomain: Module version bump.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2020-01-25 14:32:50 -05:00
Chris PeBenito
fdb28ea98d Merge pull request #167 from gtrentalancia/master 2020-01-25 14:32:20 -05:00
Chris PeBenito
b3c1af9580 various: Module version bump.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2020-01-25 13:48:52 -05:00
Chris PeBenito
62c027fd39 Merge pull request #151 from bauen1/fix-xfce4-labels 2020-01-25 13:39:30 -05:00
Chris PeBenito
ad58326d7d Merge pull request #170 from Jarel1337/patch-1 2020-01-25 13:39:19 -05:00
Chris PeBenito
0a8fd613de Merge pull request #156 from fishilico/groupadd-dynamic-users 2020-01-25 13:38:53 -05:00
Chris PeBenito
b8cab95a97 Merge pull request #169 from gtrentalancia/pulseaudio-update 2020-01-25 13:37:30 -05:00
Chris PeBenito
5fd902dac4 Merge pull request #171 from fishilico/unconfined-role-wine 2020-01-25 13:36:31 -05:00
Chris PeBenito
a6576234c8 Merge pull request #166 from dburgener/remove-unused-requires 2020-01-25 13:34:34 -05:00
Nicolas Iooss
7558698ab1
usermanage: allow groupadd to lookup dynamic users from systemd
On a Debian 10 test virtual machine, when installing packages adds a
group, the following AVC occurs:

    type=USER_AVC msg=audit(1578863991.588:575): pid=381 uid=104
    auid=4294967295 ses=4294967295 subj=system_u:system_r:system_dbusd_t
    msg='avc:  denied  { send_msg } for msgtype=method_call
    interface=org.freedesktop.systemd1.Manager
    member=LookupDynamicUserByName dest=org.freedesktop.systemd1
    spid=13759 tpid=1 scontext=unconfined_u:unconfined_r:groupadd_t
    tcontext=system_u:system_r:init_t tclass=dbus permissive=1
    exe="/usr/bin/dbus-daemon" sauid=104 hostname=? addr=? terminal=?'

Allow groupadd to use nss-systemd, which calls DBUS method
LookupDynamicUserByName().

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
2020-01-25 16:43:18 +01:00
Nicolas Iooss
8426d24740
systemd: add an interface to use nss-systemd
systemd's Name Service Switch (NSS) module provides UNIX user and group
name resolution for dynamic users and groups allocated through options
such as DynamicUser= in systemd unit files, according to its man page,
https://github.com/systemd/systemd/blob/v244/man/nss-systemd.xml.

If systemd compiled without NOLEGACY, commit
24eccc3414
("nss-systemd,user-util: add a way how synthesizing "nobody" can be
turned off") implemented a way to tweak nss-systemd's behavior by
checking whether /etc/systemd/dont-synthesize-nobody exists. Allow this
access.

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
2020-01-25 16:43:17 +01:00
bauen1
c233f661a0
kernel/corecommands: fix the label of xfce4 helpers (on debian) 2020-01-25 16:34:47 +01:00
Nicolas Iooss
3e96715906
Associate role unconfined_r to wine_t
When an unconfined user runs wine, there is an issue because
wine_domtrans() causes a transition to unconfined_u:unconfined_r:wine_t
without unconfined_r being associated with wine_t:

    type=SELINUX_ERR msg=audit(1579963774.148:1047):
    op=security_compute_sid
    invalid_context="unconfined_u:unconfined_r:wine_t"
    scontext=unconfined_u:unconfined_r:wine_t
    tcontext=system_u:object_r:wine_exec_t tclass=process

This is fixed with "roleattribute unconfined_r wine_roles;", which is
provided by interface wine_run().

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
2020-01-25 16:34:07 +01:00
Vilgot Fredenberg
043cc4d644
Remove obsolete gentoo specific rule
Looking at all audit versions in gentoo (2.8.5 to 2.6.4) every single one of them has `var/log/audit` as a directory and not as a file.

Tested on gentoo.
2020-01-25 12:40:08 +01:00
Guido Trentalancia
eaaaa89208 Allow pulseaudio to watch generic device directories.
Signed-off-by: Guido Trentalancia <guido@trentalancia.com>
--
 policy/modules/apps/pulseaudio.te |    1 +
 1 file changed, 1 insertion(+)
2020-01-24 22:32:37 -08:00
Guido Trentalancia
e3dc006c41 Add an interface to allow watch permission on generic
device directories.

Signed-off-by: Guido Trentalancia <guido@trentalancia.com>
--
 policy/modules/kernel/devices.if |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
2020-01-24 22:31:24 -08:00
Guido Trentalancia
3415d17e7f Allow userdomain to read and write the wireless devices (for
example for querying their state, enabling and/or disabling
them using userspace tools such as "rfkill" from util-linux).

See also:
https://wireless.wiki.kernel.org/en/users/documentation/rfkill

Signed-off-by: Guido Trentalancia <guido@trentalancia.com>
---
 policy/modules/system/userdomain.if |    1 +
 1 file changed, 1 insertion(+)
2020-01-24 11:29:27 -08:00
Daniel Burgener
36c3a7903c Fix situations where require blocks in interfaces listed types not actually referenced by that interface
Signed-off-by: Daniel Burgener <dburgener@tresys.com>
2020-01-24 08:18:55 -05:00
Guido Trentalancia
0fecf1a39a Update the pulseaudio application module with a few user domain
file read and management permissions.

Signed-off-by: Guido Trentalancia <guido@trentalancia.com>
---
 policy/modules/apps/pulseaudio.te |    1 +
 1 file changed, 1 insertions(+)
2020-01-23 22:01:51 +01:00
Chris PeBenito
1037d2ac8e devices, files, kernel, init: Module version bump.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2020-01-17 11:27:22 -05:00
Chris PeBenito
1997786ce3 Merge pull request #160 from pebenito/init-mountpoint 2020-01-17 11:26:34 -05:00
Chris PeBenito
26175ff57d init: Revise systemd bind mounts.
Add interface similar to files_mountpoint() and add a conditional which
allows mount on non_security_file_type.

Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
2020-01-17 10:57:17 -05:00
Chris PeBenito
3e91c2264f various: Module version bump.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2020-01-17 10:50:13 -05:00
Chris PeBenito
6547682580 Merge pull request #155 from pebenito/initial-5-4-fixes 2020-01-17 10:49:41 -05:00
Chris PeBenito
adeb4b271d Merge pull request #162 from dburgener/fix-if-require-issues 2020-01-17 09:05:38 -05:00
Chris PeBenito
46f2e627e6 udev: Watch devices.
Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
2020-01-16 15:53:36 -05:00
Chris PeBenito
e2ac94d08d dbus: Add directory watches.
Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
2020-01-16 15:53:36 -05:00
Chris PeBenito
f064342f41 systemd: Add filesystem watches.
Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
2020-01-16 15:53:36 -05:00
Chris PeBenito
940d3b4cd7 unconfined: Add watch permission for files.
Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
2020-01-16 15:53:36 -05:00
Daniel Burgener
c57198a000 Remove uneeded types from interfaces where types were added 2020-01-16 15:32:09 -05:00
Daniel Burgener
70a1c1ede2 Add requires to interfaces that reference types or attributes without requiring them
Signed-off-by: Daniel Burgener <dburgener@tresys.com>
2020-01-16 09:59:56 -05:00
Chris PeBenito
f4dfd9e245 domain, snort: Module version bump.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2020-01-16 09:55:00 -05:00
Chris PeBenito
79066e932f Merge pull request #161 from stephensmalley/netlink 2020-01-16 09:54:06 -05:00
Stephen Smalley
5fd175fa45 Rename obsolete netlink_firewall_socket and netlink_ip6fw_socket classes
The implementation for NETLINK_FIREWALL and NETLINK_IP6_FW protocols
was removed from the kernel in commit
d16cf20e2f2f13411eece7f7fb72c17d141c4a84 ("netfilter: remove ip_queue
support") circa Linux 3.5.  Consequently, kernels >= 3.5 should never
perform permission checks on these classes although they remained
defined in the SELinux kernel classmap until the netlink classes
were updated by
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6c6d2e9bde1c1c87a7ead806f8f5e2181d41a652
circa Linux v4.2.

Removing these class definitions would break legacy userspace that relies
upon stable values for the userspace security class definitions since it
will perturb those values by removing classes that preceded them.  dbus-daemon
in particular is known to break if its dbus class changes at runtime,
which could occur upon a policy reload that removes these classes.
Fixing this requires ensuring that dbus-daemon looks up the appropriate
class value on each use or upon policy reload, via userspace interfaces
such as selinux_check_access(), string_to_security_class(), and/or
selinux_set_callback(SELINUX_CB_POLICYLOAD, ...) with a callback function
that remaps the class value if needed.  Other userspace policy enforcers
are believed to have been updated in recent versions but older versions
may break upon such a change.

Hence, this change renames these classes with obsolete_ prefixes and
removes all rules referencing them from refpolicy, thereby preserving
the class numbering for subsequent classes while making it clear that
these classses are no longer meaningful for modern kernels.

This change does however create a potential compatibility break for
kernels < 3.5, since the policy will cease to define the kernel class
names and therefore the kernel will handle permission checks on the
class based on the handle_unknown setting in policy.  For most
Linux distributions, this will default to allow and therefore avoid
breaking userspace but will fail open.  For kernels < 2.6.33 (i.e.
the dynamic class/perm discovery support), the presence of a class
in policy with the same number but a different name than the kernel
class will cause the policy load to fail entirely.

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2020-01-16 09:17:56 -05:00
Chris PeBenito
7af9eb3e91 various: Module version bump.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2020-01-15 10:42:45 -05:00
Chris PeBenito
ff2e9eb803 Merge pull request #159 from stephensmalley/unused 2020-01-15 10:40:39 -05:00
Chris PeBenito
44aee2e8b2
Merge pull request #158 from fishilico/vagrant-provision-dhclient-ip
Vagrant: allow VirtualBox provisionning to use dhclient and ip
2020-01-14 16:34:04 -05:00
Chris PeBenito
de1c0e8a8f
Merge pull request #157 from fishilico/vagrant-unconfined-ssh-login
Vagrantfile: allow unconfined and sysadm SSH login
2020-01-14 16:33:46 -05:00
Stephen Smalley
f4459adf32 access_vectors: remove flow_in and flow_out permissions from packet class
These permissions were never used upstream; they were only added to the
kernel's classmap when the peer class was added for consistency with
Fedora SELinux policies by:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f67f4f315f31e7907779adb3296fb6682e755342
and were removed from the
kernel's classmap in:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=47ac19ea429aee561f66e9cd05b908e8ffbc498a

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2020-01-14 13:42:05 -05:00
Stephen Smalley
8486b8aa83 access_vectors: Remove entrypoint and execute_no_trans from chr_file
entrypoint and execute_no_trans permissions are only ever checked by the
kernel to regular files.  They were added to the chr_file class when
execmod was added (which can be checked on chr_file) to ensure that it
was assigned the same value as for the file class, since the kernel code
always checked FILE__EXECMOD. However, the policy definitions are not
necessary since the kernel and policy values have been decoupled ever
since dynamic class/perm support was introduced and further with the
move of execmod to the common definitions, they were not even needed
in the kernel.

These were removed from the kernel's classmap by
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b424485abe2b16580a178b469917a7b6ee0c152a

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2020-01-14 13:42:05 -05:00
Stephen Smalley
161bda392e access_vectors: Remove unused permissions
Remove unused permission definitions from SELinux.
Many of these were only ever used in pre-mainline
versions of SELinux, prior to Linux 2.6.0.  Some of them
were used in the legacy network or compat_net=1 checks
that were disabled by default in Linux 2.6.18 and
fully removed in Linux 2.6.30.

The corresponding classmap declarations were removed from the
mainline kernel in:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=42a9699a9fa179c0054ea3cf5ad3cc67104a6162

Permissions never used in mainline Linux:
file swapon
filesystem transition
tcp_socket { connectto newconn acceptfrom }
node enforce_dest
unix_stream_socket { newconn acceptfrom }

Legacy network checks, removed in 2.6.30:
socket { recv_msg send_msg }
node { tcp_recv tcp_send udp_recv udp_send rawip_recv rawip_send dccp_recv dccp_send }
netif { tcp_recv tcp_send udp_recv udp_send rawip_recv rawip_send dccp_recv dccp_send }

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2020-01-14 13:41:50 -05:00