Commit Graph

778 Commits

Author SHA1 Message Date
Chris PeBenito 0735f2ca4a Module version bump for misc fixes from Sven Vermeulen. 2014-12-02 10:29:59 -05:00
Sven Vermeulen 1edfad8247 Add /var/lib/racoon as runtime directory for ipsec 2014-12-02 09:16:06 -05:00
Sven Vermeulen 25b232f49a Add gfisk and efibootmgr as fsadm_exec_t 2014-12-02 09:16:05 -05:00
Sven Vermeulen f0ebf14176 Add auth_pid_filetrans_pam_var_run 2014-12-02 09:16:05 -05:00
Chris PeBenito 8a3a8c7e1b Module version bump for /sbin/iw support from Nicolas Iooss. 2014-10-23 08:51:53 -04:00
Chris PeBenito 0820cfe75d Add comment for iw generic netlink socket usage 2014-10-23 08:50:18 -04:00
Nicolas Iooss 5fb1249f37 Use create_netlink_socket_perms when allowing netlink socket creation
create_netlink_socket_perms is defined as:

    { create_socket_perms nlmsg_read nlmsg_write }

This means that it is redundant to allow create_socket_perms and
nlmsg_read/nlmsg_write.

Clean up things without allowing anything new.
2014-10-23 08:07:44 -04:00
Nicolas Iooss d6af57e5e7 Allow iw to create generic netlink sockets
iw uses generic netlink socket to configure WiFi properties.  For
example, "strace iw dev wlan0 set power_save on" outputs:

    socket(PF_NETLINK, SOCK_RAW|SOCK_CLOEXEC, NETLINK_GENERIC) = 3
    setsockopt(3, SOL_SOCKET, SO_SNDBUF, [32768], 4) = 0
    setsockopt(3, SOL_SOCKET, SO_RCVBUF, [32768], 4) = 0
    bind(3, {sa_family=AF_NETLINK, pid=7836, groups=00000000}, 12) = 0

Some AVC denials are reported in audit.log:

    type=AVC msg=audit(1408829044.820:486): avc:  denied  { create } for
    pid=5950 comm="iw" scontext=system_u:system_r:ifconfig_t
    tcontext=system_u:system_r:ifconfig_t tclass=netlink_socket
    permissive=1
    type=AVC msg=audit(1408829044.820:487): avc:  denied  { setopt } for
    pid=5950 comm="iw" scontext=system_u:system_r:ifconfig_t
    tcontext=system_u:system_r:ifconfig_t tclass=netlink_socket
    permissive=1
    type=AVC msg=audit(1408829044.820:488): avc:  denied  { bind } for
    pid=5950 comm="iw" scontext=system_u:system_r:ifconfig_t
    tcontext=system_u:system_r:ifconfig_t tclass=netlink_socket
    permissive=1
    type=AVC msg=audit(1408829044.820:489): avc:  denied  { getattr }
    for  pid=5950 comm="iw" scontext=system_u:system_r:ifconfig_t
    tcontext=system_u:system_r:ifconfig_t tclass=netlink_socket
    permissive=1
    type=AVC msg=audit(1408829044.820:490): avc:  denied  { write } for
    pid=5950 comm="iw" scontext=system_u:system_r:ifconfig_t
    tcontext=system_u:system_r:ifconfig_t tclass=netlink_socket
    permissive=1

Allowing ifconfig_t to create generic netlink sockets fixes this.

(On a side note, the AVC denials were caused by TLP, a tool which
applies "laptop configuration" when switching between AC and battery
with the help of a udev script)
2014-10-23 08:07:44 -04:00
Nicolas Iooss f91e07baa9 Label /sbin/iw as ifconfig_exec_t
iw manpage says "iw - show / manipulate wireless devices and their
configuration".  Label this command ifconfig_exec_t to allow it to
manage wireless communication devices.

Debian installs iw in /sbin/iw, Fedora in /usr/sbin/iw and Arch Linux in
/usr/bin/iw (with /usr/sbin being a symlink to /usr/bin).
2014-10-23 08:07:44 -04:00
Nicolas Iooss 836a282439 Fix minor typo in init.if 2014-10-04 10:53:50 +02:00
Chris PeBenito 6624f9cf7a Drop RHEL4 and RHEL5 support. 2014-09-24 13:10:37 -04:00
Chris PeBenito 35860e6459 Module version bump for CIL fixes from Yuli Khodorkovskiy. 2014-09-17 14:00:08 -04:00
Yuli Khodorkovskiy 330b0fc333 Remove duplicate role declarations
-This patch is needed since CIL does not allow duplicate
role declarations. The roles for system_r, staff_r, sysadm_r, and
user_r were already declared in kernel.te. Since the roles are
pulled in from require statements in the appropriate interfaces,
the duplicate role declarations could be deleted in modules for
auditadm, staff, sysadm, and userdomain.

