Commit Graph

1713 Commits

Author SHA1 Message Date
Chris PeBenito d3cca4f927 Add role attributes to update_modules in modutils. 2011-09-21 08:27:28 -04:00
Chris PeBenito a858f08e5b Add role attributes in iptables. 2011-09-21 08:27:24 -04:00
Chris PeBenito e3a043d18d Convert selinuxutil over to role attributes for semanage. 2011-09-21 08:26:58 -04:00
Chris PeBenito dfec2ce3a9 Opendkim self signal patch from Paul Howarth. 2011-09-20 10:17:22 -04:00
Chris PeBenito bf8592ee42 Module version bump and changelog for milter ports patch from Paul Howarth. 2011-09-20 09:49:48 -04:00
Paul Howarth d27a504b0e Add milter_port_t
Add a milter_port_t for use with inet sockets for communication
between milters and MTAs.

There are no defined ports with this type: admins are expected
to use semanage to specify the ports being used for milters.
2011-09-20 09:24:58 -04:00
Chris PeBenito 99a34d527e eparate portage fetch rules out of portage_run() and portage_domtrans() from Sven Vermeulen. 2011-09-14 12:48:13 -04:00
Chris PeBenito 370081cc60 Remove stray "A" from unconfined. 2011-09-14 12:46:56 -04:00
Sven Vermeulen 017b505110 Allow unconfined users to call portage features
The unconfined user is currently not allowed to call portage-related
functions. However, in a targeted system (with unconfined domains
enabled), users (including administrators) should be allowed to
transition to the portage domain.

We position the portage-related calls outside the "ifdef(distro_gentoo)"
as other distributions support Portage as well.

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-09-14 12:33:11 -04:00
Sven Vermeulen c94b5e3d18 Allow sysadm_t to call all portage related services
The system administrator (in sysadm_t) is the only "user" domain that is
allowed to call portage-related services. So it also gains the privilege
to execute portage tree management functions (and as such transition to
portage_fetch_t).

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-09-14 12:33:07 -04:00
Chris PeBenito a108d9db60 Enhance corenetwork network_port() macro to support ports that do not have a well defined port number, such as stunnel. 2011-09-14 12:17:22 -04:00
Chris PeBenito eb6591ff84 Opendkim support in dkim module from Paul Howarth. 2011-09-14 10:06:32 -04:00
Chris PeBenito 82ee50ac21 Wireshark updates from Sven Vermeulen. 2011-09-14 09:00:39 -04:00
Chris PeBenito 1c5dacd2c0 Change secure_mode_insmod to control sys_module capability rather than controlling domain transitions to insmod.
Based on a patch from Dan Walsh.
2011-09-13 14:45:14 -04:00
Chris PeBenito f718181930 Module version bump for semanage permissive mode feature support. 2011-09-13 12:43:37 -04:00
Sven Vermeulen f12ebf31e2 Support semanage permissive mode
The semanage application supports a "semanage permissive" feature,
allowing certain domains to be marked for running permissive (rather
than the entire system).

To support this feature, we introduce a semanage_var_lib_t type for the
location where semanage will keep its permissive_<domain>.* files, and
allow semanage_t to work with fifo_files (needed for the command to
work).

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-09-13 12:36:48 -04:00
Chris PeBenito b7e70f900f Add contrib submodule. 2011-09-09 10:26:58 -04:00
Chris PeBenito 09248fa0db Move modules to contrib submodule. 2011-09-09 10:10:03 -04:00
Chris PeBenito f07bc3f973 Module version and changelog for openrc and portage updates from Sven Vermeulen. 2011-09-06 14:02:12 -04:00
Chris PeBenito 6cd8334d12 Whitespace fixes in portage and init. 2011-09-06 14:00:58 -04:00
Chris PeBenito ad3ed86a72 Rearrange lines in portage.te. 2011-09-06 13:59:36 -04:00
Chris PeBenito ca4d39d31c Rename init_rc_exec() to init_exec_rc(). 2011-09-06 13:58:04 -04:00
Sven Vermeulen 9bcb813b57 Allow cron to execute portage commands
Many users use portage from within cron (for instance to update the
portage tree or even automatically update their system). As such, we
allow to run portage from the (system) cronjob domains.

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-09-06 13:23:14 -04:00
Sven Vermeulen 49f1631fc0 Allow portage to call gpg
We allow portage to call gpg. However, this requires that the location
where the trustdb is stored is marked as a read/write type. The default
location used within Gentoo is /etc/portage/gpg, which would lead to
portage_conf_t. However, this type should remain a read-only type.

