Commit Graph

62 Commits

Author SHA1 Message Date
Chris PeBenito f7286189b3 Add systemd units for core refpolicy services.
Only for services that already have a named init script.

Add rules to init_startstop_service(), with conditional arg until
all of refpolicy-contrib callers are updated.
2015-10-23 10:17:46 -04:00
Chris PeBenito 3639880cf6 Implement core systemd policy.
Significant contributions from the Tresys CLIP team.

Other changes from Laurent Bigonville.
2015-10-23 10:16:59 -04:00
Jason Zaman dd21231043 Add openrc support to init_startstop_service
Adds the openrc rules in ifdef distro_gentoo to transition
to run_init correctly.
2015-05-27 14:37:41 -04:00
Jason Zaman 3d174b0481 Introduce init_startstop_service interface
This is to be used where a role needs to start and stop a labeled
service. It centralizes all the rules for redhat < 6 sysvinit that
were used in the _admin interfaces. The rules for other inits will
be added later.
2015-05-22 14:01:22 -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
Nicolas Iooss 687b5d3391 Introduce init_search_run interface 2014-09-12 09:46:01 -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
Dominick Grift 2be58db792 Change behavior of init_run_daemon()
Callers on init_run_daemon() role and domain transition on all
init_script_file_type to system_r and initrc_t respectively.

The old behavior of role and domain transitioning on init daemon entry
files was causing problems with programs that can be run both by system
and session.

Signed-off-by: Dominick Grift <dominick.grift@gmail.com>
2014-01-16 14:42:00 -05:00
Chris PeBenito 5cb20b443e init: init_script_domain() allow system_r role the init script domain type
Manually apply patch from Dominick Grift.
2013-12-10 10:30:09 -05:00
Dominick Grift 32d6aac409 init: for a specified automatic role transition to work. the source role must be allowed to change manually to the target role
Signed-off-by: Dominick Grift <dominick.grift@gmail.com>
2013-12-10 10:29:48 -05:00
Dominick Grift da5f2acb27 init: create init_use_inherited_script_ptys() for tmpreaper (Debian)
Signed-off-by: Dominick Grift <dominick.grift@gmail.com>
2013-09-26 10:30:59 -04:00
Dominick Grift 79e1e4efb9 NSCD related changes in various policy modules
Use nscd_use instead of nscd_socket_use. This conditionally allows
nscd_shm_use

Remove the nscd_socket_use from ssh_keygen since it was redundant
already allowed by auth_use_nsswitch

Had to make some ssh_keysign_t rules unconditional else
nscd_use(ssh_keysign_t) would not build (nested booleans) but that does
not matter, the only actual domain transition to ssh_keysign_t is
conditional so the other unconditional ssh_keygen_t rules are
conditional in practice

Signed-off-by: Dominick Grift <dominick.grift@gmail.com>
2013-01-03 10:43:10 -05:00
Sven Vermeulen dc663fe40a Introduce init_daemon_run_dir transformation
Due to the introduction of /run, many init scripts need to create the daemon run
dirs (such as /run/udev for the udev init script). To simplify this, we
introduce the "daemonrundir" attribute to which initrc_t has the necessary
create_dirs_perms granted. Because it often needs to change the attributes or
ownership of the directories as well, we also grant the setattr rights on the
directory.

Then, when needed, the modules can call this interface while adding the name of
the directory. This will trigger a named file transition when initrc_t creates
this directory:
  init_daemon_run_dir(udev_var_run_t, "udev")
will trigger
  files_pid_filetrans(initrc_t, udev_var_run_t, dir, "udev")

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2012-08-29 08:45:17 -04:00
Chris PeBenito 4f24b1841c Add optional name for kernel and system filetrans interfaces. 2012-05-10 09:53:45 -04:00
Chris PeBenito 6cd8334d12 Whitespace fixes in portage and init. 2011-09-06 14:00:58 -04:00
Chris PeBenito ca4d39d31c Rename init_rc_exec() to init_exec_rc(). 2011-09-06 13:58:04 -04:00
Sven Vermeulen bce639cff4 Introduce rc_exec_t as file entry for initrc_t
Within Gentoo, the init system (openrc) uses a single binary (/sbin/rc)
for all its functions, be it executing init scripts, managing runlevels,
checking state, etc. This binary is not allowed to be labeled
initrc_exec_t as that would trigger domain transitions where this isn't
necessary (or even allowed).

A suggested solution is to use a separate type declaration for /sbin/rc
(rc_exec_t) which transitions where necessary.

