Commit Graph

341 Commits

Author SHA1 Message Date
bauen1 2e4ac459fa
modutils: allow init to execute kmod with nnp
Signed-off-by: bauen1 <j2468h@gmail.com>
2020-04-14 19:35:35 +02:00
Chris PeBenito 41963e7116 init, devicekit: Module version bump.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2020-04-09 10:12:38 -04:00
Topi Miettinen 8982ce5945
Don't allow creating regular files in /dev
Init, init scripts and udisks don't need to be able to create regular
files in /dev.

Thanks to Jarkko Sakkinen for the idea.

Signed-off-by: Topi Miettinen <toiwoton@gmail.com>
2020-04-07 23:03:16 +03:00
Chris PeBenito eff4494519 corecommands, init, lvm, systemd: Module version bump.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2020-04-01 13:15:28 -04:00
Chris PeBenito b2cc317a64 various: Module version bump.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2020-03-19 14:07:12 -04:00
Topi Miettinen bfb4e60edb
Make raw memory access tunable
Modern systems shouldn't need direct access to raw memory
devices (/dev/mem, /dev/kmem, /dev/mergemem, dev/oldmem, /dev/port)
anymore, so let's remove the access in most cases and make it tunable
in the rest.

Add dev_read_raw_memory_cond(), dev_write_raw_memory_cond() and
dev_wx_raw_memory_cond(), which are conditional to new boolean
allow_raw_memory_access.

Remove raw memory access for a few domains that should never have
needed it (colord_t, iscsid_t, mdamd_t, txtstat_t), should not need it
anymore (dmidecode_t, Debian devicekit_diskt_t, hald_t, hald_mac_t,
xserver_t) or the domains that should transition to different domain
for this (rpm_t, kudzu_t, dpkg_t).

Signed-off-by: Topi Miettinen <toiwoton@gmail.com>
2020-03-16 14:06:16 +02:00
Chris PeBenito b2f72e833b Bump module versions for release.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2020-02-29 16:54:39 -05:00
Chris PeBenito 0d4e919176 loadkeys, init, systemd, udev: Module version bump.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2020-02-11 13:13:20 -05:00
Chris PeBenito 61923c23d7 init, logging, systemd: Module version bump.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2020-02-08 09:40:51 -05:00
Sugar, David e1ccf0ce02 Allow systemd to getattr all files
Systemd has ConditionPath.*, ConditionFile.* and ConditionDir* which
are used to check various path/file/directory to control starting a
service.  But this requires getattr permissions on the types.
Example denials that fit the problem.

The first example is from lvm where accessing config file.

type=AVC msg=audit(1575427946.229:1624): avc:  denied  { getattr } for
pid=1 comm="systemd" path="/etc/lvm/lvm.conf" dev="dm-0" ino=51799
scontext=system_u:system_r:init_t:s0
tcontext=system_u:object_r:lvm_etc_t:s0 tclass=file permissive=0

This second example is from chronyd, but it is happening becuase I added
the conditional in a drop-in file.

type=AVC msg=audit(1575427959.882:1901): avc:  denied  { getattr } for
pid=1 comm="systemd" path="/etc/chrony.conf" dev="dm-0" ino=53824
scontext=system_u:system_r:init_t:s0
tcontext=system_u:object_r:chronyd_conf_t:s0 tclass=file permissive=1

v3 - rework to not use interface and allow getattr for all files

Signed-off-by: Dave Sugar <dsugar@tresys.com>
2020-02-08 09:38:25 -05: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 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 f064342f41 systemd: Add filesystem watches.
Signed-off-by: Chris PeBenito <chpebeni@linux.microsoft.com>
2020-01-16 15:53:36 -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
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
Chris PeBenito 335d9425c0 various: Module version bump. 2019-12-26 11:48:27 -05:00
Nicolas Iooss 50b9886061
init: allow systemd to mount over /dev/kmsg and /proc/kmsg
When spawning services such as systemd-timedated with systemd 244,
systemd now mounts an inaccessible directory on /dev/kmsg and
/proc/kmsg:

    type=AVC msg=audit(1576535711.579:363): avc:  denied  { mounton }
    for  pid=1497 comm="(imedated)"
    path="/run/systemd/unit-root/dev/kmsg" dev="devtmpfs" ino=9055
    scontext=system_u:system_r:init_t
    tcontext=system_u:object_r:kmsg_device_t tclass=chr_file
    permissive=1

    type=AVC msg=audit(1576535711.583:364): avc:  denied  { getattr }
    for  pid=1497 comm="(imedated)"
    path="/run/systemd/unit-root/proc/kmsg" dev="proc" ino=4026532027
    scontext=system_u:system_r:init_t
    tcontext=system_u:object_r:proc_kmsg_t tclass=file permissive=1

    type=AVC msg=audit(1576535711.589:365): avc:  denied  { mounton }
    for  pid=1497 comm="(imedated)"
    path="/run/systemd/unit-root/proc/kmsg" dev="proc" ino=4026532027
    scontext=system_u:system_r:init_t
    tcontext=system_u:object_r:proc_kmsg_t tclass=file permissive=1