-Move a role declaration that used an argument passed into the
userdom_base_user_template into a gen_require statement.
2014-09-17 10:44:04 -04:00
Chris PeBenito 47fa454784 /dev/log symlinks are not labeled devlog_t.
Drop rule; if /dev/log is a symlink, it should be device_t.
2014-09-12 14:25:01 -04:00
Chris PeBenito e4cbb09a3d Module version bumps for systemd/journald patches from Nicolas Iooss. 2014-09-12 11:30:05 -04:00
Nicolas Iooss 0cd1ea9596 Remove redundant Gentoo-specific term_append_unallocated_ttys(syslogd_t)
Since commit 0fd9dc55, logging.te contains:

  term_write_all_user_ttys(syslogd_t)

As "write" is a superset of "append", this rule is no longer needed:

    term_append_unallocated_ttys(syslogd_t)

While at it, add a comment which explains why
term_dontaudit_setattr_unallocated_ttys is needed.
2014-09-12 09:55:58 -04:00
Nicolas Iooss 6a201e405b Allow journald to access to the state of all processes
When a process sends a syslog message to journald, journald records
information such as command, executable, cgroup, etc.:
http://cgit.freedesktop.org/systemd/systemd/tree/src/journal/journald-server.c?id=v215#n589

This needs domain_read_all_domains_state.
2014-09-12 09:55:13 -04:00
Chris PeBenito 6ced8116bd Add comment for journald ring buffer reading. 2014-09-12 09:54:11 -04:00
Nicolas Iooss 3a7e30c22d Allow journald to read the kernel ring buffer and to use /dev/kmsg
audit.log shows that journald needs to read the kernel read buffer:

    avc:  denied  { syslog_read } for  pid=147 comm="systemd-journal" scontext=system_u:system_r:syslogd_t tcontext=system_u:system_r:kernel_t tclass=system permissive=1

Moreover journald uses RW access to /dev/kmsg, according to its code:
http://cgit.freedesktop.org/systemd/systemd/tree/src/journal/journald-kmsg.c?id=v215#n394
2014-09-12 09:52:18 -04:00
Nicolas Iooss ae4d07c8a8 Support logging with /run/systemd/journal/dev-log
In June 2014 systemd moved the socket used by journald to /run.  This
requires two new directory search access for every domain sending syslog
messages:

* /run/systemd/ (handled by init_search_run)
* /run/systemd/journal/ (labeled syslogd_var_run_t)

systemd commit:
http://cgit.freedesktop.org/systemd/systemd/commit/units/systemd-journald-dev-log.socket?id=03ee5c38cb0da193dd08733fb4c0c2809cee6a99
2014-09-12 09:50:48 -04:00
Chris PeBenito a30feb2a5b Whitespace change in logging.fc. 2014-09-12 09:49:37 -04:00
Nicolas Iooss d7b2ccf89a Label systemd-journald files and directories 2014-09-12 09:47:59 -04:00
Nicolas Iooss 687b5d3391 Introduce init_search_run interface 2014-09-12 09:46:01 -04:00
Chris PeBenito 8cfe827a3d Move systemd fc entry. 2014-09-12 09:42:59 -04:00
Nicolas Iooss dcca3e977b Label systemd files in init module 2014-09-12 09:41:25 -04:00
Chris PeBenito 4451a6c497 Module version bump for FUSE fix for mount from Luis Ressel. 2014-08-21 09:53:51 -04:00
Luis Ressel 6c9f445e55 Grant mount permission to access /dev/fuse
This is needed for mounting FUSE-based filesystems like ntfs-3g.
2014-08-21 08:27:02 -04:00
Chris PeBenito 617466b2bd Module version bump for losetup fixes from Luis Ressel. 2014-08-19 08:45:38 -04:00
Chris PeBenito 503f2749e0 Move losetup addition in fstools. 2014-08-19 08:44:57 -04:00
Luis Ressel 9946965a53 Add neccessary permissions for losetup
This allows losetup to bind mount_loopback_t files to loop devices.
2014-08-18 15:24:46 -04:00
Luis Ressel d18b43bae7 system/fstools.if: Add fstools_use_fds interface 2014-08-18 15:24:46 -04:00
Luis Ressel 0aa6f5b644 system/mount.if: Add mount_rw_loopback_files interface 2014-08-18 15:24:46 -04:00
Chris PeBenito daa6ad17ad Module version bump for fstools fc entries from Luis Ressel. 2014-08-14 15:47:55 -04:00
Luis Ressel b6dcb211f0 Label /usr/sbin/{add, del}part as fsadm_exec_t
These are seldomly-used tools from the util-linux package.