As such, we introduce a type called portage_gpg_t for this location and
grant portage_fetch_t the necessary rights on this type.

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-09-06 13:23:07 -04:00
Sven Vermeulen 3274da931e Introduce gpg_exec interface
Some applications might want to execute gpg without requiring a
transition. A possible use case is to allow applications to validate
signatures (made by GnuPG). As long as the application doesn't need to
generate signatures itself and its trustdb is not marked as
gpg_secret_t, it suffices to grant it gpg_exec().

Note that it does require the application to have read/write rights in
the directory where the trustdb is stored (as gpg tries to generate lock
files where the trustdb file is located).

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-09-06 13:22:59 -04:00
Sven Vermeulen 356c704f4d Introduce portage_fetch_t as an application domain
Enhance portage_fetch_t from an application type to a domain. Introduce
the proper portage_fetch_exec_t and add the necessary privileges to the
domain definition to allow portage_fetch_t to be used by Portage
management utilities like layman and emerge-webrsync.

We enhance portage_domtrans() to include portage_fetch_t support.
Providing a different interface (portage_fetch_domtrans) is possible
too, but since every application and role that needs to deal with
portage needs to deal with the fetching as well, and vice versa, we keep
this in portage_domtrans.

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-09-06 13:22:52 -04:00
Sven Vermeulen 706d503e5b Allow the sysadm domain to execute rc
The /sbin/rc binary is used by the system administrator to manage
runlevels (add/delete), check runlevel state, etc. all which do not
require a transition to occur. Hence the /sbin/rc (now labeled
rc_exec_t) is allowed to be executed without transitioning.

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-09-06 13:22:44 -04:00
Sven Vermeulen c5cbefb892 Gentoo integrated run_init support re-executes rc
When an init script is launched, Gentoo's integrated run_init support
will re-execute /sbin/rc (an all-in-one binary) for various functions.
The run_init_t domain here should not be allowed to transition yet, so
we allow it to execute /sbin/rc without transitioning.

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-09-06 13:22:37 -04:00
Sven Vermeulen 032b62f2ed Allow gcc-config to execute rc
The gcc-config application uses some functions (from
/etc/init.d/functions.sh) which are simple wrappers on top of
/sbin/rc. Since this script is sourced and the functions executed
from within gcc_config_t, we allow gcc-config to execute /sbin/rc
without transitioning.

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-09-06 13:22:31 -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 74aaedde68 Whitespace fixes in rsync, samba, and mount. 2011-09-02 09:55:50 -04:00
Chris PeBenito c7c9e0e04d Whitespace fix in unprivuser. 2011-09-02 09:20:54 -04:00
Chris PeBenito 102f084d96 New git service features from Dominick Grift.
* git user sessions
* repositories on CIFS/NFS
* inetd service
2011-09-02 09:20:23 -04:00
Chris PeBenito ec70a331ff Corenetwork policy size optimization from Dan Walsh. 2011-08-26 09:03:25 -04:00
Chris PeBenito 697d0bbf4d Module version bump for puppet mount patch from Sven Vermeulen. 2011-08-25 07:57:06 -04:00
Sven Vermeulen 960b471754 Allow puppet to mount partitions
Puppet is a management utility to manage several dozens or even hundreds of
systems through a single application. Part of its job is to ensure that the
configuration and state of a system is as expected. Part of this is to ensure
that the proper mounts are available and, if not, mount them (or umount them).

This patch allows puppet_t to call mount.

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-08-25 07:56:28 -04:00
Chris PeBenito acf3f0e64d Fix typo in portage_dontaudit_use_fds. 2011-08-25 07:56:01 -04:00
Chris PeBenito 4a586153a1 Module version bump for load_policy dontaudit of leaked portage fds from Sven Vermeulen. 2011-08-25 07:46:26 -04:00
Chris PeBenito 7b4defd475 Move portage_dontaudit_use_fds() interface. 2011-08-25 07:45:08 -04:00
Chris PeBenito 8dc4e0f223 Whitespace fixes in selinuxutil. 2011-08-25 07:43:36 -04:00
Sven Vermeulen 5d77246f5f Do not audit the use of portage' filedescriptors from load_policy_t
During build and eventual activation of the base policy, the load_policy_t
domain attempts to use a portage file descriptor. However, this serves no
purpose (the loading is done correctly and everything is logged
appropriately).

