Commit Graph

124 Commits

Author SHA1 Message Date
Chris PeBenito 05fef195bc Merge branch 'modutils_module' of git://github.com/cgzones/refpolicy 2017-03-05 09:11:54 -05:00
cgzones 4b79a54b41 modutils: adopt callers to new interfaces 2017-03-03 12:28:17 +01:00
cgzones 1f1e2474d8 improve documentation for user_user_(inherited_)?user_terminals 2017-02-27 18:17:10 +01:00
Chris PeBenito 2087bde934 Systemd fixes from Russell Coker. 2017-02-23 20:03:23 -05:00
Chris PeBenito 53fb3a3ba4 dpkg: Updates from Russell Coker. 2017-02-19 16:13:14 -05:00
Chris PeBenito 1720e109a3 Sort capabilities permissions from Russell Coker. 2017-02-15 18:47:33 -05:00
Guido Trentalancia f5988ced5f userdomain: separate optional conditionals for gnome and wm role templates
Since the window managers are not limited by gnome-shell, the
userdomain module is modified by this patch in order to use
separate optional conditionals for the gnome and wm role templates.

Signed-off-by: Guido Trentalancia <guido@trentalancia.net>
2016-12-17 08:15:18 -05:00
cgzones d8cb498284 remove trailing whitespaces 2016-12-06 13:45:13 +01:00
cgzones 901a905cbb update policy/support macros
- add systemd service macro sets
- add some documentation
- add some recursion to some macro sets (ipv perm, object class sets)
- deprecate domain_trans and domain_auto_trans
- remove unpriv_socket_class_set
2016-12-01 19:38:14 +01:00
Guido Trentalancia via refpolicy bf5f1853f3 Let unprivileged users list mounted filesystems
Let unprivileged users list filesystems mounted on mount points such
as /mnt (cdrom, FAT, NTFS and so on).

This makes a great difference to the usability and effectiveness of
graphical filesystem browsers such as Gnome Nautilus and currently
comes at no security penalty because mounted filesystems can be
listed with programs such as the "df" program from GNU coreutils or
by simply reading /proc/mounts.

Signed-off-by: Guido Trentalancia <guido@trentalancia.net>
2016-10-30 14:25:07 -04:00
Guido Trentalancia via refpolicy c23fe5c298 Let users read/manage symlinks on fs that do not support xattr
Let unprivileged and administrative users read symbolic links on
filesystems that do not support extended attributes (xattr) such
as cdroms, FAT, NTFS and so on.

Signed-off-by: Guido Trentalancia <guido@trentalancia.net>
2016-10-30 14:24:52 -04:00
Chris PeBenito 048f67d525 Additional change from Guido Trentalancia related to evolution. 2016-09-08 19:17:31 -04:00
Guido Trentalancia f9c83f65d7 userdomain: introduce the user certificate file context (was miscfiles: introduce the user certificate file context)
Introduce a new file context for user certificates (user_cert_t)
located in home directories.

Introduce new auxiliary interfaces to read and manage such files
files and directories.

Thanks to Christopher PeBenito for the useful suggestions that
led to this improved version of the patch.

Compared to the previous version, this patch adds the ability to
search the user home directories in the new interfaces.

Signed-off-by: Guido Trentalancia <guido@trentalancia.net>
2016-09-08 19:06:57 -04:00
Chris PeBenito 0b978fe777 userdomain: Move enable_mls block in userdom_common_user_template(). 2016-09-07 17:51:42 -04:00
Guido Trentalancia 39e550f9ee Improve tunable support for rw operations on noxattr fs / removable media
Improve the existing user domain template policy:

- better support for the "user_rw_noexattrfile" boolean (enable
  write operations on filesystems that do not support extended
  attributes, such as FAT or cdrom filesystem);
- add support for a new "user_exec_noexattrfile" boolean to
  control the execution of files from filesystems that do not
  support extended attributes (potentially dangerous);
- add support for a new "user_write_removable" boolean which
  enables write operations on removable devices (such as
  external removable USB memory, USB mobile phones, etc).

Note that devices might be removable but support extended
attributes (Linux xattr filesystems on external USB mass storage
devices), so two separate booleans are needed for optimal
configuration flexibility.

Writing to removable mass storage devices is a major cause of
leakage of confidential information, so the new boolean defaults
to false.

Disable raw access for MLS policies (thanks to Christoper
PeBenito for suggesting this).

This new version of the patch correctly includes the definitions
of the new booleans (by including the .te file differences).