Running "findmnt" in the resulting mount namespace shows:

    |-/dev         dev                             devtmpfs   rw,...
    | `-/dev/kmsg  run[/systemd/inaccessible/chr]  tmpfs      ro,...

    |-/proc        proc                            proc       rw,...
    | `-/proc/kmsg run[/systemd/inaccessible/reg]  tmpfs      ro,...

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
2019-12-22 17:29:58 +01:00
Chris PeBenito 04a83b9616 init: Module version bump. 2019-10-31 04:12:24 -04:00
Chris PeBenito 291f68a119 various: Module version bump.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2019-09-30 20:39:31 -04:00
Chris PeBenito d6c7154f1c Reorder declarations based on *_runtime_t renaming.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2019-09-30 20:02:43 -04:00
Chris PeBenito 69a403cd97 Rename *_var_run_t types to *_runtime_t.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2019-09-30 20:02:43 -04:00
Chris PeBenito 5d636c2d16 various: Module version bump.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2019-09-03 19:47:12 -04:00
Chris PeBenito 921eb37a97 rpm, selinux, sysadm, init: Module version bump.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2019-07-13 14:07:11 -04:00
Alexander Miroshnichenko 491ae9991a Add knot module
Add a SELinux Reference Policy module for the
Knot authoritative-only DNS server.

Signed-off-by: Alexander Miroshnichenko <alex@millerson.name>
2019-07-13 14:00:31 -04:00
Chris PeBenito 8c3893e427 Bump module versions for release.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2019-06-09 14:05:19 -04:00
Chris PeBenito 10784f3b33 various: Module version bump.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2019-06-09 13:37:51 -04:00
Chris PeBenito 5d345b79ee various: Module version bump.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2019-04-27 10:51:06 -04:00
Chris PeBenito da156aea1e systemd: Add initial policy for systemd --user.
This is just a start; it does not cover all uses.

Signed-off-by: Chris PeBenito <Christopher.PeBenito@microsoft.com>
2019-04-25 11:18:58 -04:00
Chris PeBenito e2e4094bd4 various: Module version bump
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2019-04-16 22:08:11 -04:00
Sugar, David a49163250f Add kernel_dgram_send() into logging_send_syslog_msg()
This patch is based on comments from previous a patch to
remove the many uses of kernel_dgram_send() and incorporate
it into logging_send_syslog_msg().

v2 - enclose in ifdef for redhat
v3 - rebase this patch on e41def136a

Signed-off-by: Dave Sugar <dsugar@tresys.com>
2019-04-16 20:51:55 -04:00
Chris PeBenito beb4a290b0 init: Module version bump. 2019-04-07 20:56:22 -04:00
Chris PeBenito df696a3254 kernel, init, systemd, udev: Module version bump.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2019-03-27 18:58:15 -04:00
Chris PeBenito 98c16077ba Merge pull request #37 from pebenito/master
Misc system fixes.

Remove use of kernel_unconfined() by systemd_nspawn and udev write to its own executable.
2019-03-27 18:57:39 -04:00
Chris PeBenito 4f6614ba7f ntp, init, lvm: Module version bump.
Signed-off-by: Chris PeBenito <pebenito@ieee.org>
2019-03-27 18:49:54 -04:00
Chris PeBenito e19f3d658c init: Remove duplicate setenforce rule for init scripts.
Signed-off-by: Chris PeBenito <Christopher.PeBenito@microsoft.com>
2019-03-20 10:10:23 -04:00
Chris PeBenito 98a7f0446d init, systemd, cdrecord: Module version bump. 2019-02-19 19:31:04 -08:00
Sugar, David 61d12f722d Allow init_t to read net_conf_t
init (systemd) needs to read /etc/hostname during boot
to retreive the hostname to apply to the system.