Please check if they are located in /sbin instead of /usr/sbin on other
distributions.

Signed-off-by: Luis Ressel <aranea@aixah.de>
2014-08-14 15:41:40 -04:00
Luis Ressel 9f538c1697 Some of the fsadm tools can also be in /usr/sbin instead of /sbin
Signed-off-by: Luis Ressel <aranea@aixah.de>
2014-08-14 15:41:40 -04:00
Chris PeBenito 81d9239296 Module version bump for libraries fc fix from Nicolas Iooss. 2014-07-08 08:53:06 -04:00
Nicolas Iooss 74ec2d61b2 Label /lib symlink as lib_t for every distro
As in Debian, Gentoo and Arch Linux /lib may be a symlink, move its file
context definition outside of ifdef blocks.
2014-07-08 08:49:37 -04:00
Chris PeBenito 491683b3e2 Module version bump for init_daemon_pid_file from Sven Vermeulen. 2014-06-30 14:34:51 -04:00
Sven Vermeulen 4a94489be7 Use init_daemon_pid_file instead of init_daemon_run_dir
Update non-contrib modules to use init_daemon_pid_file instead of
init_daemon_run_dir.

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2014-06-26 08:34:27 -04:00
Sven Vermeulen 3cea6ac6b6 Deprecate init_daemon_run_dir interface
With init_daemon_pid_file supporting class parameters, all calls to
init_daemon_run_dir can now be transformed into init_daemon_pid_file
calls.

Update the init_daemon_run_dir interface so it gives a warning when
used, and use the init_daemon_pid_file interface underlyingly.

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2014-06-26 08:34:27 -04:00
Sven Vermeulen d64826b606 Support initrc_t generated pid files with file transition
For some daemons, it is the init script that is responsible for creating
the PID file of the daemon. As we do not want to update the init SELinux
policy module for each of these situations, we need to introduce an
interface that can be called by the SELinux policy module of the caller
(the daemon domain).

The initial suggestion was to transform the init_daemon_run_dir
interface, which offers a similar approach for directories in /run, into
a class-agnostic interface. Several names have been suggested, such as
init_script_spec_run_content or init_script_generic_run_filetrans_spec,
but in the end init_daemon_pid_file was used.

The interface requires the class(es) on which the file transition should
occur, like so:

  init_daemon_pid_file(xdm_var_run_t, dir, "xdm")
  init_daemon_pid_file(postgresql_var_run_t, file, "postgresql.pid")

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2014-06-26 08:34:26 -04:00
Chris PeBenito 13b837fc15 Module version bump for unconfined syslog cap from Nicolas Iooss. 2014-06-09 09:29:12 -04:00
Nicolas Iooss 4067a18530 Allow unconfined domains to use syslog capability
When an unconfined_t root user runs dmesg, the kernel complains with
this message in its logs (when SELinux is in enforcing mode):

  dmesg (16289): Attempt to access syslog with CAP_SYS_ADMIN but no
  CAP_SYSLOG (deprecated).

audit.log contains following AVC:

  avc:  denied  { syslog } for  pid=16289 comm="dmesg" capability=34
  scontext=unconfined_u:unconfined_r:unconfined_t
  tcontext=unconfined_u:unconfined_r:unconfined_t tclass=capability2
2014-06-09 09:28:33 -04:00
Elia Pinto a55da23db2 Fix misspelling
Fix misspelling using  http://github.com/lyda/misspell-check

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
2014-06-09 08:21:45 -04:00
Chris PeBenito d580aae38f Module version bump for shutdown transitions from Luis Ressel. 2014-06-09 08:21:33 -04:00
Luis Ressel f6352c317b Allow init to execute shutdown
In many inittabs, there's a line like
"ca:12345:ctrlaltdel:/sbin/shutdown -h now" which triggers a shutdown or
a reboot on Ctrl+Alt+Del.
2014-06-09 08:15:57 -04:00
Chris PeBenito 342498065e Module version bump for deprecated interface usage removal from Nicolas Iooss. 2014-05-27 09:23:29 -04:00
Nicolas Iooss 40c155f732 No longer use deprecated MLS interfaces
Since commit 2d0c9cec mls_file_read_up and mls_file_write_down
interfaces are deprecated even though they are still present.

Replace mls_file_read_up with mls_file_read_all_levels and
mls_file_write_down with mls_file_write_all_levels.
2014-05-27 09:08:36 -04:00
Chris PeBenito 84f2b380cf Module version bump for ifconfig fc entry from Sven Vermeulen. 2014-05-27 09:08:12 -04:00
Sven Vermeulen bb3d41826b ifconfig can also be in /bin
Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2014-05-27 08:53:55 -04:00