Signed-off-by: Guido Trentalancia <guido@trentalancia.net>
2016-09-07 17:43:16 -04:00
Chris PeBenito c213c71cce userdomain: Fix compile errors. 2016-08-14 16:08:12 -04:00
Chris PeBenito 9e0566104a Update alsa module use from Guido Trentalancia. 2016-08-14 14:34:19 -04:00
Chris PeBenito 2bfcba6624 Allow the system user domains to chat over dbus with a few other
domains (e.g. gnome session).

Thanks to Jason Zaman for pointing out the correct interface to
achieve this.

This new version fixes a typographic error in the previous version.

Signed-off-by: Guido Trentalancia <guido@trentalancia.net>
2016-08-14 14:12:50 -04:00
Russell Coker 6f7d03bd34 user_udp_server tunable
The following patch adds a tunable user_udp_server for the user domains to
run UDP services.
2016-08-02 19:44:16 -04:00
Jason Zaman 89d07b3266 userdomain: introduce interfaces for user runtime 2016-06-01 13:22:39 -04:00
Jason Zaman cff5a53cde userdomain: user_tmp requires searching /run/user 2016-06-01 13:22:39 -04:00
Dominick Grift 6232348be8 Update refpolicy to handle hwloc
The Portable Hardware Locality (hwloc) software package provides a
portable abstraction (across OS, versions, architectures, ...) of the
hierarchical topology of modern architectures, including NUMA memory
nodes, sockets, shared caches, cores and simultaneous multithreading. It
also gathers various system attributes such as cache and memory
information as well as the locality of I/O devices such as network
interfaces, InfiniBand HCAs or GPUs.

Following changes enable:
- add interface to change dirs in /var/run
- add optional policies for hwloc-dump-hwdata

V3:
Remove files_rw_pid_dirs()
Call hwloc_admin(sysadm_t) instead of hwloc_manage_runtime(sysadm_t)
Adjust calls to renamed hwloc dhwd run and exec interfaces

Signed-off-by: Dominick Grift <dac.override@gmail.com>
2016-05-02 08:22:58 -04:00
Nicolas Iooss c82a479ed8 Fix interface descriptions when duplicate ones are found
Distinct interfaces should have different comments
2016-01-19 00:17:34 +01: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
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
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
Nicolas Iooss 27f4846ff8 userdomain: no longer allow unprivileged users to read kernel symbols
Unprivileged users don't need to read kallsyms and /boot/System.map.

This allow rule was introduced in the initial revision of userdomain.if in
2005, with commit b16c6b8c32a631a2e66265f6f60b664222760972:

    # cjp: why?
    bootloader_read_kernel_symbol_table($1_t)
2014-04-04 15:52:17 -04:00
Dominick Grift 8e01054f07 users: calls pulseaudio_role() for restricted xwindows users and staff_t/user_t
Signed-off-by: Dominick Grift <dominick.grift@gmail.com>
2013-12-06 08:48:09 -05:00
Chris PeBenito 3b52b87615 Rearrage userdom_delete_user_tmpfs_files() interface. 2013-12-03 09:45:16 -05:00
Dominick Grift b0068ace7d userdomain: add userdom_delete_user_tmpfs_files() for pulseaudio clients
Signed-off-by: Dominick Grift <dominick.grift@gmail.com>
2013-12-03 09:43:51 -05:00
Dominick Grift 3b0eefcc9e userdomain: restricted xwindows user (squash me)
Signed-off-by: Dominick Grift <dominick.grift@gmail.com>
2013-09-26 09:28:55 -04:00
Chris PeBenito 8e122068e4 Fix bug in userdom_delete_all_user_home_content_files() from Kohei KaiGai. 2013-02-25 11:26:13 -05:00
Dominick Grift 8b3ffb9663 Changes to the userdomain policy module
Make sure various virt user home content gets created with a type
transition and proper file contexts for common users

Signed-off-by: Dominick Grift <dominick.grift@gmail.com>
2013-01-03 10:43:10 -05:00
Dominick Grift 9706f6a477 Create a attribute user_home_content_type and assign it to all types that are classified userdom_user_home_content()
Create various interfaces using the user_home_content_type attribute for
tmpreaper

user_home_t, user_tmp_t and user_tmpfs_t are user_home_content_type
(why?) We should probably also create user_tmp_content_type and
user_tmpfs_content_type attributes and assign to userdom_tmp_file and
userdom_tmpfs_file respectively