Hence, we dontaudit this use.

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-08-25 07:42:34 -04:00
Sven Vermeulen 137f7366ee Introduce portage_dontaudit_use_fds
Support the interface to not audit portage_t:fd use (file descriptors, leaked
or not)

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-08-25 07:42:34 -04:00
Chris PeBenito 68bbbbdec6 Change pppd_can_insmod to a Boolean so tunables and Booleans are not mixed. 2011-08-25 07:34:08 -04:00
Chris PeBenito 66e03ec8b2 Module version bump for LDAPS patch. Move a line. 2011-08-24 09:38:58 -04:00
Sven Vermeulen 9a680874fe Support LDAPS for nsswitch-related network activity
Systems that use LDAPS (LDAP over SSL/TLS) for their sysnet_* activities
currently fail since these domains do not allow proper access to the random
devices (needed for SSL/TLS). This patch adds this privilege to
sysnet_use_ldap.

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-08-24 09:33:43 -04:00
Chris PeBenito 540bc2d3b2 Module version bump for courier-imapd patch from Sven Vermeulen. 2011-08-24 09:26:42 -04:00
Sven Vermeulen 5296cfcdb9 Update file contexts for courier to support courier-imap
The courier-imapd daemon is part of the courier package (and already supported
by the courier module in refpolicy), but uses a different location for its
configuration files (/etc/courier-imap) and persistent data
(/var/lib/courier-imap).

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-08-24 09:26:13 -04:00
Sven Vermeulen 32ed63a740 Fix zabbix_agentd context
The zabbix_agentd context was wrongfully set to the domain type instead of
the _exec_t type.

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-08-24 09:21:21 -04:00
Chris PeBenito 12904f9fe8 Module version bump for dhcp client patch from Sven Vermeulen. 2011-08-24 09:15:33 -04:00
Sven Vermeulen 4976982e85 Allow dhcp client to update kernel routing table plus context updates
This small patch updates the dhcpc_t (DHCP client domain) to allow updating the
kernel's routing tables (as that is a primary purpose of a DHCP client) as well
as interact with the kernel through the net_sysctls.

Also, one client (dhcpcd) uses /var/run/dhcpcd so add that in the file context
definition as well.

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-08-24 09:13:33 -04:00
Chris PeBenito 5802e169eb Module version bump for xfce bin file contexts patch from Sven Vermeulen. 2011-08-24 09:08:16 -04:00
Chris PeBenito a83b53041e Rearrange xfce corecommands fc entries. 2011-08-24 09:07:34 -04:00
Sven Vermeulen 7901eb059b Update file contexts for xfce4 helper applications
Many XFCE4 helper applications are located in /usr/lib locations. This patch
marks those helpers as bin_t.

Recursively marking the directories bin_t does not work properly as these
locations also contain actual libraries.

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-08-24 08:56:47 -04:00
Chris PeBenito 12c3e8bf71 Module version bump for nagios checkdisk patch from Sven Vermeulen. 2011-08-24 08:56:33 -04:00
Sven Vermeulen eb6e425304 Nagios' checkdisk plugin requires getattr on the mountpoint directories
Without the getattr privilege on the mountpoint directories, the checkdisk
plugin fails to capture the data unless nagios is reconfigured to directly
read the device files themselves.

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-08-24 08:55:41 -04:00
Chris PeBenito 003361c264 Module version bump for xtables-multi patch from Sven Vermeulen. 2011-08-24 08:55:00 -04:00
Sven Vermeulen 2ebb974006 ip6?tables-multi is combined in xtables-multi
Since april, the *-multi applications offered through iptables are combined
through a single binary called xtables-multi. The previous commands are now
symbolic links towards this application.

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-08-24 08:35:57 -04:00
Chris PeBenito f7a845fcca Module version bump for udp_socket listen dontaudit for all domains. 2011-08-23 08:29:03 -04:00
Chris PeBenito 78e65fb36c Module version bump for setfiles audit message patch from Roy Li. 2011-08-23 08:21:40 -04:00
Chris PeBenito 5d834aa7dd Whitespace fix in selinuxutil. 2011-08-23 08:21:40 -04:00
Roy.Li 0bd595020c Make setfiles be able to send audit messages.
When audit subsystem is enabled, and setfiles works from root
dir, setfiles would send the AUDIT_FS_RELABEL information to
audit system, If no permission to send the information to audit
by netlink, setfiles would return error.

The test cases to reproduce this defect:
	=> restorecon -R /
	=> echo $?
	255
	=>