Feb 06 18:37:06 localhost.localdomain kernel: type=1400 audit(1549478223.842:3): avc:  denied  { read } for  pid=1 comm="systemd" name="hostname" dev="dm-1" ino=1262975 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:net_conf_t:s0 tclass=file permissive=0

Signed-off-by: Dave Sugar <dsugar@tresys.com>
2019-02-19 19:06:40 -08:00
Chris PeBenito 445cbed7c7 Bump module versions for release. 2019-02-01 15:03:42 -05:00
Chris PeBenito 30a46e5676 various: Module version bump. 2019-01-23 19:02:01 -05:00
Chris PeBenito e6a67f295c various: Module name bump. 2019-01-12 15:03:59 -05:00
Nicolas Iooss c3b588bc65
init: rename *_pid_* interfaces to use "runtime"
The name of these interfaces is clearer that way.

This comes from a suggestion from
https://lore.kernel.org/selinux-refpolicy/dedf3ce8-4e9f-2313-6799-bbc9dc3a8124@ieee.org/
2019-01-12 17:11:00 +01:00
Chris PeBenito 143ed2cc1b init, logging: Module version bump. 2019-01-10 20:26:36 -05:00
Chris PeBenito 85536c64e1 kernel, jabber, ntp, init, logging, systemd: Module version bump. 2019-01-09 19:36:41 -05:00
Russell Coker 9cb572bd02 mls stuff
Here are the patches I used last time I tried to get MLS going on Debian.
2019-01-09 19:20:35 -05:00
Chris PeBenito e8ba31557d various: Module version bump. 2019-01-06 14:11:08 -05:00
Chris PeBenito d6b46686cd many: Module version bumps for changes from Russell Coker. 2019-01-05 14:33:50 -05:00
Chris PeBenito e5ac999aab dbus, xserver, init, logging, modutils: Module version bump. 2018-12-11 17:59:31 -05:00
Chris PeBenito 35463351a0 clamav, ssh, init: Module version bump. 2018-10-27 15:10:10 -04:00
Chris PeBenito d301e83161 mozilla, devices, selinux, xserver, init, iptables: Module version bump. 2018-07-10 20:11:40 -04:00
Jason Zaman d53047dc58 Allow map xserver_misc_device_t for nvidia driver 2018-07-10 17:25:11 -04:00
Chris PeBenito 65e8f758ca Bump module versions for release. 2018-07-01 11:02:33 -04:00
Dave Sugar 2408d45a3d policy for systemd-update-done
systemd-update-done needs to be able to create /etc/.updated and /var/.updated

Jun  6 13:11:58 localhost systemd-update-done: Failed to create timestamp file /etc/.updated: Permission denied
Jun  6 13:11:58 localhost systemd-update-done: Failed to create timestamp file /var/.updated: Permission denied
Jun  6 13:11:58 localhost systemd: systemd-update-done.service: main process exited, code=exited, status=1/FAILURE
Jun  6 13:11:58 localhost systemd: Failed to start Update is Completed.
Jun  6 13:11:58 localhost systemd: Unit systemd-update-done.service entered failed state.
Jun  6 13:11:58 localhost systemd: systemd-update-done.service failed.

Signed-off-by: Dave Sugar <dsugar@tresys.com>
2018-06-07 20:16:48 -04:00
Chris PeBenito 6b0abaf880 init: Module version bump. 2018-05-02 17:22:52 -04:00
Jason Zaman 9219bde71e init: Add filetrans for /run/initctl
sysvinit 2.89 moved /dev/initctl to /run/initctl.

Reported-by: revel
2018-05-02 17:12:01 -04:00
Chris PeBenito ac9363d662 init, logging, sysnetwork, systemd, udev: Module version bump. 2018-04-17 20:20:27 -04:00
Dave Sugar ceec13419f Fix problems booting with fips=1
Seeing the following problem when booting in enforcing with FIPS mode enabled.
Request for unknown module key 'CentOS Linux kernel signing key: c757a9fbbd0d82c9e54052029a0908d17cf1adc7' err -13
Then seeing the system halt