Signed-off-by: Dominick Grift <dominick.grift@gmail.com>
2012-11-26 11:25:08 -05:00
Chris PeBenito f80bd12603 Rearrange lines. 2012-10-31 10:52:36 -04:00
Dominick Grift de7b3815c9 Changes to the user domain policy module
Content that (at least) common users need to be able to relabel and
create with a type transition

Signed-off-by: Dominick Grift <dominick.grift@gmail.com>
2012-10-31 10:51:34 -04:00
Dominick Grift 83d28d8a52 Changes to the user domain policy module
gnome_role is deprecated, use gnome_role_template instead
depends on dbus because of gkeyringd

Signed-off-by: Dominick Grift <dominick.grift@gmail.com>
2012-10-30 15:39:20 -04:00
Dominick Grift 0805dd800c Changes to various policy modules
pcscd_read_pub_files is deprecated use pcscd_read_pid_files instead

Signed-off-by: Dominick Grift <dominick.grift@gmail.com>
2012-10-19 08:59:22 -04:00
Dominick Grift c667fa4a7d Changes to the userdomain policy module
Remove evolution and evolution alarm dbus chat from common user template
since callers of the evolution role are now allowed to dbus chat to
evolution and evolution alarm.

Common users need to be able to dbus chat with policykit and consolekit

Signed-off-by: Dominick Grift <dominick.grift@gmail.com>
2012-10-09 10:25:29 -04:00
Dominick Grift 1dc2705388 Restricted Xwindows user domains run windows managers in the windows managers domain
Signed-off-by: Dominick Grift <dominick.grift@gmail.com>
2012-10-09 10:03:34 -04:00
Chris PeBenito 4f24b1841c Add optional name for kernel and system filetrans interfaces. 2012-05-10 09:53:45 -04:00
James Carter 624e73955d Changed non-contrib policy to use the new non_auth_file_type interfaces
Replaced calls to interfaces allowing access to all files except
auth_file_type files with calls to interfaces allowing access to
non_auth_file_type files.

Signed-off-by: James Carter <jwcart2@tycho.nsa.gov>
2012-05-04 08:47:49 -04:00
Chris PeBenito e2fa4f2e8c Add user application, tmp and tmpfs file interfaces. 2011-10-28 08:48:10 -04:00
Chris PeBenito 3cbc972771 Fix role declaration to handle new roleattribute requirements. 2011-07-25 12:10:05 -04:00
Matthew Ife 4ff4e1c505 Replace deprecated *_except_shadow macro calls with *_except_auth_files calls. 2011-07-18 13:40:38 -04:00
Chris PeBenito b598c4421c Merge various apps layer changes from the Fedora policy. 2011-06-08 13:05:34 -04:00
Chris PeBenito ec5d81e1ca Aisexec patch from Miroslav Grepl.
* openais needs ipc_owner and read/write user SysV sempaphores/shared memory
2011-03-21 11:23:26 -04:00
Chris PeBenito 6c4f41ced1 Whitespace fixes in userdomain. 2011-03-21 11:14:34 -04:00
Chris PeBenito ff449b62d7 Reorder samhain call in userdomain. 2010-12-15 11:02:29 -05:00
Harry Ciao b2f8897d9c Add support for the samhain program.
Note, extra privileges may need to be granted to the samhain domain
if its default configuration file(/etc/samhainrc) is changed.

The samhain program could be used in the following way:

(In secadm_r role)
1. Initialize filesystem signature database:
newrole -l s15:c0.c1023 -p -- -c "samhain -t init"

(Note, the current secadm console will be blocked until
the database is completed)

2. Start samhain deamon to check filesystem integrity
newrole -l s15:c0.c1023 -p -- -c "samhain -t check -D"

3. Update filesystem signature database:
newrole -l s15:c0.c1023 -p -- -c "samhain -t update"

(In sysadm_r role)
1. Start samhain in daemon mode:
run_init /etc/init.d/samhain start

2. Stop samhain daemon:
run_init /etc/init.d/samhain stop

3. Check samhain daemon status:
run_init /etc/init.d/samhain status

4. Read/write samhain log files:
newrole -l s15:c0.c1023 -p -- -c "cat /var/log/samhain_log"

5. Remove samhain database files
newrole -l s15:c0.c1023 -p -- -c "rm /var/lib/samhain/samhain_file"

Note:
1. Stop samhain daemon before updating signature database.
2. Don't try to start samhain daemon twice.
3. Need to toggle SELinux into the Permissive mode in order to remove
   the samhain_log files from /var/log/.

Signed-off-by: Harry Ciao <qingtao.cao@windriver.com>
2010-12-15 10:57:12 -05:00