Signed-off-by: Roy.Li <rongqing.li@windriver.com>
2011-08-23 08:21:40 -04:00
Chris PeBenito ec280b3209 Silence spurious udp_socket listen denials. 2011-08-23 08:21:40 -04:00
Chris PeBenito d3a85bbc0b Module version bump for zabbix patch from Sven Vermeulen. 2011-08-16 15:23:39 -04:00
Sven Vermeulen 0caefef811 Allow zabbix to connect to mysql through TCP
The mysql_stream_connect interface, which is already in use, is only for local
MySQL databases (not through TCP/IP).

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-08-16 15:23:11 -04:00
Chris PeBenito 8f8d3f7caf Module version bump for nagios NRPE patch from Sven Vermeulen. 2011-08-16 15:21:58 -04:00
Sven Vermeulen 8d238a8308 Nagios NRPE client should be able to read its own configuration file
Currently, the nagios nrpe_t definition has no read access to its own
nrpe_etc_t. I suspect this to be a copy/paste problem. Since the nrpe
configuration file is stored in /etc/nagios (nagios_etc_t), NRPE does need
search privileges in nagios_etc_t. This is easily accomplished through
read_files_pattern.

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-08-16 15:21:22 -04:00
Chris PeBenito 5f1189f0fe Module version bump for consolekit patch from Sven Vermeulen. 2011-08-16 15:21:01 -04:00
Sven Vermeulen 8365be4394 HAL support is not mandatory for ConsoleKit
The current consolekit policy definition has hal_ptrace(consolekit_t) in its
main body. However, HAL support within consolekit is not mandatory. As such,
this call should be within an optional_policy().

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-08-16 15:20:14 -04:00
Chris PeBenito 8b3c840804 Whitespace fix in unprivuser. 2011-07-29 08:50:24 -04:00
Chris PeBenito 81eefe7ce9 Type transition fix in Postgresql database objects from KaiGai Kohei. 2011-07-29 08:42:53 -04:00
Chris PeBenito aa4dad379b Module version bump for release. 2011-07-26 08:11:01 -04:00
Chris PeBenito 3cbc972771 Fix role declaration to handle new roleattribute requirements. 2011-07-25 12:10:05 -04:00
Chris PeBenito ee4bdf2959 Rename audioentropy module to entropyd due to haveged support. 2011-07-25 08:46:03 -04:00
Chris PeBenito 004e272212 Module version bump and changelog for haveged support from Sven Vermeulen. 2011-07-25 08:43:51 -04:00
Sven Vermeulen 7b84ef7aae Add file context rules for haveged
Add file context rules for haveged within the audioentropyd module.

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-07-25 08:38:45 -04:00
Sven Vermeulen 62cdea27c3 Update entropyd_t with privileges needed for haveged
Haveged by itself requires a few additional privileges (create a unix socket
and write access to some proc/sys/kernel files (like
/proc/sys/kernel/random/write_wakeup_threshold).

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-07-25 08:38:40 -04:00
Sven Vermeulen 34aea93484 Separate sound specific items frmo general entropyd
Introduce a tunable called "entropyd_use_audio". This boolean triggers the
privileges that are specific for audio support (both device access as well
as the alsa-specific ones).

The idea to use a boolean is to support other entropy management
applications/daemons which use different sources (like haveged using the
HAVEGE algorithm).

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-07-25 08:38:35 -04:00
Chris PeBenito 95995f5048 Module version bump for portage updates from Sven Vermeulen. 2011-07-22 08:36:33 -04:00
Chris PeBenito f2a85d7d04 Rearrange a few lines in portage. 2011-07-22 08:25:53 -04:00
Sven Vermeulen 204529101f Support proxy/cache servers
Portage supports the use of proxy systems (which usually run on port 8080)
for the fetching of software archives.

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-07-22 08:20:51 -04:00
Sven Vermeulen be42fbd8d4 Support live ebuilds through portage_srcrepo_t
Portage supports the notion of "live ebuilds", which are packages that, when
installed, update a repository checkout on a specific location. This means
that a few portage-related domains need to have manage_* privileges on that
location whereas they usually have much more limited rights (when live
ebuilds aren't used).

To support live ebuilds, we introduce another label called portage_srcrepo_t
for those specific locations where the "higher" privileges are needed for,
and grant the proper permissions on the compile domains (like
portage_sandbox_t) to manage the checkouts.

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-07-22 08:20:45 -04:00
Sven Vermeulen 77cefbf2b4 Support NFS mounts for portage related locations
When users want to use NFS mounted portage tree, distfiles, packages and
other locations, they need to use the proper context= mount option. However,
in the majority of cases, the users use a single NFS mount. In such
situation, context= cannot be used properly since it puts a label on the
entire mount (whereas we would then need other labels depending on
subdirectories).

Introducing a boolean "portage_use_nfs" which, when set (default off),
allows the necessary portage-related domains to manage files and directories
with the nfs_t label.

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-07-22 08:20:36 -04:00
Chris PeBenito 6e742c4c63 Module version bump for NFS over TCP patchset. 2011-07-22 07:18:13 -04:00
Sven Vermeulen bdc0c3985b Allow kernel to access NFS/RPC TCP
Allow kernel_t to access the nfsd_t' tcp_sockets.

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-07-22 07:03:51 -04:00
Sven Vermeulen 555cbbc5f5 Create interface for NFS/RPC TCP access
Create the rpc_tcp_rw_nfs_sockets() interface, allowing for the calling
domain to access the tcp_sockets managed by nfsd_t.

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-07-22 07:03:41 -04:00
Chris PeBenito b594647caf Fix missing requires in /var/run and /var/lock symlink patch. 2011-07-18 14:12:07 -04:00
Chris PeBenito a29c7b86e1 Module version bump and Changelog for auth file patches from Matthew Ife. 2011-07-18 13:48:05 -04:00
Chris PeBenito a4912ae653 Whitespace fix in authlogin.if. 2011-07-18 13:46:18 -04:00
Matthew Ife 4ff4e1c505 Replace deprecated *_except_shadow macro calls with *_except_auth_files calls. 2011-07-18 13:40:38 -04:00
Matthew Ife 61fb2009ad Create a new attribute for auth_file types. Add shadow as an auth_file type. Add new interfaces to manage auth_file types Deprecate *_except_shadow macros in favour of *_except_auth_files 2011-07-18 13:40:37 -04:00
Chris PeBenito e5745955f9 Udev fc for /var/run/udev from Martin Orr.
This is intended to label /run/udev, but I am assuming that everyone
will use file_contexts.subs(_dist)? to substitute /var/run for /run,
since there are currently no other fcs for /run in refpolicy.

The label is udev_tbl_t instead of udev_var_run_t, because /run/udev
contains the data which used to be in /dev/.udev.
2011-07-18 13:36:27 -04:00
Chris PeBenito edfe67fd15 Relocated /var/run and /var/lock from Martin Orr.
Add read_lnk_file_perms to all interfaces giving access to var_run_t and
var_lock_t.

This is needed as on Debian /var/run and /var/lock are now symlinks to
/run and /run/lock.
2011-07-18 13:33:22 -04:00
Chris PeBenito 23f9cd7b4c Module version bump for mozilla plugin bug fix from Harry Ciao. 2011-06-24 09:04:41 -04:00
Harry Ciao 321f22231e Fix the call to mozilla_run_plugin.
When mozilla_role interface is called, 1st argument is the caller's
role and 2nd argument is the caller's domain, such as:

   mozilla_role(staff_r, staff_t)

When mozilla_role calls mozilla_run_plugin, the passed 2nd argument
should be the caller's role rather than its domain, so $1 not $2 should
be used.

Signed-off-by: Harry Ciao <qingtao.cao@windriver.com>
2011-06-24 08:58:48 -04:00
Chris PeBenito ccf8bdea90 Add agent support to zabbix from Sven Vermeulen. 2011-06-15 14:11:14 -04:00
Chris PeBenito 6583208a2d Fix packet interfaces in zabbix.if. 2011-06-15 14:10:28 -04:00
Chris PeBenito 5759f004a7 Whitespace cleanup in zabbix. 2011-06-15 13:51:33 -04:00
Chris PeBenito cae953ff01 Rearrange lines in zabbix. 2011-06-15 13:51:22 -04:00
Chris PeBenito 2c59cf9cf9 Remove unnecessary comments in zabbix.te. 2011-06-15 13:47:08 -04:00
Sven Vermeulen b6b23abade Allow zabbix agent to query system state and other monitorable aspects
The zabbix agent is responsible for collecting the system state and other
monitorable aspects. This include
- information from /proc
- read attributes of various files (tamper detection)
- connect to the ssh service (check if it is reachable)
- get file system information
- read login information
- ...

It should be noted that the agent can do a lot more, depending on the target
system (what is being monitored) and the running services. The allowed
privileges here will in the future expand more as more templates are
checked.

Update: follow styleguide

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-06-15 13:41:15 -04:00
Sven Vermeulen d30069e4dc Allow zabbix server to connect to agent (active monitoring)
The zabbix server also connects to the agents (this is called "active
monitoring" in the zabbix terms). So we create a zabbix_agent_tcp_connect
interface, use it for the zabbix_t domain and, since zabbix can use
hostname-based connections, allow DNS resolving for the zabbix server.

Update: Follow styleguide

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-06-15 13:41:09 -04:00
Sven Vermeulen 80b95df00a Zabbix agent binds on its own port, connects to zabbix server
The zabbix agent has its own dedicated port (10050) on which it needs to
bind/listen.

Also, the agent connects to the server so we add the zabbix_tcp_connect
interface (shamelessly copied from mysql_tcp_connect) and use it for the
zabbix_agent_t domain.

Update: structure interface calls more closely to styleguide

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-06-15 13:41:03 -04:00
Sven Vermeulen 5b85c03633 Support different domain for zabbix agent (start with skeleton)
The zabbix agent should be confined within its own domain. We start with the
definition of a small(er) skeleton to work from. This includes proper file
context definitions, standard interdomain privileges (which are quite
similar to those of the server) and the proper log- and pid access
privileges.

Update: attempt to follow styleguide more closely

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-06-15 13:40:58 -04:00
Sven Vermeulen 5b17d3e7d6 Define zabbix port and allow server to listen/bind on it
The zabbix server uses a dedicated port (10051). We define it and allow the
zabbix server to bind/listen on it.

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-06-15 13:40:54 -04:00
Sven Vermeulen 1f1723e008 Support shared memory
On Mon, Jun 13, 2011 at 10:28:15AM +0200, Sven Vermeulen wrote:
> Zabbix servers use shared memory to keep common information and structures.
> This is implemented on tmpfs. We support this by introducing a
> zabbix_tmpfs_t type and allow the server proper access to it.

After a small discussion and a few more tests, drop the "dir" in
fs_tmpfs_filetrans.

For posterity's sake, this is the denial one gets when no tmpfs_t related
privileges are given:

Jun 13 11:24:06 build kernel: [  213.054230] type=1400
audit(1307957046.001:106): avc:  denied  { read write } for  pid=3162
comm="zabbix_agentd" path=2F535953563663303132323534202864656C6574656429
dev=tmpfs ino=32768 scontext=system_u:system_r:zabbix_agent_t
tcontext=system_u:object_r:tmpfs_t tclass=file

With fs_tmpfs_filetrans(..., file) the same denial is given, but as
tcontext=zabbix_tmpfs_t. Hence the rw_files_pattern() enhancement.

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-06-15 13:40:49 -04:00
Sven Vermeulen ae5814904e zabbix server spawns multiple processes
The zabbix server process is a multi-process system.

In order to, for instance, shut it down, signalling within the domain is
necessary. Otherwise, the processes remain running.

Also, since there are multiple processes trying to use the same log file,
the zabbix server uses semaphores to ensure proper access to the log files
(concurrency).

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-06-15 13:40:45 -04:00
Chris PeBenito b598c4421c Merge various apps layer changes from the Fedora policy. 2011-06-08 13:05:34 -04:00
Chris PeBenito 003dbe0c66 Cyrus file context update for Gentoo from Corentin Labbe. 2011-06-08 08:51:55 -04:00
Chris PeBenito 78b1d1182c Merge ncftool from Fedora. 2011-06-07 09:14:53 -04:00
Chris PeBenito 508df21fab Fix incorrect parameter in semanage call in likewise. 2011-05-25 08:30:54 -04:00
Chris PeBenito 8c3e30f913 Module version bump and changelog for Fedora modules. 2011-05-24 09:12:43 -04:00
Chris PeBenito af82a77675 Add zarafa from Fedora. 2011-05-24 09:11:56 -04:00
Chris PeBenito ef77678865 Move passenger to admin layer. 2011-05-20 10:29:20 -04:00
Chris PeBenito f5df601718 Add passenger from Fedora. 2011-05-20 10:27:47 -04:00
Chris PeBenito 0d62ce9373 Move mediawiki to services layer. 2011-05-20 10:20:28 -04:00
Chris PeBenito ffca31359c Add mediawiki from Fedora. 2011-05-20 10:17:12 -04:00
Chris PeBenito d2defd81e3 Add telepathy from Fedora. 2011-05-20 10:16:09 -04:00
Chris PeBenito 2e6db061ce Rename qpidd to qpid. 2011-05-20 09:32:13 -04:00
Chris PeBenito 10672e1e2a Add qpidd from Fedora. 2011-05-20 09:31:04 -04:00
Chris PeBenito 0895456538 Add vnstatd from Fedora. 2011-05-20 09:15:25 -04:00
Chris PeBenito 30e4a4eda1 Add bugzilla policy from Fedora. 2011-05-20 09:11:07 -04:00
Chris PeBenito 8630e36c5c Add mpd from Fedora. 2011-05-19 09:56:59 -04:00
Chris PeBenito f640bb3e0d Add colord from Fedora. 2011-05-19 09:56:44 -04:00
Chris PeBenito 953f031871 Add cmirrord from Fedora. 2011-05-19 09:14:25 -04:00
Chris PeBenito d90a1aab54 Add aiccu from Fedora. 2011-05-19 09:09:09 -04:00
Chris PeBenito 092db99e8e Module version bump for mozilla tmp type patch from Sven Vermeulen. 2011-05-04 09:17:06 -04:00
Chris PeBenito 4858b1b14d Remove mozilla_tmp_t aliases as it is a new type and requires no compatibility aliases. 2011-05-04 09:16:22 -04:00
Chris PeBenito 72b54e5f98 Rearrange mozilla tmp rules. 2011-05-04 09:15:28 -04:00
Sven Vermeulen f28f89acb8 Allow mozilla/firefox to manage tempfiles
On Wed, Mar 23, 2011 at 09:10:37AM -0400, Christopher J. PeBenito wrote:
> >  userdom_use_user_ptys(mozilla_t)
> > +userdom_manage_user_tmp_files(mozilla_t)
> > +userdom_manage_user_tmp_sockets(mozilla_t)
>
> Do you have more info on these?  Such as what files and sockets are
> being managed?

Not anymore apparently. Been running now for quite some time without these
privileges and I get no problems with it. Retry:

Mozilla/Firefox creates temporary files for its plugin support (for instance
while viewing flc streams), like /tmp/plugtmp/plugin-crossdomain.xml.

Update policy to allow it to create its own tmp type and perform a file
transition when creating a file or directory in a tmp_t location (like
/tmp).

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-05-04 09:14:26 -04:00
Chris PeBenito 8cd36efcd9 Module version bump for courier authdaemon /var/lib/courier/authdaemon dir creation. 2011-05-04 09:13:22 -04:00
Sven Vermeulen 8a58ccee23 Allow socket creation for imapd/pop3d communication
On Tue, Mar 22, 2011 at 08:44:49AM -0400, Christopher J. PeBenito wrote:
> > +manage_dirs_pattern(courier_authdaemon_t, courier_var_lib_t, courier_var_lib_t)
>
> It sounds like this should be create_dirs_pattern instead.

Indeed, create_dirs_pattern is sufficient here. Retry ;-)

During startup, authdaemon creates /var/lib/courier/authdaemon and creates a
socket for communication with courier imapd and pop3d daemons.

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-05-04 09:12:30 -04:00
Chris PeBenito d5048bc791 Module version bump for raid run interface. 2011-05-04 09:09:08 -04:00
Chris PeBenito c3a60ead61 Move raid_run_mdadm() interface. 2011-05-04 09:07:54 -04:00
Chris PeBenito ffc0b4f058 Whitespace fixes in raid.if. 2011-05-02 12:55:45 -04:00
Sven Vermeulen 681831da06 system admin needs to use mdadm, but type is not allowed
After a quick discussion with dominique, new attempt due to two issues:

1. No need (or even forbidden) to have "role $1 types foo_exec_t"
2. Suggestion to use the raid_run_mdadm name instead of raid_mdadm_role. The
   idea here is to use raid_mdadm_role for prefixed domains (cfr. screen)
   whereas raid_run_mdadm is to transition and run into a specific domain

Without wanting to (re?)start any discussion on prefixed versus non-prefixed
domains, such a naming convention could help us to keep the reference policy
cleaner (and naming conventions easy).

Also, refpolicy InterfaceNaming document only talks about run, not role.

So, without much further ado... ;-)

  The system administrator (sysadm_r role) needs to use mdadm, but is not
  allowed to use the mdadm_t type.

  Rather than extend raid_domtrans_mdadm to allow this as well, use a
  raid_mdadm_role (a bit more conform other role usages).

  The other users of raid_domtrans_mdadm are all domains that run in system_r
  role, which does have this type allowed (as per the system/raid.te
  definition), so it wouldn't hurt to use raid_domtrans_mdadm for this.

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-05-02 12:54:03 -04:00
Chris PeBenito 2983a08467 Module version bump and changelog for Portage updates from Sven Vermeulen. 2011-05-02 12:46:28 -04:00
Sven Vermeulen f13b563891 setfscreate privilege is needed to be able to install java-config package
During the installation of for instance java-config, Portage wants to set
its default file creation context to root:object_r:portage_tmp_t which isn't
allowed:

creating /var/tmp/portage/dev-java/java-config-2.1.11-r3/temp/images/3.1/etc/revdep-rebuild
copying src/revdep-rebuild/60-java -> /var/tmp/portage/dev-java/java-config-2.1.11-r3/temp/images/3.1/etc/revdep-rebuild/
running install_egg_info
Writing /var/tmp/portage/dev-java/java-config-2.1.11-r3/temp/images/3.1/usr/lib64/python3.1/site-packages/java_config-2.1.11-py3.1.egg-info
cp: failed to set default file creation context to `root:object_r:portage_tmp_t': Permission denied
cp: failed to set default file creation context to `root:object_r:portage_tmp_t': Permission denied
cp: failed to set default file creation context to `root:object_r:portage_tmp_t': Permission denied
cp: failed to set default file creation context to `root:object_r:portage_tmp_t': Permission denied
...
ERROR: dev-java/java-config-2.1.11-r3 failed:
   Merging of intermediate installation image for Python ABI '2.6 into installation image failed

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-05-02 11:41:17 -04:00
Sven Vermeulen fd9ec1f728 Allow portage_sandbox_t ptrace capabilities
During installation of system packages like python, ustr, ... the
portage_sandbox_t domain requires ptrace capabilities.

If not allowed, the following error is returned:

/sbin/ldconfig -n /var/tmp/portage/dev-libs/ustr-1.0.4-r1/image//usr/lib64
ISE:_do_ptrace ^[[0mptrace(PTRACE_TRACEME, ..., 0x0000000000000000, 0x0000000000000000): Permission denied
/usr/lib/libsandbox.so(+0x3812)[0x7535af0ca812]
/usr/lib/libsandbox.so(+0x38a3)[0x7535af0ca8a3]
/usr/lib/libsandbox.so(+0x5595)[0x7535af0cc595]
/usr/lib/libsandbox.so(+0x5a87)[0x7535af0cca87]
/usr/lib/libsandbox.so(+0x68de)[0x7535af0cd8de]
/usr/lib/libsandbox.so(execvp+0x6c)[0x7535af0ceb3c]
make(+0x1159e)[0x337b918159e]
make(+0x11eec)[0x337b9181eec]
make(+0x12b34)[0x337b9182b34]
make(+0x1e759)[0x337b918e759]
/proc/5977/cmdline: make -j4 install
DESTDIR=/var/tmp/portage/dev-libs/ustr-1.0.4-r1/image/ HIDE=
libdir=/usr/lib64 mandir=/usr/share/man SHRDIR=/usr/share/doc/ustr-1.0.4-r1
DOCSHRDIR=/usr/share/doc/ustr-1.0.4-r1

This seems to be during a standard "make install" of the package but part of
Portage' sandbox usage (above error for ustr, but packages like python exhibit
the same problem.)

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-05-02 11:31:46 -04:00
Sven Vermeulen 4061b06a4a Allow portage to set file capabilities, needed for installations like for wireshark
The installation of the wireshark package (and perhaps others) requires
portage setting file capabilities (through the setcap binary).

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2011-05-02 11:30:36 -04:00
Chris PeBenito 9ec9808df5 Pull in cgroup changes from Fedora policy, in particular to handle systemd usage. 2011-04-29 13:22:47 -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 cca4b7e619 Fix ring buffer rules capability2 usage. 2011-04-18 13:06:31 -04:00
Chris PeBenito 6835095671 Changelog and module version bump for postgresql selabel_lookup update from KaiGai Kohei. 2011-04-15 10:25:10 -04:00
Kohei Kaigai 90bbc401dc allow postgresql_t to read selabel files
The attached patch allows postgresql_t domain to read selabel definition files
(such as /etc/selinux/targeted/contexts/sepgsql_contexts).

The upcoming version (v9.1) uses selabel_lookup(3) to assign initial security context
of database objects, we need to allow this reference.

Thanks,
--
NEC Europe Ltd, SAP Global Competence Center
KaiGai Kohei <kohei.kaigai@eu.nec.com>
2011-04-15 10:16:30 -04:00
Chris PeBenito 127d617b31 Pull in some changes from Fedora policy system layer. 2011-04-14 11:36:56 -04:00
Chris PeBenito 5e8cdeab27 Rearrange and whitespace fix filesystem.fc. 2011-04-14 10:17:18 -04:00
Chris PeBenito e541d13ae5 Pull in additional kernel layer Fedora policy changes. 2011-04-14 10:05:56 -04:00
Chris PeBenito 2b5cb1ff64 Dovecot managesieve support from Mika Pfluger.
For using the dovecot managesieve daemon on the standard (RFC 5804) port,
dovecot needs corenet_tcp_bind_sieve_port.
2011-04-04 14:37:29 -04:00
Elia Pinto 52ddc47029 trunk: remove unnecessary semicolons after interface/template calls everywhere
Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
2011-04-04 13:32:02 -04:00
Chris PeBenito 1bc5de22c0 Start pulling in pieces of Fedora policy in system layer. 2011-03-31 13:29:59 -04:00