Fixing the following denials:
[    4.492635] type=1400 audit(1523666552.903:4): avc:  denied  { search } for  pid=894 comm="systemd-journal" name="crypto" dev="proc" ino=6124 scontext=system_u:system_r:syslogd_t:s0 tcontext=system_u:object_r:sysctl_crypto_t:s0 tclass=dir
[    4.496621] type=1400 audit(1523666552.907:5): avc:  denied  { read } for  pid=894 comm="systemd-journal" name="fips_enabled" dev="proc" ino=6125 scontext=system_u:system_r:syslogd_t:s0 tcontext=system_u:object_r:sysctl_crypto_t:s0 tclass=file
[    4.499741] type=1400 audit(1523666552.910:6): avc:  denied  { open } for  pid=894 comm="systemd-journal" path="/proc/sys/crypto/fips_enabled" dev="proc" ino=6125 scontext=system_u:system_r:syslogd_t:s0 tcontext=system_u:object_r:sysctl_crypto_t:s0 tclass=file
[    4.502969] type=1400 audit(1523666552.914:7): avc:  denied  { getattr } for  pid=894 comm="systemd-journal" path="/proc/sys/crypto/fips_enabled" dev="proc" ino=6125 scontext=system_u:system_r:syslogd_t:s0 tcontext=system_u:object_r:sysctl_crypto_t:s0 tclass=file

[    4.950021] type=1400 audit(1523666553.360:8): avc:  denied  { search } for  pid=952 comm="systemctl" name="crypto" dev="proc" ino=6124 scontext=system_u:system_r:udev_t:s0-s0:c0.c1023 tcontext=system_u:object_r:sysctl_crypto_t:s0 tclass=dir
[    4.986551] type=1400 audit(1523666553.397:9): avc:  denied  { read } for  pid=952 comm="systemctl" name="fips_enabled" dev="proc" ino=6125 scontext=system_u:system_r:udev_t:s0-s0:c0.c1023 tcontext=system_u:object_r:sysctl_crypto_t:s0 tclass=file
[    5.028737] type=1400 audit(1523666553.439:10): avc:  denied  { open } for  pid=952 comm="systemctl" path="/proc/sys/crypto/fips_enabled" dev="proc" ino=6125 scontext=system_u:system_r:udev_t:s0-s0:c0.c1023 tcontext=system_u:object_r:sysctl_crypto_t:s0 tclass=file

type=1400 audit(1512501270.176:3): avc:  denied  { search } for  pid=1 comm="systemd" scontext=system_u:system_r:init_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=key

Signed-off-by: Dave Sugar <dsugar@tresys.com>
2018-04-17 20:14:50 -04:00
Chris PeBenito e75bcdead0 Module version bumps for patches from James Carter. 2018-04-12 18:49:46 -04:00
Chris PeBenito ed60abef70 corenetwork, init: Module version bump. 2018-03-21 14:17:22 -04:00
Christian Göttsche 7b6042b29c add definition of bpf class and systemd perms 2018-03-21 14:16:52 -04:00
Chris PeBenito b492924414 Misc dbus fixes from Russell Coker. 2018-02-15 17:07:08 -05:00
Chris PeBenito 4d5b06428b Bump module versions for release. 2018-01-14 14:08:09 -05:00
Chris PeBenito f9f721028c init: Module version bump. 2018-01-05 16:20:50 -05:00
Chris PeBenito ceb6c4811f init: Module version bump. 2017-12-10 14:45:35 -05:00
Chris PeBenito 6ca6a2e1db corcmd, fs, xserver, init, systemd, userdomain: Module version bump. 2017-12-03 16:48:54 -05:00
Chris PeBenito b333a7a1f8 filesystem: Rename fs_relabel_cgroup_lnk_files. 2017-12-02 16:19:07 -05:00
Krzysztof Nowicki 9b8c2d5393 Allow systemd to relabel cgroupfs legacy symlinks
The cgroup directory under /sys/fs/cgroup contains a number of
pseudo-filesystems for each cgroup as well as two symbolic links for the
cpu and cpuacct groups, which were legacy symbolic links to the
cpu,cpuacct group.

These rules allow systemd to relabel these symbolic links from tmpfs_t
to their proper context, or otherwise denials will be printed for nearly
all systemd operation involving cgroups.

This change only grants systemd the possibility to relabel the
files. The actual relabelling needs to be done by systemd. The
accompanying change (commit 8739f23) will be released with systemd v236.
2017-12-01 18:48:26 -05:00
Chris PeBenito 1b405f4a90 files, init, sysnetwork, systemd: Module version bumps. 2017-10-12 18:48:29 -04:00
Chris PeBenito 6128c262bb Merge branch 'systemd-networkd'
# Conflicts:
#	policy/modules/system/init.te
2017-10-12 18:40:15 -04:00
David Sugar 4a54f9c1f0 policy for systemd-networkd
Policy needed for systemd-networkd to function.  This is based on a patch from krzysztof.a.nowicki at gmail.com that was submitted back in May (I talked to him via email a while ago about me picking up the patch).  He was too busy to update and I needed to get it working.