This patch includes support for the /sbin/rc rc_exec_t type and declares
the init_rc_exec() interface which allows domains to execute the binary
without transitioning.

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-09-06 13:22:22 -04:00
Chris PeBenito 3979c6886f Fix init_system_domain() description, pointed out by Elia Pinto. 2011-04-27 10:42:47 -04:00
Chris PeBenito 756c96b541 Fix incorrect dependenices in init module interfaces (init_t as an attribute rather than type). 2011-01-31 14:08:11 -05:00
Chris PeBenito 7c4fbeba94 Fixes for samhain init_system_domain() usage. 2010-12-16 09:03:51 -05:00
Chris PeBenito 7a15ba8bae Whitespace fixes in init. 2010-12-15 14:50:28 -05:00
Chris PeBenito 8d387b3228 Rename init_search_script_key() to init_search_script_keys(). 2010-10-11 09:36:31 -04:00
Dominick Grift b21846594d su: wants to read inits script keyring.
Signed-off-by: Dominick Grift <domg472@gmail.com>
2010-10-11 09:30:54 -04:00
Dominick Grift 5718c0a59a shutdown: needs to connect to init with a unix stream socket.
Signed-off-by: Dominick Grift <domg472@gmail.com>
2010-10-07 12:38:07 -04:00
Dominick Grift a0546c9d1c System layer xml fixes.
Signed-off-by: Dominick Grift <domg472@gmail.com>
2010-08-05 09:25:55 -04:00
Chris PeBenito ddd786e404 Init patch from Dan Walsh. 2010-03-18 10:19:49 -04:00
Chris PeBenito 13f000d2ef Improve the documentation of:
init_script_file()
init_daemon_domain()
init_system_domain()
init_ranged_daemon_domain()
init_ranged_system_domain()
init_use_fds()
2010-02-25 16:00:58 -05:00
Chris PeBenito 2c05132062 Utmp fix from Gentoo. 2010-02-17 20:31:46 -05:00
Chris PeBenito e6d8fd1e50 additional cleanup for e877913. 2009-11-11 11:28:50 -05:00
Craig Grube e8779130bf adding puppet configuration management system
Signed-off-by: Craig Grube <Craig.Grube@cobham.com>
Signed-off-by: Chris PeBenito <cpebenito@tresys.com>
2009-11-11 08:37:16 -05:00
Chris PeBenito 3f67f722bb trunk: whitespace fixes 2009-06-26 14:40:13 +00:00
Chris PeBenito ff8f0a63f4 trunk: whitespace fixes in xml blocks. 2008-12-03 19:16:20 +00:00
Chris PeBenito 296273a719 trunk: merge UBAC. 2008-11-05 16:10:46 +00:00
Chris PeBenito 82d2775c92 trunk: more open perm fixes. 2008-10-20 16:10:42 +00:00
Chris PeBenito 88cf0a9c2b trunk: whitespace fix; collapse multiple blank lines into one. 2008-10-17 15:29:51 +00:00
Chris PeBenito 0b36a2146e trunk: Enable open permission checks policy capability. 2008-10-16 16:09:20 +00:00
Chris PeBenito 64c5b9975b trunk: add interface to transition to initrc_t on labeled init scripts. 2008-09-18 13:47:43 +00:00
Chris PeBenito 36095d11ce trunk: kudzu and mta patches from dan. 2008-09-12 14:18:20 +00:00
Chris PeBenito 6cc3f35635 trunk: first part of init script labeling support. 2008-08-29 19:00:02 +00:00
Chris PeBenito dc1920b218 trunk: Database labeled networking update from KaiGai Kohei. 2008-07-25 04:07:09 +00:00
Chris PeBenito 4459a7c086 trunk: update init_telinit() for upstart's datagram socket usage instead of pipe useage. 2008-07-15 15:33:51 +00:00
Chris PeBenito 3ece11804e trunk: fix init_ranged_system_domain range_transition object class, from james carter. 2007-10-29 22:09:53 +00:00
Chris PeBenito 350b6ab767 trunk: merge strict and targeted policies. merge shlib_t into lib_t. 2007-10-02 16:04:50 +00:00
Chris PeBenito 2d0c9cecaf trunk: several MLS enhancements. 2007-08-20 15:15:03 +00:00
Chris PeBenito d46cfe45cd trunk: add application module 2007-07-19 18:57:48 +00:00
Chris PeBenito 38d0cf1b8a trunk: long overdue cleanup from when range_transitions were only in the base module 2007-05-14 15:35:47 +00:00
Chris PeBenito d28e528b0d Fixes for RHEL4 from the CLIP project. 2007-04-27 15:08:15 +00:00
Chris PeBenito 8021cb4f63 Merge sbin_t and ls_exec_t into bin_t. 2007-03-23 23:24:59 +00:00