I am pretty sure I updated everything mentioned in previous feedback, please comment if something is still off and I will revise.

Signed-off-by: Dave Sugar <dsugar@tresys.com>
2017-10-12 18:38:54 -04:00
David Sugar e7b4159ec5 Denial relabeling /run/systemd/private
I am seeing the following denial (in dmesg) during system startup:
[    4.623332] type=1400 audit(1507767947.042:3): avc:  denied  { relabelto } for  pid=1 comm="systemd" name="private" dev="tmpfs" ino=5865 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:init_var_run_t:s0 tclass=sock_file

It appears that systemd is attempting to relablel the socket file /run/systemd/private to init_var_run_t but doesn't have permission.

Updated to create new interface for relabeling of sock_files rather than adding to existing interface

Signed-off-by: Dave Sugar <dsugar@tresys.com>
2017-10-12 18:00:12 -04:00
Chris PeBenito 2fca8c8d95 init: Clean up line placement in init_systemd blocks.
No rule changes.
2017-10-12 17:42:23 -04:00
Chris PeBenito 2ae2b38e6d Module version bumps. 2017-10-10 20:32:43 -04:00
David Sugar 967ef00181 Fix problem labeling /run/log/journal/*
Fix the following denials I was seeing in dmesg from init_t (systemd) when attempting to relabel /run/log/journal/*

[    4.758398] type=1400 audit(1507601754.187:3): avc:  denied  { relabelto } for  pid=1 comm="systemd" name="log" dev="tmpfs" ino=1365 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:var_log_t:s0 tclass=dir
[    4.758541] systemd[1]: Unable to fix SELinux security context of /run/log: Permission denied
[    4.758736] type=1400 audit(1507601754.187:4): avc:  denied  { relabelto } for  pid=1 comm="systemd" name="journal" dev="tmpfs" ino=7004 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:systemd_journal_t:s0 tclass=dir
[    4.758773] systemd[1]: Unable to fix SELinux security context of /run/log/journal: Permission denied
[    4.758928] type=1400 audit(1507601754.187:5): avc:  denied  { relabelto } for  pid=1 comm="systemd" name="791393fb4b8f4a59af4266b634b218e2" dev="tmpfs" ino=7005 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:systemd_journal_t:s0 tclass=dir
[    4.758960] systemd[1]: Unable to fix SELinux security context of /run/log/journal/791393fb4b8f4a59af4266b634b218e2: Permission denied
[    4.759144] type=1400 audit(1507601754.187:6): avc:  denied  { relabelto } for  pid=1 comm="systemd" name="system.journal" dev="tmpfs" ino=7006 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:systemd_journal_t:s0 tclass=file
[    4.759196] systemd[1]: Unable to fix SELinux security context of /run/log/journal/791393fb4b8f4a59af4266b634b218e2/system.journal: Permission denied

Signed-off-by: Dave Sugar <dsugar@tresys.com>
2017-10-10 20:24:18 -04:00
Chris PeBenito f47c35d20c init: Module version bump. 2017-09-27 19:45:01 -04:00
Chris PeBenito eea649c0f4 init: Remove sm-notify.pid fc entry which collides with the rpc module. 2017-09-16 13:31:12 -04:00
Chris PeBenito 2ce0d06bbc Module version bumps. 2017-09-13 18:58:07 -04:00
Chris PeBenito 3548e3b3fe Module version bumps. 2017-09-12 20:16:35 -04:00
Chris PeBenito 095ad7923a Several module version bumps. 2017-09-11 20:34:13 -04:00
Chris PeBenito 7025086a9c terminal: Rename term_create_devpts. 2017-09-11 20:03:58 -04:00
Nicolas Iooss 60382e9e53 init: allow systemd to relabel /dev and /run
systemd relabels everything in /dev and /run after loading the policy.
In these directories there is a socket file for udev, /run/udev/control,
which is not allowed to be relabelled from tmpfs_t:

    avc:  denied  { relabelfrom } for  pid=1 comm="systemd"
    name="control" dev="tmpfs" ino=7027
    scontext=system_u:system_r:init_t tcontext=system_u:object_r:tmpfs_t
    tclass=sock_file permissive=1

    avc:  denied  { relabelto } for  pid=1 comm="systemd" name="control"
    dev="tmpfs" ino=7027 scontext=system_u:system_r:init_t
    tcontext=system_u:object_r:udev_var_run_t tclass=sock_file
    permissive=1

/run/tmpfiles.d directory (used by systemd-tmpfiles service) is also
relabelled.
2017-09-11 20:03:31 -04:00
Nicolas Iooss ae40418b24 init: allow systemd to create /dev/pts as devpts_t
This is currently denied:

     avc:  denied  { create } for  pid=1 comm="systemd" name="pts"
     scontext=system_u:system_r:init_t
     tcontext=system_u:object_r:devpts_t tclass=dir permissive=1
2017-09-11 20:03:31 -04:00
Chris PeBenito fc044b53fd init: Module version bump for patch from Dave Sugar. 2017-09-08 19:33:43 -04:00
Chris PeBenito 495e2c203b Remove complement and wildcard in allow rules.
Remove complement (~) and wildcard (*) in allow rules so that there are no
unintentional additions when new permissions are declared.

This patch does not add or remove permissions from any rules.
2017-08-13 16:21:44 -04:00
Chris PeBenito efa32d9b56 Remove deprecated interfaces older than one year old.
Additionally one deprecated attribute removed.
2017-08-06 17:03:17 -04:00
Chris PeBenito aa0eecf3e3 Bump module versions for release. 2017-08-05 12:59:42 -04:00
Chris PeBenito acac1fcf4e init: Add NoNewPerms support for systemd. 2017-08-05 12:22:05 -04:00
Chris PeBenito 6293813020 Module version bump for patches from cgzones. 2017-06-12 18:48:58 -04:00
Chris PeBenito 8902f93b9a Module version bump for systemd fix from Krzysztof Nowicki. 2017-05-15 18:48:51 -04:00
Chris PeBenito 895eefc207 init: add comment for ProtectSystem. 2017-05-15 18:42:18 -04:00
Krzysztof Nowicki 3b5e622339 Enable /etc directory protection using ProtectSystem
Setting this service option to 'full' or 'strict' will also remount the
/etc directory. Allow this in the policy.

This fixes the systemd-networkd service, but will also positively affect
any other service using the above hardening option.
2017-05-15 18:41:00 -04:00
Chris PeBenito a599f28196 Module version bump for /usr/bin fc fixes from Nicolas Iooss. 2017-05-04 08:27:46 -04:00
Chris PeBenito 8f5927ec7c Module version bump for minor fixes from Guido Trentalancia. 2017-05-01 18:45:01 -04:00
Guido Trentalancia 12743e949b init: smoother system boot
Improve the initrc domain within the init module with some permissions
needed for a smoother boot.

Let the iptables init scripts read the iptables configuration.

Signed-off-by: Guido Trentalancia <guido@trentalancia.net>
2017-05-01 18:41:50 -04:00
Chris PeBenito 878735f69f Module version bump for patches from Russell Coker and Guido Trentalancia. 2017-04-26 06:39:39 -04:00
Chris PeBenito 8f6f0cf0e2 Rename apm to acpi from Russell Coker.
This patch is slightly more involved than just running sed.  It also adds
typealias rules and doesn't change the FC entries.

The /dev/apm_bios device doesn't exist on modern systems.  I have left that
policy in for the moment on the principle of making one change per patch.  But
I might send another patch to remove that as it won't exist with modern
kernels.
2017-04-26 06:36:20 -04:00
Chris PeBenito 8527b86621 Further strict systemd fixes from Russell Coker. 2017-04-20 20:00:34 -04:00
Chris PeBenito 60114027f7 more systemd stuff from Russell Coker
This patch adds an interface to manage systemd_passwd_var_run_t symlinks that
I'll add another patch to use shortly.

It has a number of changes needed by systemd_logind_t to set permissions for
local logins.

It has some more permissions that systemd_machined_t needs, I don't think it's
everything that systemd_machined_t needs but it's a start.

It has some changes for udev_t for systemd-udevd.
2017-04-16 19:48:04 -04:00
Chris PeBenito 477d984415 systemd init from Russell Coker
This patch lets mandb_t search init_var_run_t dirs which it needs when running
with systems.  Also allows it to fs_getattr_xattr_fs() because it seemed
pointless to put that in a separate patch.

Allow init_t to do several things that it requires when init is systemd.

Allow various operations on var_log_t to access var_log_t symlinks too.

Let auditd setattr it's directory.
2017-04-16 19:08:40 -04:00
Chris PeBenito 73d8b3026c Systemd-related changes from Russell Coker. 2017-04-06 17:37:50 -04:00