Apache OpenOffice module
PATCH 1/1 Apache OpenOffice module
This is a minimal patch that I am testing to support Apache OpenOffice with its own module.
The file contexts (and initial tests) are based on the default installation path for version 4 of the office suite.
--- policy/modules/contrib/openoffice.fc | 30 ++++++++++++ policy/modules/contrib/openoffice.if | 48 ++++++++++++++++++++ policy/modules/contrib/openoffice.te | 83 +++++++++++++++++++++++++++++++++++ policy/modules/roles/staff.te | 4 + policy/modules/roles/sysadm.te | 4 + policy/modules/roles/unprivuser.te | 4 + policy/modules/services/xserver.if | 19 ++++++++ policy/modules/system/libraries.fc | 2 8 files changed, 194 insertions(+)
policy/modules/contrib/openoffice.fc +30 -0
@@ -0,0 +1,30 @@ +HOME_DIR/\.openoffice(/.*)? gen_context(system_u:object_r:ooffice_home_t,s0) + +/opt/openoffice4/program/cde-open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/gnome-open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/gnome-open-url.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/javaldx -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/kde-open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/pagein -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/regcomp.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/regmerge -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/regview -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/sbase -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/scalc -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/sdraw -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/senddoc -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/simpress -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/smath -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/soffice -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/soffice\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/spadmin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/spadmin.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/startup.sh -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/swriter -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/uno.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/unoinfo -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/unopkg -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/unopkg.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/unpack_update -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/uri-encode -- gen_context(system_u:object_r:ooffice_exec_t,s0)
policy/modules/contrib/openoffice.if +48 -0
48 lines not on this page · raw message
policy/modules/contrib/openoffice.te +83 -0
83 lines not on this page · raw message
policy/modules/roles/staff.te +4 -0
@@ -141,6 +141,10 @@ ifndef(`distro_redhat',` ') optional_policy(` + ooffice_role(staff_r, staff_t) + ') + + optional_policy(` pyzor_role(staff_r, staff_t) ')
policy/modules/roles/sysadm.te +4 -0
@@ -721,6 +721,10 @@ optional_policy(` ') optional_policy(` + ooffice_role(sysadm_r, sysadm_t) +') + +optional_policy(` openct_admin(sysadm_t, sysadm_r) ')
policy/modules/roles/unprivuser.te +4 -0
@@ -114,6 +114,10 @@ ifndef(`distro_redhat',` ') optional_policy(` + ooffice_role(user_r, user_t) + ') + + optional_policy(` postgresql_role(user_r, user_t) ')
policy/modules/services/xserver.if +19 -0
@@ -602,6 +602,25 @@ interface(`xserver_read_user_xauth',` ######################################## ## <summary> +## Read all users .ICEauthority. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`xserver_read_user_iceauth',` + gen_require(` + type iceauth_home_t; + ') + + allow $1 iceauth_home_t:file read_file_perms; + userdom_search_user_home_dirs($1) +') + +######################################## +## <summary> ## Set the attributes of the X windows console named pipes. ## </summary> ## <param name="domain">
policy/modules/system/libraries.fc +2 -0
@@ -52,6 +52,8 @@ ifdef(`distro_redhat',` /opt/(.*/)?jre.*/.+\.so(\.[^/]*)* -- gen_context(system_u:object_r:textrel_shlib_t,s0) /opt/(.*/)?jre/.+\.jar -- gen_context(system_u:object_r:lib_t,s0) +/opt/openoffice4/program/.+\.so(\.[^/]*)* -- gen_context(system_u:object_r:lib_t,s0) + /opt/(.*/)?/RealPlayer/.+\.so(\.[^/]*)* -- gen_context(system_u:object_r:textrel_shlib_t,s0) # despite the extensions, they are actually libs /opt/Acrobat[5-9]/Reader/intellinux/plugins/.*\.api -- gen_context(system_u:object_r:lib_t,s0)
PATCH 1/1 Apache OpenOffice module
Quoted 42 lines · Guido Trentalancia via refpolicy
This is a minimal patch that I am testing to support Apache OpenOffice with its own module.
The file contexts (and initial tests) are based on the default installation path for version 4 of the office suite.
Signed-off-by Guido Trentalancia <[email protected]>--- policy/modules/contrib/openoffice.fc | 30 ++++++++++++ policy/modules/contrib/openoffice.if | 48 ++++++++++++++++++++ policy/modules/contrib/openoffice.te | 83 +++++++++++++++++++++++++++++++++++ policy/modules/roles/staff.te | 4 + policy/modules/roles/sysadm.te | 4 + policy/modules/roles/unprivuser.te | 4 + policy/modules/services/xserver.if | 19 ++++++++ policy/modules/system/libraries.fc | 2 8 files changed, 194 insertions(+)diff -pruN refpolicy-git-25112016-orig/policy/modules/contrib/openoffice.fc refpolicy-git-25112016/policy/modules/contrib/openoffice.fc
policy/modules/contrib/openoffice.fc +20
-0@@ -0,0 +1,30 @@ +HOME_DIR/\.openoffice(/.*)? gen_context(system_u:object_r:ooffice_home_t,s0) + +/opt/openoffice4/program/cde-open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/gnome-open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/gnome-open-url.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/javaldx -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/kde-open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/pagein -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/regcomp.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/regmerge -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/regview -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/sbase -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/scalc -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/sdraw -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/senddoc -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/simpress -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/smath -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/soffice -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/soffice\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0)
policy/modules/contrib/openoffice.fc line 30
Quoted 10 lines
policy/modules/contrib/openoffice.fc +10
-0+/opt/openoffice4/program/spadmin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/spadmin.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/startup.sh -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/swriter -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/uno.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/unoinfo -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/unopkg -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/unopkg.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/unpack_update -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/uri-encode -- gen_context(system_u:object_r:ooffice_exec_t,s0)
escape the periods consistently to avoid regex confusion
Quoted 74 lines
diff -pruN refpolicy-git-25112016-orig/policy/modules/contrib/openoffice.if refpolicy-git-25112016/policy/modules/contrib/openoffice.if
policy/modules/contrib/openoffice.if +48
-0@@ -0,0 +1,48 @@ +## <summary>Openoffice suite.</summary> + +############################################################ +## <summary> +## Role access for openoffice. +## </summary> +## <param name="role"> +## <summary> +## Role allowed access. +## </summary> +## </param> +## <param name="domain"> +## <summary> +## User domain for the role. +## </summary> +## </param> +# +interface(`ooffice_role',` + gen_require(` + attribute_role ooffice_roles; + type ooffice_t, ooffice_exec_t; + ') + + roleattribute $1 ooffice_roles; + + domtrans_pattern($2, ooffice_exec_t, ooffice_t) + + allow $2 ooffice_t:process { ptrace signal_perms }; + ps_process_pattern($2, ooffice_t) +') + +######################################## +## <summary> +## Run openoffice in its own domain. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed to transition. +## </summary> +## </param> +# +interface(`ooffice_domtrans',` + gen_require(` + type ooffice_t, ooffice_exec_t; + ') + + domtrans_pattern($1, ooffice_exec_t, ooffice_t) +')diff -pruN refpolicy-git-25112016-orig/policy/modules/contrib/openoffice.te refpolicy-git-25112016/policy/modules/contrib/openoffice.te
policy/modules/contrib/openoffice.te +18
-0@@ -0,0 +1,83 @@ +policy_module(openoffice, 1.0.0) + +############################## +# +# Declarations +# + +attribute_role ooffice_roles; + +type ooffice_t; +type ooffice_exec_t; +userdom_user_application_domain(ooffice_t, ooffice_exec_t) +role ooffice_roles types ooffice_t; + +type ooffice_home_t; +userdom_user_home_content(ooffice_home_t) + +type ooffice_tmp_t;
policy/modules/contrib/openoffice.te line 28
Quoted 10 lines
policy/modules/contrib/openoffice.te +10
-0+files_tmp_file(ooffice_tmp_t) + +############################## +# +# Openoffice local policy +# + +allow ooffice_t self:process { execmem signal }; +allow ooffice_t self:shm create_shm_perms; +allow ooffice_t self:udp_socket create_socket_perms;
the above indicated that it is probably an nss client (auth_use_nsswitch())
policy/modules/contrib/openoffice.te line 33
Quoted 5 lines
policy/modules/contrib/openoffice.te +5
-0+allow ooffice_t self:unix_stream_socket connectto; + +allow ooffice_t ooffice_home_t:dir manage_dir_perms; +allow ooffice_t ooffice_home_t:file manage_file_perms; +allow ooffice_t ooffice_home_t:lnk_file manage_lnk_file_perms;
lacking a auto type transition rule (userdom_user_home_dir_filetrans())
policy/modules/contrib/openoffice.te line 40
Quoted 7 lines
policy/modules/contrib/openoffice.te +7
-0+ +manage_dirs_pattern(ooffice_t, ooffice_tmp_t, ooffice_tmp_t) +manage_files_pattern(ooffice_t, ooffice_tmp_t, ooffice_tmp_t) +manage_sock_files_pattern(ooffice_t, ooffice_tmp_t, ooffice_tmp_t) +files_tmp_filetrans(ooffice_t, ooffice_tmp_t, { dir file sock_file }) + +rw_fifo_files_pattern(ooffice_t, ooffice_t, ooffice_t)
allow ooffice_t self rw_fifo_file_perms; (there are no dirs with type ooffice_t other than the ones in /proc)
Quoted 8 lines
policy/modules/contrib/openoffice.te +8
-0+ +can_exec(ooffice_t, ooffice_exec_t) + +corecmd_exec_bin(ooffice_t) +corecmd_exec_shell(ooffice_t) + +dev_read_sysfs(ooffice_t) +dev_read_urand(ooffice_t)
policy/modules/contrib/openoffice.te line 58
Quoted 10 lines
policy/modules/contrib/openoffice.te +10
-0+ +files_read_etc_files(ooffice_t) +files_read_usr_files(ooffice_t) + +fs_getattr_xattr_fs(ooffice_t) + +miscfiles_read_fonts(ooffice_t) +miscfiles_read_localization(ooffice_t) + +sysnet_read_config(ooffice_t)
this is also part of the nss client stuff i mentioned above. Looks like it is getting ready to do some dns resolving
policy/modules/contrib/openoffice.te line 63
Quoted 5 lines
policy/modules/contrib/openoffice.te +5
-0+ +userdom_manage_user_home_content_dirs(ooffice_t) +userdom_manage_user_home_content_files(ooffice_t) +userdom_manage_user_home_content_symlinks(ooffice_t) +userdom_search_user_home_content(ooffice_t)
redundant because the first three already provide the functionality that the fourth provides.
Quoted 103 lines
policy/modules/contrib/openoffice.te +20
-0+ +optional_policy(` + cups_read_config(ooffice_t) + cups_stream_connect(ooffice_t) +') + +optional_policy(` + dbus_all_session_bus_client(ooffice_t) +') + +optional_policy(` + hostname_exec(ooffice_t) +') + +optional_policy(` + xserver_read_user_iceauth(ooffice_t) + xserver_read_user_xauth(ooffice_t) + xserver_read_xdm_tmp_files(ooffice_t) + xserver_stream_connect(ooffice_t) +')diff -pruN refpolicy-git-25112016-orig/policy/modules/roles/staff.te refpolicy-git-25112016/policy/modules/roles/staff.te
policy/modules/roles/staff.te +4
-0@@ -141,6 +141,10 @@ ifndef(`distro_redhat',` ') optional_policy(` + ooffice_role(staff_r, staff_t) + ') + + optional_policy(` pyzor_role(staff_r, staff_t) ')diff -pruN refpolicy-git-25112016-orig/policy/modules/roles/sysadm.te refpolicy-git-25112016/policy/modules/roles/sysadm.te
policy/modules/roles/sysadm.te +4
-0@@ -721,6 +721,10 @@ optional_policy(` ') optional_policy(` + ooffice_role(sysadm_r, sysadm_t) +') + +optional_policy(` openct_admin(sysadm_t, sysadm_r) ')diff -pruN refpolicy-git-25112016-orig/policy/modules/roles/unprivuser.te refpolicy-git-25112016/policy/modules/roles/unprivuser.te
policy/modules/roles/unprivuser.te +4
-0@@ -114,6 +114,10 @@ ifndef(`distro_redhat',` ') optional_policy(` + ooffice_role(user_r, user_t) + ') + + optional_policy(` postgresql_role(user_r, user_t) ')diff -pruN refpolicy-git-25112016-orig/policy/modules/services/xserver.if refpolicy-git-25112016/policy/modules/services/xserver.if
policy/modules/services/xserver.if +19
-0@@ -602,6 +602,25 @@ interface(`xserver_read_user_xauth',` ######################################## ## <summary> +## Read all users .ICEauthority. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`xserver_read_user_iceauth',` + gen_require(` + type iceauth_home_t; + ') + + allow $1 iceauth_home_t:file read_file_perms; + userdom_search_user_home_dirs($1) +') + +######################################## +## <summary> ## Set the attributes of the X windows console named pipes. ## </summary> ## <param name="domain">diff -pruN refpolicy-git-25112016-orig/policy/modules/system/libraries.fc refpolicy-git-25112016/policy/modules/system/libraries.fc
policy/modules/system/libraries.fc +2
-0@@ -52,6 +52,8 @@ ifdef(`distro_redhat',` /opt/(.*/)?jre.*/.+\.so(\.[^/]*)* -- gen_context(system_u:object_r:textrel_shlib_t,s0) /opt/(.*/)?jre/.+\.jar -- gen_context(system_u:object_r:lib_t,s0) +/opt/openoffice4/program/.+\.so(\.[^/]*)* -- gen_context(system_u:object_r:lib_t,s0) + /opt/(.*/)?/RealPlayer/.+\.so(\.[^/]*)* -- gen_context(system_u:object_r:textrel_shlib_t,s0) # despite the extensions, they are actually libs /opt/Acrobat[5-9]/Reader/intellinux/plugins/.*\.api -- gen_context(system_u:object_r:lib_t,s0)
Quoted 5 lines
_______________________________________________
refpolicy mailing list
refpolicy at oss.tresys.com
http://oss.tresys.com/mailman/listinfo/refpolicy
I am personally of the opinion that this module probably will not cut it in the end. Basically because it's too limited, especially considering that it uses dbus.
However i will leave that judgement to others, and instead i stick to shallow reviewing, ignoring any issue of structure that i see.
Signature · 11 lines
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8 02D5 3B6C 5F1D 2C7B 6B02 https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02 Dominick Grift -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 648 bytes Desc: OpenPGP digital signature Url : http://oss.tresys.com/pipermail/refpolicy/attachments/20161126/00a88905/attachment.bin
PATCH v2 1/1 Apache OpenOffice module
This is a minimal patch that I am testing to support Apache OpenOffice with its own module.
The file contexts (and initial tests) are based on the default installation path for version 4 of the office suite.
This second version includes revisions from Dominick Grift.
--- policy/modules/contrib/openoffice.fc | 30 ++++++++++++ policy/modules/contrib/openoffice.if | 48 ++++++++++++++++++++ policy/modules/contrib/openoffice.te | 81 +++++++++++++++++++++++++++++++++++ policy/modules/roles/staff.te | 4 + policy/modules/roles/sysadm.te | 4 + policy/modules/roles/unprivuser.te | 4 + policy/modules/services/xserver.if | 19 ++++++++ policy/modules/system/libraries.fc | 2 8 files changed, 192 insertions(+)
policy/modules/contrib/openoffice.fc +30 -0
@@ -0,0 +1,30 @@ +HOME_DIR/\.openoffice(/.*)? gen_context(system_u:object_r:ooffice_home_t,s0) + +/opt/openoffice4/program/cde-open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/gnome-open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/gnome-open-url\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/javaldx -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/kde-open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/pagein -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/regcomp\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/regmerge -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/regview -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/sbase -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/scalc -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/sdraw -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/senddoc -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/simpress -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/smath -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/soffice -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/soffice\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/spadmin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/spadmin\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/startup\.sh -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/swriter -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/uno\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/unoinfo -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/unopkg -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/unopkg\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/unpack_update -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/uri-encode -- gen_context(system_u:object_r:ooffice_exec_t,s0)
policy/modules/contrib/openoffice.if +48 -0
48 lines not on this page · raw message
policy/modules/contrib/openoffice.te +81 -0
81 lines not on this page · raw message
policy/modules/roles/staff.te +4 -0
@@ -141,6 +141,10 @@ ifndef(`distro_redhat',` ') optional_policy(` + ooffice_role(staff_r, staff_t) + ') + + optional_policy(` pyzor_role(staff_r, staff_t) ')
policy/modules/roles/sysadm.te +4 -0
@@ -721,6 +721,10 @@ optional_policy(` ') optional_policy(` + ooffice_role(sysadm_r, sysadm_t) +') + +optional_policy(` openct_admin(sysadm_t, sysadm_r) ')
policy/modules/roles/unprivuser.te +4 -0
@@ -114,6 +114,10 @@ ifndef(`distro_redhat',` ') optional_policy(` + ooffice_role(user_r, user_t) + ') + + optional_policy(` postgresql_role(user_r, user_t) ')
policy/modules/services/xserver.if +19 -0
@@ -602,6 +602,25 @@ interface(`xserver_read_user_xauth',` ######################################## ## <summary> +## Read all users .ICEauthority. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`xserver_read_user_iceauth',` + gen_require(` + type iceauth_home_t; + ') + + allow $1 iceauth_home_t:file read_file_perms; + userdom_search_user_home_dirs($1) +') + +######################################## +## <summary> ## Set the attributes of the X windows console named pipes. ## </summary> ## <param name="domain">
policy/modules/system/libraries.fc +2 -0
@@ -52,6 +52,8 @@ ifdef(`distro_redhat',` /opt/(.*/)?jre.*/.+\.so(\.[^/]*)* -- gen_context(system_u:object_r:textrel_shlib_t,s0) /opt/(.*/)?jre/.+\.jar -- gen_context(system_u:object_r:lib_t,s0) +/opt/openoffice4/program/.+\.so(\.[^/]*)* -- gen_context(system_u:object_r:lib_t,s0) + /opt/(.*/)?/RealPlayer/.+\.so(\.[^/]*)* -- gen_context(system_u:object_r:textrel_shlib_t,s0) # despite the extensions, they are actually libs /opt/Acrobat[5-9]/Reader/intellinux/plugins/.*\.api -- gen_context(system_u:object_r:lib_t,s0)
PATCH v3 1/1 Apache OpenOffice module
This is a minimal patch that I am testing to support Apache OpenOffice with its own module.
The file contexts (and initial tests) are based on the default installation path for version 4 of the office suite.
It includes revisions from Dominick Grift.
This third version should correctly manage files in home directories and allow some other functionality.
--- policy/modules/contrib/openoffice.fc | 30 +++++++++++ policy/modules/contrib/openoffice.if | 48 +++++++++++++++++ policy/modules/contrib/openoffice.te | 95 +++++++++++++++++++++++++++++++++++ policy/modules/roles/staff.te | 4 + policy/modules/roles/sysadm.te | 4 + policy/modules/roles/unprivuser.te | 4 + policy/modules/services/xserver.if | 19 +++++++ policy/modules/system/libraries.fc | 2 8 files changed, 206 insertions(+)
policy/modules/contrib/openoffice.fc +30 -0
@@ -0,0 +1,30 @@ +HOME_DIR/\.openoffice(/.*)? gen_context(system_u:object_r:ooffice_home_t,s0) + +/opt/openoffice4/program/cde-open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/gnome-open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/gnome-open-url\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/javaldx -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/kde-open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/pagein -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/regcomp\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/regmerge -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/regview -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/sbase -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/scalc -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/sdraw -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/senddoc -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/simpress -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/smath -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/soffice -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/soffice\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/spadmin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/spadmin\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/startup\.sh -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/swriter -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/uno\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/unoinfo -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/unopkg -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/unopkg\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/unpack_update -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/uri-encode -- gen_context(system_u:object_r:ooffice_exec_t,s0)
policy/modules/contrib/openoffice.if +48 -0
48 lines not on this page · raw message
policy/modules/contrib/openoffice.te +95 -0
95 lines not on this page · raw message
policy/modules/roles/staff.te +4 -0
@@ -141,6 +141,10 @@ ifndef(`distro_redhat',` ') optional_policy(` + ooffice_role(staff_r, staff_t) + ') + + optional_policy(` pyzor_role(staff_r, staff_t) ')
policy/modules/roles/sysadm.te +4 -0
@@ -721,6 +721,10 @@ optional_policy(` ') optional_policy(` + ooffice_role(sysadm_r, sysadm_t) +') + +optional_policy(` openct_admin(sysadm_t, sysadm_r) ')
policy/modules/roles/unprivuser.te +4 -0
@@ -114,6 +114,10 @@ ifndef(`distro_redhat',` ') optional_policy(` + ooffice_role(user_r, user_t) + ') + + optional_policy(` postgresql_role(user_r, user_t) ')
policy/modules/services/xserver.if +19 -0
@@ -602,6 +602,25 @@ interface(`xserver_read_user_xauth',` ######################################## ## <summary> +## Read all users .ICEauthority. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`xserver_read_user_iceauth',` + gen_require(` + type iceauth_home_t; + ') + + allow $1 iceauth_home_t:file read_file_perms; + userdom_search_user_home_dirs($1) +') + +######################################## +## <summary> ## Set the attributes of the X windows console named pipes. ## </summary> ## <param name="domain">
policy/modules/system/libraries.fc +2 -0
@@ -52,6 +52,8 @@ ifdef(`distro_redhat',` /opt/(.*/)?jre.*/.+\.so(\.[^/]*)* -- gen_context(system_u:object_r:textrel_shlib_t,s0) /opt/(.*/)?jre/.+\.jar -- gen_context(system_u:object_r:lib_t,s0) +/opt/openoffice4/program/.+\.so(\.[^/]*)* -- gen_context(system_u:object_r:lib_t,s0) + /opt/(.*/)?/RealPlayer/.+\.so(\.[^/]*)* -- gen_context(system_u:object_r:textrel_shlib_t,s0) # despite the extensions, they are actually libs /opt/Acrobat[5-9]/Reader/intellinux/plugins/.*\.api -- gen_context(system_u:object_r:lib_t,s0)
PATCH 1/1 Apache OpenOffice module
In reply to Dominick GriftHello,
thanks very much for the revision. I have now posted a second version of the patch...
Quoted 391 lines · Dominick Grift via refpolicy
Quoted 81 lines · Guido Trentalancia via refpolicy
This is a minimal patch that I am testing to support Apache OpenOffice
with its own module.The file contexts (and initial tests) are based on the default installation path for version 4 of the office suite.
Signed-off-by Guido Trentalancia <[email protected]>---
?policy/modules/contrib/openoffice.fc |???30 ++++++++++++ ?policy/modules/contrib/openoffice.if |???48 ++++++++++++++++++++ ?policy/modules/contrib/openoffice.te |???83 +++++++++++++++++++++++++++++++++++ ?policy/modules/roles/staff.te????????|????4 + ?policy/modules/roles/sysadm.te???????|????4 + ?policy/modules/roles/unprivuser.te???|????4 + ?policy/modules/services/xserver.if???|???19 ++++++++ ?policy/modules/system/libraries.fc???|????2?8 files changed, 194 insertions(+)
diff -pruN refpolicy-git-25112016- orig/policy/modules/contrib/openoffice.fc refpolicy-git- 25112016/policy/modules/contrib/openoffice.fc
--- refpolicy-git-25112016-
orig/policy/modules/contrib/openoffice.fc 1970-01-01
01:00:00.000000000 +0100
+++ refpolicy-git-25112016/policy/modules/contrib/openoffice.fc2016-11-25 23:24:38.338111736 +0100(quoted diff) +1
-0@@ -0,0 +1,30 @@ +HOME_DIR/\.openoffice(/.*)? gen_context(system_u:object_r:ooffice_home_t,s0)
(quoted diff) +2
-0+ +/opt/openoffice4/program/cde-open-url -- gen
_context(system_u:object_r:ooffice_exec_t,s0)
+/opt/openoffice4/program/gnome-open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0)
+/opt/openoffice4/program/gnome-open-url.bin --gen_context(system_u:object_r:ooffice_exec_t,s0)
+/opt/openoffice4/program/javaldx --gen_context(system_u:object_r:ooffice_exec_t,s0)
+/opt/openoffice4/program/kde-open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0)
+/opt/openoffice4/program/open-url --gen_context(system_u:object_r:ooffice_exec_t,s0)
+/opt/openoffice4/program/pagein -- gen_context(system_u:object_r:ooffice_exec_t,s0)
+/opt/openoffice4/program/regcomp.bin --gen_context(system_u:object_r:ooffice_exec_t,s0)
+/opt/openoffice4/program/regmerge --gen_context(system_u:object_r:ooffice_exec_t,s0)
+/opt/openoffice4/program/regview --gen_context(system_u:object_r:ooffice_exec_t,s0)
+/opt/openoffice4/program/sbase -- gen_context(system_u:object_r:ooffice_exec_t,s0)
+/opt/openoffice4/program/scalc -- gen_context(system_u:object_r:ooffice_exec_t,s0)
+/opt/openoffice4/program/sdraw -- gen_context(system_u:object_r:ooffice_exec_t,s0)
+/opt/openoffice4/program/senddoc --gen_context(system_u:object_r:ooffice_exec_t,s0)
+/opt/openoffice4/program/simpress --gen_context(system_u:object_r:ooffice_exec_t,s0)
+/opt/openoffice4/program/smath -- gen_context(system_u:object_r:ooffice_exec_t,s0)
+/opt/openoffice4/program/soffice --gen_context(system_u:object_r:ooffice_exec_t,s0)
+/opt/openoffice4/program/soffice\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0)
+/opt/openoffice4/program/spadmin --gen_context(system_u:object_r:ooffice_exec_t,s0)
+/opt/openoffice4/program/spadmin.bin --gen_context(system_u:object_r:ooffice_exec_t,s0)+/opt/openoffice4/program/startup.sh--gen_context(system_u:object_r:ooffice_exec_t,s0)
+/opt/openoffice4/program/swriter --gen_context(system_u:object_r:ooffice_exec_t,s0)
+/opt/openoffice4/program/uno.bin --gen_context(system_u:object_r:ooffice_exec_t,s0)
+/opt/openoffice4/program/unoinfo --gen_context(system_u:object_r:ooffice_exec_t,s0)Quoted 8 lines
+/opt/openoffice4/program/unopkg -- g
en_context(system_u:object_r:ooffice_exec_t,s0)
+/opt/openoffice4/program/unopkg.bin --gen_context(system_u:object_r:ooffice_exec_t,s0)
+/opt/openoffice4/program/unpack_update -- gen_context(system_u:object_r:ooffice_exec_t,s0)
+/opt/openoffice4/program/uri-encode --gen_context(system_u:object_r:ooffice_exec_t,s0)escape the periods consistently to avoid regex confusion
Quoted 85 lines
diff -pruN refpolicy-git-25112016- orig/policy/modules/contrib/openoffice.if refpolicy-git- 25112016/policy/modules/contrib/openoffice.if
--- refpolicy-git-25112016-
orig/policy/modules/contrib/openoffice.if 1970-01-01
01:00:00.000000000 +0100
+++ refpolicy-git-25112016/policy/modules/contrib/openoffice.if2016-11-25 23:24:38.339111745 +0100policy/modules/contrib/openoffice.if +48
-0@@ -0,0 +1,48 @@ +## <summary>Openoffice suite.</summary> + +############################################################ +## <summary> +## Role access for openoffice. +## </summary> +## <param name="role"> +## <summary> +## Role allowed access. +## </summary> +## </param> +## <param name="domain"> +## <summary> +## User domain for the role. +## </summary> +## </param> +# +interface(`ooffice_role',` + gen_require(` + attribute_role ooffice_roles; + type ooffice_t, ooffice_exec_t; +????????') + + roleattribute $1 ooffice_roles; + + domtrans_pattern($2, ooffice_exec_t, ooffice_t) + + allow $2 ooffice_t:process { ptrace signal_perms }; + ps_process_pattern($2, ooffice_t) +') + +######################################## +## <summary> +## Run openoffice in its own domain. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed to transition. +## </summary> +## </param> +# +interface(`ooffice_domtrans',` + gen_require(` + type ooffice_t, ooffice_exec_t; + ') + + domtrans_pattern($1, ooffice_exec_t, ooffice_t) +')diff -pruN refpolicy-git-25112016- orig/policy/modules/contrib/openoffice.te refpolicy-git- 25112016/policy/modules/contrib/openoffice.te
--- refpolicy-git-25112016-
orig/policy/modules/contrib/openoffice.te 1970-01-01
01:00:00.000000000 +0100
+++ refpolicy-git-25112016/policy/modules/contrib/openoffice.te2016-11-25 23:27:00.726425482 +0100policy/modules/contrib/openoffice.te +18
-0@@ -0,0 +1,83 @@ +policy_module(openoffice, 1.0.0) + +############################## +# +# Declarations +# + +attribute_role ooffice_roles; + +type ooffice_t; +type ooffice_exec_t; +userdom_user_application_domain(ooffice_t, ooffice_exec_t) +role ooffice_roles types ooffice_t; + +type ooffice_home_t; +userdom_user_home_content(ooffice_home_t) + +type ooffice_tmp_t;policy/modules/contrib/openoffice.te line 28
Quoted 10 lines
policy/modules/contrib/openoffice.te +10
-0+files_tmp_file(ooffice_tmp_t) + +############################## +# +# Openoffice local policy +# + +allow ooffice_t self:process { execmem signal }; +allow ooffice_t self:shm create_shm_perms; +allow ooffice_t self:udp_socket create_socket_perms;the above indicated that it is probably an nss client (
auth_use_nsswitch())policy/modules/contrib/openoffice.te line 33
Quoted 6 lines
policy/modules/contrib/openoffice.te +5
-0+allow ooffice_t self:unix_stream_socket connectto; + +allow ooffice_t ooffice_home_t:dir manage_dir_perms; +allow ooffice_t ooffice_home_t:file manage_file_perms; +allow ooffice_t ooffice_home_t:lnk_file manage_lnk_file_perms;lacking a auto type transition rule
(userdom_user_home_dir_filetrans())Review
Quoted 9 lines
policy/modules/contrib/openoffice.te +5
-0+ +manage_dirs_pattern(ooffice_t, ooffice_tmp_t, ooffice_tmp_t) +manage_files_pattern(ooffice_t, ooffice_tmp_t, ooffice_tmp_t) +manage_sock_files_pattern(ooffice_t, ooffice_tmp_t, ooffice_tmp_t) +files_tmp_filetrans(ooffice_t, ooffice_tmp_t, { dir file sock_file})
(quoted diff) +2
-0+ +rw_fifo_files_pattern(ooffice_t, ooffice_t, ooffice_t)allow
ooffice_tselfrw_fifo_file_perms; (there are no dirs with typeooffice_tother than the ones in /proc)Quoted 9 lines
policy/modules/contrib/openoffice.te +8
-0+ +can_exec(ooffice_t, ooffice_exec_t) + +corecmd_exec_bin(ooffice_t) +corecmd_exec_shell(ooffice_t) + +dev_read_sysfs(ooffice_t) +dev_read_urand(ooffice_t)policy/modules/contrib/openoffice.te line 58
Quoted 10 lines
policy/modules/contrib/openoffice.te +10
-0+ +files_read_etc_files(ooffice_t) +files_read_usr_files(ooffice_t) + +fs_getattr_xattr_fs(ooffice_t) + +miscfiles_read_fonts(ooffice_t) +miscfiles_read_localization(ooffice_t) + +sysnet_read_config(ooffice_t)this is also part of the nss client stuff i mentioned above. Looks like
it is getting ready to do some dns resolvingpolicy/modules/contrib/openoffice.te line 63
Quoted 6 lines
policy/modules/contrib/openoffice.te +5
-0+ +userdom_manage_user_home_content_dirs(ooffice_t) +userdom_manage_user_home_content_files(ooffice_t) +userdom_manage_user_home_content_symlinks(ooffice_t) +userdom_search_user_home_content(ooffice_t)redundant because the first three already provide the functionality that
the fourth provides.Quoted 125 lines
policy/modules/contrib/openoffice.te +20
-0+ +optional_policy(` + cups_read_config(ooffice_t) + cups_stream_connect(ooffice_t) +') + +optional_policy(` + dbus_all_session_bus_client(ooffice_t) +') + +optional_policy(` + hostname_exec(ooffice_t) +') + +optional_policy(` + xserver_read_user_iceauth(ooffice_t) + xserver_read_user_xauth(ooffice_t) + xserver_read_xdm_tmp_files(ooffice_t) + xserver_stream_connect(ooffice_t) +')diff -pruN refpolicy-git-25112016- orig/policy/modules/roles/staff.te refpolicy-git- 25112016/policy/modules/roles/staff.te
--- refpolicy-git-25112016-orig/policy/modules/roles/staff.te2016-10-29 16:29:13.453156183 +0200+++ refpolicy-git-25112016/policy/modules/roles/staff.te 201
6-11-25 23:24:38.339111745 +0100(quoted diff) +0
-0@@ -141,6 +141,10 @@ ifndef(`distro_redhat',` ? ')?
? optional_policy(`policy/modules/roles/staff.te +4
-0+ ooffice_role(staff_r, staff_t) + ') + + optional_policy(`?
pyzor_role(staff_r, staff_t)
? ')
?
diff -pruN refpolicy-git-25112016- orig/policy/modules/roles/sysadm.te refpolicy-git- 25112016/policy/modules/roles/sysadm.te
--- refpolicy-git-25112016-orig/policy/modules/roles/sysadm.te2016-10-29 16:29:13.454156211 +0200+++ refpolicy-git-25112016/policy/modules/roles/sysadm.te 20
16-11-25 23:24:38.340111754 +0100(quoted diff) +0
-0@@ -721,6 +721,10 @@ optional_policy(` ?')?
?optional_policy(`policy/modules/roles/sysadm.te +4
-0+ ooffice_role(sysadm_r, sysadm_t) +') + +optional_policy(`?
openct_admin(sysadm_t, sysadm_r)
?')
?
diff -pruN refpolicy-git-25112016- orig/policy/modules/roles/unprivuser.te refpolicy-git- 25112016/policy/modules/roles/unprivuser.te
--- refpolicy-git-25112016-orig/policy/modules/roles/unprivuser.te2016-10-29 16:29:13.454156211 +0200 +++ refpolicy-git-25112016/policy/modules/roles/unprivuser.te 2016-11-25 23:24:38.340111754 +0100(quoted diff) +0
-0@@ -114,6 +114,10 @@ ifndef(`distro_redhat',` ? ')?
? optional_policy(`policy/modules/roles/unprivuser.te +4
-0+ ooffice_role(user_r, user_t) + ') + + optional_policy(`?
postgresql_role(user_r, user_t)
? ')
?
diff -pruN refpolicy-git-25112016- orig/policy/modules/services/xserver.if refpolicy-git- 25112016/policy/modules/services/xserver.if
--- refpolicy-git-25112016-orig/policy/modules/services/xserver.if2016-08-14 22:10:42.752848860 +0200 +++ refpolicy-git-25112016/policy/modules/services/xserver.if 2016-11-25 23:24:38.338111736 +0100(quoted diff) +0
-0@@ -602,6 +602,25 @@ interface(`xserver_read_user_xauth',`?
?########################################
?## <summary>policy/modules/services/xserver.if +19
-0+## Read all users .ICEauthority. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`xserver_read_user_iceauth',` + gen_require(` + type iceauth_home_t; + ') + + allow $1 iceauth_home_t:file read_file_perms; + userdom_search_user_home_dirs($1) +') + +######################################## +## <summary>?## Set the attributes of the X windows console named pipes.
?## </summary>
?## <param name="domain">
diff -pruN refpolicy-git-25112016- orig/policy/modules/system/libraries.fc refpolicy-git- 25112016/policy/modules/system/libraries.fc
--- refpolicy-git-25112016-orig/policy/modules/system/libraries.fc2016-08-14 21:24:48.961382244 +0200 +++ refpolicy-git-25112016/policy/modules/system/libraries.fc 2016-11-25 23:24:38.338111736 +0100(quoted diff) +0
-0@@ -52,6 +52,8 @@ ifdef(`distro_redhat',`?/opt/(.*/)?jre.*/.+\.so(\.[^/]*)* -- gen_context(sys
tem_u:object_r:textrel_shlib_t,s0)
?/opt/(.*/)?jre/.+\.jar --gen_context(system_u:object_r:lib_t,s0)
?
+/opt/openoffice4/program/.+\.so(\.[^/]*)* --gen_context(system_u:object_r:lib_t,s0)
+
?/opt/(.*/)?/RealPlayer/.+\.so(\.[^/]*)* -- gen_context(systQuoted 9 lines
em_u:object_r:textrel_shlib_t,s0)
?# despite the extensions, they are actually libs ?/opt/Acrobat[5-9]/Reader/intellinux/plugins/.*\.api --gen_context(system_u:object_r:lib_t,s0)
_______________________________________________
refpolicy mailing list
refpolicy at oss.tresys.com
http://oss.tresys.com/mailman/listinfo/refpolicyI am personally of the opinion that this module probably will not cut it
in the end. Basically because it's too limited, especially considering
that it uses dbus.
Quoted 2 lines
However i will leave that judgement to others, and instead i stick to shallow reviewing, ignoring any issue of structure that i see.
It allows to run OpenOffice4 with the Reference Policy.
It might probably be adapted to work with previous OpenOffice versions by simply changing the file contexts.
If it proves to be limited, it can always be extended later on... At the moment it works fine, as far as I can tell.
However, it probably needs more testing.
Regards,
Guido
PATCH 1/1 Apache OpenOffice module
In reply to Dominick GriftHello again...
Quoted 1 line · Dominick Grift via refpolicy
On 11/25/2016 11:41 PM, Guido Trentalancia via refpolicy wrote:
[...]
Quoted 11 lines
policy/modules/contrib/openoffice.te line 28
Quoted 8 lines
policy/modules/contrib/openoffice.te +8
-0+############################## +# +# Openoffice local policy +# + +allow ooffice_t self:process { execmem signal }; +allow ooffice_t self:shm create_shm_perms; +allow ooffice_t self:udp_socket create_socket_perms;the above indicated that it is probably an nss client (
auth_use_nsswitch())
Actually, auth_use_nsswitch() is probably too permissive and not needed, I think sysnet_dns_name_resolve() is more than enough...
So, I am probably going to change it like that.
Regards,
Guido
PATCH 1/1 Apache OpenOffice module
In reply to Dominick GriftQuoted 9 lines · Dominick Grift via refpolicy
Quoted 8 lines · Guido Trentalancia via refpolicy
This is a minimal patch that I am testing to support Apache OpenOffice with its own module.
The file contexts (and initial tests) are based on the default installation path for version 4 of the office suite.
Signed-off-by Guido Trentalancia <[email protected]>---
[...]
Quoted 4 lines
I am personally of the opinion that this module probably will not cut it in the end. Basically because it's too limited, especially considering that it uses dbus.
I'm unclear what the purpose of this policy is. Users aren't going to expect this kind of limitation. They should be able to edit whatever their user domain has access to, i.e. the same reason vim doesn't have a policy.
Signature · 1 line
Chris PeBenito
PATCH 1/1 Apache OpenOffice module
Hello Christopher.
Quoted 22 lines · Chris PeBenito via refpolicy
Quoted 12 lines · Dominick Grift via refpolicy
Quoted 10 lines · Guido Trentalancia via refpolicy
This is a minimal patch that I am testing to support Apache OpenOffice
with its own module.The file contexts (and initial tests) are based on the default installation path for version 4 of the office suite.
Signed-off-by Guido Trentalancia <[email protected]>---
[...]
Quoted 7 lines
I am personally of the opinion that this module probably will not cut it
in the end. Basically because it's too limited, especially considering
that it uses dbus.
Quoted 7 lines
I'm unclear what the purpose of this policy is.??Users aren't going to?
expect this kind of limitation.??They should be able to edit whatever?
their user domain has access to, i.e. the same reason vim doesn't have a?
policy.
The module aims to confine Apache OpenOffice so that it runs in its own domain with the least privilege instead of running in the user domain with a large set of unneeded permissions which can create vulnerabilities, for example, if a malicious version of the application is installed.
When using the "openoffice" module that I propose (if you give it a try on a test system, for example), the user can manage files in his/her own home directory and performs most, if not all, operations currently supported by the OpenOffice suite of applications.
Other applications that are not currently confined (such as vim that you mentioned) can be confined at a later time to achieve an increased overall level of security (reduced attack surface, i.e. fewer security risks / decreased probability of a successful attack).
Regards,
Guido
PATCH 1/1 Apache OpenOffice module
In reply to Chris PeBenitoQuoted 12 lines · Chris PeBenito
Quoted 9 lines · Dominick Grift via refpolicy
Quoted 8 lines · Guido Trentalancia via refpolicy
This is a minimal patch that I am testing to support Apache OpenOffice with its own module.
The file contexts (and initial tests) are based on the default installation path for version 4 of the office suite.
Signed-off-by Guido Trentalancia <[email protected]>---
[...]
Quoted 1 line
Quoted 9 lines
Quoted 3 lines
I am personally of the opinion that this module probably will not cut it in the end. Basically because it's too limited, especially considering that it uses dbus.
I'm unclear what the purpose of this policy is. Users aren't going to expect this kind of limitation. They should be able to edit whatever their user domain has access to, i.e. the same reason vim doesn't have a policy.
vim is a text editor. open/libre office is a office suite.
I do not believe that anyone expects the latter to be able to manage config, data and cache files.
If you want to enforce some integrity on the desktop then you have to draw the line somewhere sometimes. I suppose that is what enforcing integrity is all about after all...
Signature · 11 lines
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8 02D5 3B6C 5F1D 2C7B 6B02 https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02 Dominick Grift -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 648 bytes Desc: OpenPGP digital signature Url : http://oss.tresys.com/pipermail/refpolicy/attachments/20161129/07bf8234/attachment.bin
PATCH 1/1 Apache OpenOffice module
Hello.
Quoted 33 lines · Dominick Grift via refpolicy
Quoted 23 lines · Chris PeBenito
Quoted 12 lines · Dominick Grift via refpolicy
Quoted 10 lines · Guido Trentalancia via refpolicy
This is a minimal patch that I am testing to support Apache OpenOffice
with its own module.The file contexts (and initial tests) are based on the default installation path for version 4 of the office suite.
Signed-off-by Guido Trentalancia <[email protected]>---
[...]
Quoted 7 lines
I am personally of the opinion that this module probably will not cut it
in the end. Basically because it's too limited, especially considering
that it uses dbus.Quoted 8 lines
I'm unclear what the purpose of this policy is.??Users aren't going to
expect this kind of limitation.??They should be able to edit whatever
their user domain has access to, i.e. the same reason vim doesn't have a
policy.
Quoted 4 lines
vim is a text editor. open/libre office is a office suite.
I do not believe that anyone expects the latter to be able to manage config, data and cache files.
It only reads ~/.cache and ~/.config, while it also needs to manage ~/.local/share files.
Indeed, on the system that I am using, it is confined by enforcing the above. It works really well !
On the other hand, the patch proposed here simplifies things by allowing it to manage the whole home directory content.
Of course, it can always be extended at a later time to enforce stricter file permissions on the above mentioned hidden directories by rethinking the whole desktop file contexts and security. But, as a first step, I suppose the proposed module is enough.
Quoted 3 lines
If you want to enforce some integrity on the desktop then you have to draw the line somewhere sometimes. I suppose that is what enforcing integrity is all about after all...
Regards,
Guido
PATCH 1/1 Apache OpenOffice module
In reply to Dominick GriftQuoted 23 lines · Dominick Grift
Quoted 12 lines · Chris PeBenito
Quoted 9 lines · Dominick Grift via refpolicy
Quoted 8 lines · Guido Trentalancia via refpolicy
This is a minimal patch that I am testing to support Apache OpenOffice with its own module.
The file contexts (and initial tests) are based on the default installation path for version 4 of the office suite.
Signed-off-by Guido Trentalancia <[email protected]>---
[...]
Quoted 1 line
Quoted 9 lines
Quoted 3 lines
I am personally of the opinion that this module probably will not cut it in the end. Basically because it's too limited, especially considering that it uses dbus.
I'm unclear what the purpose of this policy is. Users aren't going to expect this kind of limitation. They should be able to edit whatever their user domain has access to, i.e. the same reason vim doesn't have a policy.
Quoted 8 lines
vim is a text editor. open/libre office is a office suite.
I do not believe that anyone expects the latter to be able to manage config, data and cache files.
If you want to enforce some integrity on the desktop then you have to draw the line somewhere sometimes. I suppose that is what enforcing integrity is all about after all...
In this case, what integrity is being enforced? Integrity of the user data? That's not covered here as it can manage the user data. Maybe not the configs, but user data is of much more consequence. It's not preventing network access, particularly to http, so there's nothing preventing it from sending out the user data either.
Signature · 1 line
Chris PeBenito
PATCH 1/1 Apache OpenOffice module
Quoted 34 lines · Chris PeBenito
Quoted 24 lines · Dominick Grift
Quoted 17 lines · Chris PeBenito
Quoted 9 lines · Dominick Grift via refpolicy
Quoted 8 lines · Guido Trentalancia via refpolicy
This is a minimal patch that I am testing to support Apache OpenOffice with its own module.
The file contexts (and initial tests) are based on the default installation path for version 4 of the office suite.
Signed-off-by Guido Trentalancia <[email protected]>---
[...]
Quoted 5 lines
I am personally of the opinion that this module probably will not cut it
in the end. Basically because it's too limited, especially considering that it uses dbus.Quoted 5 lines
I'm unclear what the purpose of this policy is. Users aren't going to expect this kind of limitation. They should be able to edit whatever their user domain has access to, i.e. the same reason vim doesn't have a policy.
Quoted 8 lines
vim is a text editor. open/libre office is a office suite.
I do not believe that anyone expects the latter to be able to manage config, data and cache files.
If you want to enforce some integrity on the desktop then you have to draw the line somewhere sometimes. I suppose that is what enforcing integrity is all about after all...
Quoted 5 lines
In this case, what integrity is being enforced? Integrity of the user data? That's not covered here as it can manage the user data. Maybe not the configs, but user data is of much more consequence. It's not preventing network access, particularly to http, so there's nothing preventing it from sending out the user data either.
I would argue that in a desktop system the most sensitive data is config, cache and data. So integrity should be enforced on this content. (e.g.) strictly restrict access to the private types of config, data and cache.
.gnupg is config, often it houses private key files. Only gnupg should be able to access this file directly. this key is like your identity. It has to be protected. .ssh is ssh-client config it might have private key files. These are like your authentication credentials and should be protected and only ssh client should have access to it. The gnome-keyring data has sensitive info and should be protected. Many configuration files have sensitive info. For example you might have your nickserv password in .irssi/config. This should only be accessible by irssi else it can be used to impersonate you. there are a myriad of other sensitive files, but generally they all fall under config. cache or data. Types on contents that a office suite shouldnt have to have broad access to.
(generic) User data and network access have low priority. (generic) User data is generally shared across domains. That is just its nature. So there is little we can do with SELinux to enforce integrity there (there is an option to implement a solution similar to the public_content_t solution we implemented in the system space but it would probably only be used my power users anyway). Network access well lets just say that we have better (or at least additional) tools to control access to the network.
To me its all about protecting config , data and cache, and to govern who can run what, who can communicate with who etc.
Quoted 1 line
Signature · 11 lines
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8 02D5 3B6C 5F1D 2C7B 6B02 https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02 Dominick Grift -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 648 bytes Desc: OpenPGP digital signature Url : http://oss.tresys.com/pipermail/refpolicy/attachments/20161130/555f7b50/attachment.bin
PATCH 1/1 Apache OpenOffice module
Quoted 46 lines · Dominick Grift
Quoted 34 lines · Chris PeBenito
Quoted 24 lines · Dominick Grift
Quoted 17 lines · Chris PeBenito
Quoted 9 lines · Dominick Grift via refpolicy
Quoted 8 lines · Guido Trentalancia via refpolicy
This is a minimal patch that I am testing to support Apache OpenOffice with its own module.
The file contexts (and initial tests) are based on the default installation path for version 4 of the office suite.
Signed-off-by Guido Trentalancia <[email protected]>---
[...]
Quoted 5 lines
I am personally of the opinion that this module probably will not cut it
in the end. Basically because it's too limited, especially considering that it uses dbus.Quoted 5 lines
I'm unclear what the purpose of this policy is. Users aren't going to expect this kind of limitation. They should be able to edit whatever their user domain has access to, i.e. the same reason vim doesn't have a policy.
Quoted 8 lines
vim is a text editor. open/libre office is a office suite.
I do not believe that anyone expects the latter to be able to manage config, data and cache files.
If you want to enforce some integrity on the desktop then you have to draw the line somewhere sometimes. I suppose that is what enforcing integrity is all about after all...
Quoted 5 lines
In this case, what integrity is being enforced? Integrity of the user data? That's not covered here as it can manage the user data. Maybe not the configs, but user data is of much more consequence. It's not preventing network access, particularly to http, so there's nothing preventing it from sending out the user data either.
I would argue that in a desktop system the most sensitive data is config, cache and data. So integrity should be enforced on this content. (e.g.) strictly restrict access to the private types of config, data and cache.
Quoted 6 lines
.gnupg is config, often it houses private key files. Only gnupg should be able to access this file directly. this key is like your identity. It has to be protected. .ssh is ssh-client config it might have private key files. These are like your authentication credentials and should be protected and only ssh client should have access to it. The gnome-keyring data has sensitive info and should be protected. Many
This alone is what convinces me to merge it. I still think that generic user data is still the highest priority by many magnitudes. If I had a copy of my tax forms or health info (or pick some other extremely personal, sensitive document) on my system, I would be FAR angrier if that was compromised, compared to my GPG key. GPG keys can be revoked and passwords can be changed.
Signature · 1 line
Chris PeBenito
PATCH 1/1 Apache OpenOffice module
Quoted 6 lines · On Thu, 1 Dec 2016 19:42:13 -0500 Chris PeBenito via refpolicy…
This alone is what convinces me to merge it. I still think that generic user data is still the highest priority by many magnitudes. If I had a copy of my tax forms or health info (or pick some other extremely personal, sensitive document) on my system, I would be FAR angrier if that was compromised, compared to my GPG key. GPG keys can be revoked and passwords can be changed.
I agree, but I think protection of personal documents is something that everyone of us needs to implement for themselves [1], because the individual workflows and requirements differ vastly. Contrast this with things like gnupg: There it makes sense to include a common policy in refpol because everyone will have similar data layouts for gnupg stuff (everything stored in ~/.gnupg/, basically) and access this data with similar tools.
I don't really care about the proposed OpenOffice policy, as I don't use office suites myself, but if it's merged, I expect many discussions about stuff like "Should MUAs be allowed to access OO documents?".
[1] For example, on my systems there's a separate user account for online banking, and sensitive documents (mostly txt's and pdf's) are stored under my regular user account, but with a custom SELinux type that can only be accessed after transitioning via "newrole".
Regards,
Luis
PATCH 1/1 Apache OpenOffice module
In reply to Chris PeBenitoQuoted 57 lines · Chris PeBenito
Quoted 49 lines · Dominick Grift
Quoted 37 lines · Chris PeBenito
Quoted 27 lines · Dominick Grift
Quoted 19 lines · Chris PeBenito
Quoted 10 lines · Dominick Grift via refpolicy
Quoted 9 lines · Guido Trentalancia via refpolicy
This is a minimal patch that I am testing to support Apache OpenOffice
with its own module.The file contexts (and initial tests) are based on the default installation path for version 4 of the office suite.
Signed-off-by Guido Trentalancia <[email protected]>---
[...]
Quoted 6 lines
I am personally of the opinion that this module probably will not cut it
in the end. Basically because it's too limited, especially considering
that it uses dbus.Quoted 6 lines
I'm unclear what the purpose of this policy is. Users aren't going to expect this kind of limitation. They should be able to edit whatever their user domain has access to, i.e. the same reason vim doesn't have a
policy.Quoted 8 lines
vim is a text editor. open/libre office is a office suite.
I do not believe that anyone expects the latter to be able to manage config, data and cache files.
If you want to enforce some integrity on the desktop then you have to draw the line somewhere sometimes. I suppose that is what enforcing integrity is all about after all...
Quoted 5 lines
In this case, what integrity is being enforced? Integrity of the user data? That's not covered here as it can manage the user data. Maybe not the configs, but user data is of much more consequence. It's not preventing network access, particularly to http, so there's nothing preventing it from sending out the user data either.
I would argue that in a desktop system the most sensitive data is config, cache and data. So integrity should be enforced on this content. (e.g.) strictly restrict access to the private types of config, data and cache.
Quoted 6 lines
.gnupg is config, often it houses private key files. Only gnupg should be able to access this file directly. this key is like your identity. It has to be protected. .ssh is ssh-client config it might have private key files. These are like your authentication credentials and should be protected and only ssh client should have access to it. The gnome-keyring data has sensitive info and should be protected. Many
Quoted 7 lines
This alone is what convinces me to merge it. I still think that generic user data is still the highest priority by many magnitudes. If I had a copy of my tax forms or health info (or pick some other extremely personal, sensitive document) on my system, I would be FAR angrier if that was compromised, compared to my GPG key. GPG keys can be revoked and passwords can be changed.
A copy of those faxes is probably stored on some insecure site(s)/database(s) on the web, something you have little control over. I agree though that generic user content is often also sensitive, but many agents just want access to it, restricting that by default would seriously harm experience and probably lead to situations where trying to restrict it defaats the purpose. Instead consider encryption for this purpose
You can say that you can revoke keys and change passwords, but do consider that by then the harm may already have been done. And restoring "reputation" might not be as easy as it may seem. Also remember that the internet does not forget so easily.
Quoted 1 line
Signature · 11 lines
Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8 02D5 3B6C 5F1D 2C7B 6B02 https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02 Dominick Grift -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 648 bytes Desc: OpenPGP digital signature Url : http://oss.tresys.com/pipermail/refpolicy/attachments/20161202/12b7c3d5/attachment-0001.bin
PATCH 1/1 Apache OpenOffice module
Some questions came up to me caused by this patch:
1.) Why does OpenOffice needs all the files_getattr_all* permissions?
2.) What is the guideline whether guarding the execmem permission by a 'allow_execmem' block?
3.) What is the guideline where to put filecontexts with base types? This patch contains the additions
diff -pruN refpolicy-git-25112016-orig/policy/modules/system/libraries.fc refpolicy-git-25112016/policy/modules/system/libraries.fc
--- refpolicy-git-25112016-orig/policy/modules/system/libraries.fc
2016-08-14 21:24:48.961382244 +0200 +++ refpolicy-git-25112016/policy/modules/system/libraries.fc 2016-11-26 15:03:47.659294001 +0100
@@ -52,6 +52,8 @@ ifdef(distro_redhat',
/opt/(.*/)?jre.*/.+\.so(\.[^/]*)* --gen_context(system_u:object_r:textrel_shlib_t,s0)
/opt/(.*/)?jre/.+\.jar --gen_context(system_u:object_r:lib_t,s0)
+/opt/openoffice4/program/.+\.so(\.[^/]*)* --gen_context(system_u:object_r:lib_t,s0)
+
/opt/(.*/)?/RealPlayer/.+\.so(\.[^/]*)* --gen_context(system_u:object_r:textrel_shlib_t,s0)
# despite the extensions, they are actually libs /opt/Acrobat[5-9]/Reader/intellinux/plugins/.*\.api -- gen_context(system_u:object_r:lib_t,s0)
lib_t is defined in libraries.te so maybe it makes sense to put the filecontext into the belonging libraries.fc file.
But by this method the libraries.fc file (and also the corecommands.fc one) are quite big and might contain contexts no one will ever update or remove, because there is no obvious relationship to a module. Just my thoughts.
Kindly Regards,
Christian G?ttsche
PATCH 1/1 Apache OpenOffice module
Hello.
Quoted 3 lines · cgzones via refpolicy
Some questions came up to me caused by this patch:
1.) Why does OpenOffice needs all the files_getattr_all* permissions?
It is needed, for example, to select the email application in the options (Tools->Options->Internet->eMail). It is harmless.
Quoted 3 lines
2.) What is the guideline whether guarding the execmem permission by a
'allow_execmem' block?
The application won't start without the execmem permission, so it is pointless to enclose it in a tunable policy block.
Quoted 25 lines
3.) What is the guideline where to put filecontexts with base types? This patch contains the additions
diff -pruN refpolicy-git-25112016- orig/policy/modules/system/libraries.fc refpolicy-git-25112016/policy/modules/system/libraries.fc --- refpolicy-git-25112016-orig/policy/modules/system/libraries.fc ?2016-08-14 21:24:48.961382244 +0200
+++ refpolicy-git-25112016/policy/modules/system/libraries.fc2016-11-26 15:03:47.659294001 +0100(quoted diff) +0
-0@@ -52,6 +52,8 @@ ifdef(`distro_redhat',`?/opt/(.*/)?jre.*/.+\.so(\.[^/]*)*??????--
gen_context(system_u:object_r:textrel_shlib_t,s0)
?/opt/(.*/)?jre/.+\.jar?????????????????--gen_context(system_u:object_r:lib_t,s0)+/opt/openoffice4/program/.+\.so(\.[^/]*)*??????--
gen_context(system_u:object_r:lib_t,s0)
+
?/opt/(.*/)?/RealPlayer/.+\.so(\.[^/]*)* --gen_context(system_u:object_r:textrel_shlib_t,s0)?# despite the extensions, they are actually libs ?/opt/Acrobat[5-9]/Reader/intellinux/plugins/.*\.api --gen_context(system_u:object_r:lib_t,s0)
Quoted 7 lines
lib_tis defined in libraries.te so maybe it makes sense to put the filecontext into the belonging libraries.fc file.
But by this method the libraries.fc file (and also the corecommands.fc
one) are quite big and might contain contexts no one will ever update or remove, because there is no obvious relationship to a module. Just my thoughts.
I prefer to keep the file contexts in their proper place.
Quoted 2 lines
Kindly Regards,
??????Christian G?ttsche
Regards,
Guido
PATCH 1/1 Apache OpenOffice module
In reply to Chris PeBenitoHello Christopher.
Quoted 47 lines · Chris PeBenito via refpolicy
Quoted 37 lines · Dominick Grift
Quoted 24 lines · Chris PeBenito
Quoted 13 lines · Dominick Grift via refpolicy
Quoted 11 lines · Guido Trentalancia via refpolicy
This is a minimal patch that I am testing to support Apache OpenOffice
with its own module.The file contexts (and initial tests) are based on the default
installation path for version 4 of the office suite.Signed-off-by Guido Trentalancia <[email protected]>---
[...]
Quoted 7 lines
I am personally of the opinion that this module probably will not cut it
in the end. Basically because it's too limited, especially considering
that it uses dbus.Quoted 8 lines
I'm unclear what the purpose of this policy is.??Users aren't going to
expect this kind of limitation.??They should be able to edit whatever
their user domain has access to, i.e. the same reason vim doesn't have a
policy.vim is a text editor. open/libre office is a office suite.
Quoted 8 lines
I do not believe that anyone expects the latter to be able to manage
config, data and cache files.If you want to enforce some integrity on the desktop then you have to
draw the line somewhere sometimes. I suppose that is what enforcing integrity is all about after all...
Quoted 8 lines
In this case, what integrity is being enforced???Integrity of the user?
data???That's not covered here as it can manage the user data.??Maybe?
not the configs, but user data is of much more consequence.??It's not?
preventing network access, particularly to http, so there's nothing? preventing it from sending out the user data either.
The latter is very easy to change, as a boolean can be used to enable/disable software updates...
I can create a new version of the patch with such feature.
When all other applications are confined and ready to move on, we can update the policy related to the management of user data (and/or configuration).
At the moment, as a first step, it is better for usability and a smoother transition if it inherits the ability to manage user files from the unprivileged user domain.
Regards,
Guido
PATCH v4 1/1 Apache OpenOffice module
In reply to Chris PeBenitoThis is a minimal patch that I am testing to support Apache OpenOffice with its own module.
The file contexts (and initial tests) are based on the default installation path for version 4 of the office suite.
It includes revisions from Dominick Grift.
Since the third version it should correctly manage files in home directories and allow some other major functionality.
The fourth version of the patch introduces a boolean to enable or disable software updates from the network (application and/or extensions).
--- policy/modules/contrib/openoffice.fc | 30 +++++++++ policy/modules/contrib/openoffice.if | 48 +++++++++++++++ policy/modules/contrib/openoffice.te | 107 +++++++++++++++++++++++++++++++++++ policy/modules/roles/staff.te | 4 + policy/modules/roles/sysadm.te | 4 + policy/modules/roles/unprivuser.te | 4 + policy/modules/services/xserver.if | 19 ++++++ policy/modules/system/libraries.fc | 2 8 files changed, 218 insertions(+)
policy/modules/contrib/openoffice.fc +30 -0
@@ -0,0 +1,30 @@ +HOME_DIR/\.openoffice(/.*)? gen_context(system_u:object_r:ooffice_home_t,s0) + +/opt/openoffice4/program/cde-open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/gnome-open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/gnome-open-url\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/javaldx -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/kde-open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/pagein -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/regcomp\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/regmerge -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/regview -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/sbase -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/scalc -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/sdraw -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/senddoc -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/simpress -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/smath -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/soffice -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/soffice\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/spadmin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/spadmin\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/startup\.sh -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/swriter -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/uno\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/unoinfo -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/unopkg -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/unopkg\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/unpack_update -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/uri-encode -- gen_context(system_u:object_r:ooffice_exec_t,s0)
policy/modules/contrib/openoffice.if +48 -0
48 lines not on this page · raw message
policy/modules/contrib/openoffice.te +107 -0
107 lines not on this page · raw message
policy/modules/roles/staff.te +4 -0
@@ -141,6 +141,10 @@ ifndef(`distro_redhat',` ') optional_policy(` + ooffice_role(staff_r, staff_t) + ') + + optional_policy(` pyzor_role(staff_r, staff_t) ')
policy/modules/roles/sysadm.te +4 -0
@@ -721,6 +721,10 @@ optional_policy(` ') optional_policy(` + ooffice_role(sysadm_r, sysadm_t) +') + +optional_policy(` openct_admin(sysadm_t, sysadm_r) ')
policy/modules/roles/unprivuser.te +4 -0
@@ -114,6 +114,10 @@ ifndef(`distro_redhat',` ') optional_policy(` + ooffice_role(user_r, user_t) + ') + + optional_policy(` postgresql_role(user_r, user_t) ')
policy/modules/services/xserver.if +19 -0
@@ -602,6 +602,25 @@ interface(`xserver_read_user_xauth',` ######################################## ## <summary> +## Read all users .ICEauthority. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`xserver_read_user_iceauth',` + gen_require(` + type iceauth_home_t; + ') + + allow $1 iceauth_home_t:file read_file_perms; + userdom_search_user_home_dirs($1) +') + +######################################## +## <summary> ## Set the attributes of the X windows console named pipes. ## </summary> ## <param name="domain">
policy/modules/system/libraries.fc +2 -0
@@ -52,6 +52,8 @@ ifdef(`distro_redhat',` /opt/(.*/)?jre.*/.+\.so(\.[^/]*)* -- gen_context(system_u:object_r:textrel_shlib_t,s0) /opt/(.*/)?jre/.+\.jar -- gen_context(system_u:object_r:lib_t,s0) +/opt/openoffice4/program/.+\.so(\.[^/]*)* -- gen_context(system_u:object_r:lib_t,s0) + /opt/(.*/)?/RealPlayer/.+\.so(\.[^/]*)* -- gen_context(system_u:object_r:textrel_shlib_t,s0) # despite the extensions, they are actually libs /opt/Acrobat[5-9]/Reader/intellinux/plugins/.*\.api -- gen_context(system_u:object_r:lib_t,s0)
PATCH v4 1/1 Apache OpenOffice module
Quoted 6 lines · Guido Trentalancia via refpolicy
This is a minimal patch that I am testing to support Apache OpenOffice with its own module.
The file contexts (and initial tests) are based on the default installation path for version 4 of the office suite.
Quoted 8 lines
It includes revisions from Dominick Grift.
Since the third version it should correctly manage files in home directories and allow some other major functionality.
The fourth version of the patch introduces a boolean to enable or disable software updates from the network (application and/or extensions).
I'm ok merging this, but it will have to be split into separate base and contrib patches.
Quoted 297 lines
Signed-off-by Guido Trentalancia <[email protected]>--- policy/modules/contrib/openoffice.fc | 30 +++++++++ policy/modules/contrib/openoffice.if | 48 +++++++++++++++ policy/modules/contrib/openoffice.te | 107 +++++++++++++++++++++++++++++++++++ policy/modules/roles/staff.te | 4 + policy/modules/roles/sysadm.te | 4 + policy/modules/roles/unprivuser.te | 4 + policy/modules/services/xserver.if | 19 ++++++ policy/modules/system/libraries.fc | 2 8 files changed, 218 insertions(+)diff -pruN refpolicy-git-25112016-orig/policy/modules/contrib/openoffice.fc refpolicy-git-25112016/policy/modules/contrib/openoffice.fc
policy/modules/contrib/openoffice.fc +30
-0@@ -0,0 +1,30 @@ +HOME_DIR/\.openoffice(/.*)? gen_context(system_u:object_r:ooffice_home_t,s0) + +/opt/openoffice4/program/cde-open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/gnome-open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/gnome-open-url\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/javaldx -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/kde-open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/pagein -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/regcomp\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/regmerge -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/regview -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/sbase -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/scalc -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/sdraw -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/senddoc -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/simpress -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/smath -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/soffice -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/soffice\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/spadmin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/spadmin\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/startup\.sh -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/swriter -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/uno\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/unoinfo -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/unopkg -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/unopkg\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/unpack_update -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/uri-encode -- gen_context(system_u:object_r:ooffice_exec_t,s0)diff -pruN refpolicy-git-25112016-orig/policy/modules/contrib/openoffice.if refpolicy-git-25112016/policy/modules/contrib/openoffice.if
policy/modules/contrib/openoffice.if +48
-0@@ -0,0 +1,48 @@ +## <summary>Openoffice suite.</summary> + +############################################################ +## <summary> +## Role access for openoffice. +## </summary> +## <param name="role"> +## <summary> +## Role allowed access. +## </summary> +## </param> +## <param name="domain"> +## <summary> +## User domain for the role. +## </summary> +## </param> +# +interface(`ooffice_role',` + gen_require(` + attribute_role ooffice_roles; + type ooffice_t, ooffice_exec_t; + ') + + roleattribute $1 ooffice_roles; + + domtrans_pattern($2, ooffice_exec_t, ooffice_t) + + allow $2 ooffice_t:process { ptrace signal_perms }; + ps_process_pattern($2, ooffice_t) +') + +######################################## +## <summary> +## Run openoffice in its own domain. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed to transition. +## </summary> +## </param> +# +interface(`ooffice_domtrans',` + gen_require(` + type ooffice_t, ooffice_exec_t; + ') + + domtrans_pattern($1, ooffice_exec_t, ooffice_t) +')diff -pruN refpolicy-git-25112016-orig/policy/modules/contrib/openoffice.te refpolicy-git-25112016/policy/modules/contrib/openoffice.te
policy/modules/contrib/openoffice.te +107
-0@@ -0,0 +1,107 @@ +policy_module(openoffice, 1.0.0) + +############################## +# +# Declarations +# + +## <desc> +## <p> +## Determine whether openoffice can +## download software updates from the +## network (application and/or +## extensions). +## </p> +## </desc> +gen_tunable(openoffice_allow_update, true) + +attribute_role ooffice_roles; + +type ooffice_t; +type ooffice_exec_t; +userdom_user_application_domain(ooffice_t, ooffice_exec_t) +role ooffice_roles types ooffice_t; + +type ooffice_home_t; +userdom_user_home_content(ooffice_home_t) + +type ooffice_tmp_t; +files_tmp_file(ooffice_tmp_t) + +############################## +# +# Openoffice local policy +# + +allow ooffice_t self:process { execmem getsched signal }; +allow ooffice_t self:shm create_shm_perms; +allow ooffice_t self:fifo_file rw_fifo_file_perms; +allow ooffice_t self:unix_stream_socket connectto; + +allow ooffice_t ooffice_home_t:dir manage_dir_perms; +allow ooffice_t ooffice_home_t:file manage_file_perms; +allow ooffice_t ooffice_home_t:lnk_file manage_lnk_file_perms; +userdom_user_home_dir_filetrans(ooffice_t, ooffice_home_t, dir, ".openoffice") + +manage_dirs_pattern(ooffice_t, ooffice_tmp_t, ooffice_tmp_t) +manage_files_pattern(ooffice_t, ooffice_tmp_t, ooffice_tmp_t) +manage_sock_files_pattern(ooffice_t, ooffice_tmp_t, ooffice_tmp_t) +files_tmp_filetrans(ooffice_t, ooffice_tmp_t, { dir file sock_file }) + +can_exec(ooffice_t, ooffice_exec_t) + +corecmd_exec_bin(ooffice_t) +corecmd_exec_shell(ooffice_t) + +dev_read_sysfs(ooffice_t) +dev_read_urand(ooffice_t) + +files_getattr_all_dirs(ooffice_t) +files_getattr_all_files(ooffice_t) +files_getattr_all_symlinks(ooffice_t) +files_read_etc_files(ooffice_t) +files_read_usr_files(ooffice_t) + +fs_getattr_xattr_fs(ooffice_t) + +miscfiles_read_fonts(ooffice_t) +miscfiles_read_localization(ooffice_t) + +sysnet_dns_name_resolve(ooffice_t) + +userdom_manage_user_home_content_dirs(ooffice_t) +userdom_manage_user_home_content_files(ooffice_t) +userdom_manage_user_home_content_symlinks(ooffice_t) +userdom_user_home_dir_filetrans_user_home_content(ooffice_t, { dir file lnk_file fifo_file sock_file }) + +tunable_policy(`openoffice_allow_update',` + corenet_tcp_connect_http_port(ooffice_t) +') + +optional_policy(` + cups_read_config(ooffice_t) + cups_stream_connect(ooffice_t) +') + +optional_policy(` + dbus_all_session_bus_client(ooffice_t) +') + +optional_policy(` + hostname_exec(ooffice_t) +') + +optional_policy(` + java_exec(ooffice_t) +') + +optional_policy(` + mozilla_domtrans(ooffice_t) +') + +optional_policy(` + xserver_read_user_iceauth(ooffice_t) + xserver_read_user_xauth(ooffice_t) + xserver_read_xdm_tmp_files(ooffice_t) + xserver_stream_connect(ooffice_t) +')diff -pruN refpolicy-git-25112016-orig/policy/modules/roles/staff.te refpolicy-git-25112016/policy/modules/roles/staff.te
policy/modules/roles/staff.te +4
-0@@ -141,6 +141,10 @@ ifndef(`distro_redhat',` ') optional_policy(` + ooffice_role(staff_r, staff_t) + ') + + optional_policy(` pyzor_role(staff_r, staff_t) ')diff -pruN refpolicy-git-25112016-orig/policy/modules/roles/sysadm.te refpolicy-git-25112016/policy/modules/roles/sysadm.te
policy/modules/roles/sysadm.te +4
-0@@ -721,6 +721,10 @@ optional_policy(` ') optional_policy(` + ooffice_role(sysadm_r, sysadm_t) +') + +optional_policy(` openct_admin(sysadm_t, sysadm_r) ')diff -pruN refpolicy-git-25112016-orig/policy/modules/roles/unprivuser.te refpolicy-git-25112016/policy/modules/roles/unprivuser.te
policy/modules/roles/unprivuser.te +4
-0@@ -114,6 +114,10 @@ ifndef(`distro_redhat',` ') optional_policy(` + ooffice_role(user_r, user_t) + ') + + optional_policy(` postgresql_role(user_r, user_t) ')diff -pruN refpolicy-git-25112016-orig/policy/modules/services/xserver.if refpolicy-git-25112016/policy/modules/services/xserver.if
policy/modules/services/xserver.if +19
-0@@ -602,6 +602,25 @@ interface(`xserver_read_user_xauth',` ######################################## ## <summary> +## Read all users .ICEauthority. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`xserver_read_user_iceauth',` + gen_require(` + type iceauth_home_t; + ') + + allow $1 iceauth_home_t:file read_file_perms; + userdom_search_user_home_dirs($1) +') + +######################################## +## <summary> ## Set the attributes of the X windows console named pipes. ## </summary> ## <param name="domain">diff -pruN refpolicy-git-25112016-orig/policy/modules/system/libraries.fc refpolicy-git-25112016/policy/modules/system/libraries.fc
policy/modules/system/libraries.fc +2
-0@@ -52,6 +52,8 @@ ifdef(`distro_redhat',` /opt/(.*/)?jre.*/.+\.so(\.[^/]*)* -- gen_context(system_u:object_r:textrel_shlib_t,s0) /opt/(.*/)?jre/.+\.jar -- gen_context(system_u:object_r:lib_t,s0) +/opt/openoffice4/program/.+\.so(\.[^/]*)* -- gen_context(system_u:object_r:lib_t,s0) + /opt/(.*/)?/RealPlayer/.+\.so(\.[^/]*)* -- gen_context(system_u:object_r:textrel_shlib_t,s0) # despite the extensions, they are actually libs /opt/Acrobat[5-9]/Reader/intellinux/plugins/.*\.api -- gen_context(system_u:object_r:lib_t,s0)_______________________________________________
refpolicy mailing list
refpolicy at oss.tresys.com
http://oss.tresys.com/mailman/listinfo/refpolicy
Signature · 1 line
Chris PeBenito
PATCH v5 1/2 Apache OpenOffice module (base policy part)
This is a minimal patch that I am testing to support Apache OpenOffice with its own module (base policy part, 1/2).
The file contexts (and initial tests) are based on the default installation path for version 4 of the office suite.
Since the second version it includes revisions from Dominick Grift.
Since the third version it should correctly manage files in home directories and allow some other major functionality.
The fourth version of the patch introduces a boolean to enable or disable software updates from the network (application and/or extensions).
This fifth version of the patch adds the ability to connect to the X display manager (XDM) using Unix domain sockets (interface xserver_stream_connect_xdm()). Also the fifth version splits the whole patch into separate base policy / contrib policy patches as required.
--- policy/modules/roles/staff.te | 4 ++++ policy/modules/roles/sysadm.te | 4 ++++ policy/modules/roles/unprivuser.te | 4 ++++ policy/modules/services/xserver.if | 19 +++++++++++++++++++ policy/modules/system/libraries.fc | 2 ++ 5 files changed, 33 insertions(+)
policy/modules/roles/staff.te +4 -0
@@ -141,6 +141,10 @@ ifndef(`distro_redhat',` ') optional_policy(` + ooffice_role(staff_r, staff_t) + ') + + optional_policy(` pyzor_role(staff_r, staff_t) ')
policy/modules/roles/sysadm.te +4 -0
@@ -721,6 +721,10 @@ optional_policy(` ') optional_policy(` + ooffice_role(sysadm_r, sysadm_t) +') + +optional_policy(` openct_admin(sysadm_t, sysadm_r) ')
policy/modules/roles/unprivuser.te +4 -0
@@ -114,6 +114,10 @@ ifndef(`distro_redhat',` ') optional_policy(` + ooffice_role(user_r, user_t) + ') + + optional_policy(` postgresql_role(user_r, user_t) ')
policy/modules/services/xserver.if +19 -0
@@ -602,6 +602,25 @@ interface(`xserver_read_user_xauth',` ######################################## ## <summary> +## Read all users .ICEauthority. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`xserver_read_user_iceauth',` + gen_require(` + type iceauth_home_t; + ') + + allow $1 iceauth_home_t:file read_file_perms; + userdom_search_user_home_dirs($1) +') + +######################################## +## <summary> ## Set the attributes of the X windows console named pipes. ## </summary> ## <param name="domain">
policy/modules/system/libraries.fc +2 -0
@@ -52,6 +52,8 @@ ifdef(`distro_redhat',` /opt/(.*/)?jre.*/.+\.so(\.[^/]*)* -- gen_context(system_u:object_r:textrel_shlib_t,s0) /opt/(.*/)?jre/.+\.jar -- gen_context(system_u:object_r:lib_t,s0) +/opt/openoffice4/program/.+\.so(\.[^/]*)* -- gen_context(system_u:object_r:lib_t,s0) + /opt/(.*/)?/RealPlayer/.+\.so(\.[^/]*)* -- gen_context(system_u:object_r:textrel_shlib_t,s0) # despite the extensions, they are actually libs /opt/Acrobat[5-9]/Reader/intellinux/plugins/.*\.api -- gen_context(system_u:object_r:lib_t,s0)
PATCH v6 1/2 Apache OpenOffice module (base policy part)
This is a patch that I have created and tested to support Apache OpenOffice with its own module (base policy part, 1/2).
The file contexts (and initial tests) are based on the default installation path for version 4 of the office suite.
Since the second version it includes revisions from Dominick Grift.
Since the third version it should correctly manage files in home directories and allow some other major functionality.
The fourth version of the patch introduces a boolean to enable or disable software updates from the network (application and/or extensions).
The fifth version of the patch adds the ability to connect to the X display manager (XDM) using Unix domain sockets (interface xserver_stream_connect_xdm()). Also the fifth version splits the whole patch into separate base policy / contrib policy patches as required.
This sixth version of this patch removes obsolete executable permission from the unconfined module.
--- policy/modules/roles/staff.te | 4 ++++ policy/modules/roles/sysadm.te | 4 ++++ policy/modules/roles/unprivuser.te | 4 ++++ policy/modules/services/xserver.if | 19 +++++++++++++++++++ policy/modules/system/libraries.fc | 2 ++ policy/modules/system/unconfined.fc | 1 - 6 files changed, 33 insertions(+), 1 deletion(-)
policy/modules/roles/staff.te +4 -0
@@ -141,6 +142,10 @@ ifndef(`distro_redhat',` ') optional_policy(` + ooffice_role(staff_r, staff_t) + ') + + optional_policy(` pyzor_role(staff_r, staff_t) ')
policy/modules/roles/sysadm.te +4 -0
@@ -721,6 +721,10 @@ optional_policy(` ') optional_policy(` + ooffice_role(sysadm_r, sysadm_t) +') + +optional_policy(` openct_admin(sysadm_t, sysadm_r) ')
policy/modules/roles/unprivuser.te +4 -0
@@ -114,6 +115,10 @@ ifndef(`distro_redhat',` ') optional_policy(` + ooffice_role(user_r, user_t) + ') + + optional_policy(` postgresql_role(user_r, user_t) ')
policy/modules/services/xserver.if +19 -0
@@ -602,6 +602,25 @@ interface(`xserver_read_user_xauth',` ######################################## ## <summary> +## Read all users .ICEauthority. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`xserver_read_user_iceauth',` + gen_require(` + type iceauth_home_t; + ') + + allow $1 iceauth_home_t:file read_file_perms; + userdom_search_user_home_dirs($1) +') + +######################################## +## <summary> ## Set the attributes of the X windows console named pipes. ## </summary> ## <param name="domain">
policy/modules/system/libraries.fc +2 -0
@@ -52,6 +52,8 @@ ifdef(`distro_redhat',` /opt/(.*/)?jre.*/.+\.so(\.[^/]*)* -- gen_context(system_u:object_r:textrel_shlib_t,s0) /opt/(.*/)?jre/.+\.jar -- gen_context(system_u:object_r:lib_t,s0) +/opt/openoffice4/program/.+\.so(\.[^/]*)* -- gen_context(system_u:object_r:lib_t,s0) + /opt/(.*/)?/RealPlayer/.+\.so(\.[^/]*)* -- gen_context(system_u:object_r:textrel_shlib_t,s0) # despite the extensions, they are actually libs /opt/Acrobat[5-9]/Reader/intellinux/plugins/.*\.api -- gen_context(system_u:object_r:lib_t,s0)
policy/modules/system/unconfined.fc +0 -1
@@ -6,7 +6,6 @@ /usr/bin/vncserver -- gen_context(system_u:object_r:unconfined_exec_t,s0) /usr/lib/ia32el/ia32x_loader -- gen_context(system_u:object_r:unconfined_execmem_exec_t,s0) -/usr/lib/openoffice\.org.*/program/.+\.bin -- gen_context(system_u:object_r:unconfined_execmem_exec_t,s0) /usr/local/RealPlayer/realplay\.bin -- gen_context(system_u:object_r:unconfined_execmem_exec_t,s0)
PATCH v7 1/2 Apache OpenOffice module (base policy part)
This is a patch that I have created and tested to support Apache OpenOffice with its own module (base policy part, 1/2).
The file contexts (and initial tests) are based on the default installation path for version 4 of the office suite.
Since the second version it includes revisions from Dominick Grift.
Since the third version it should correctly manage files in home directories and allow some other major functionality.
The fourth version of the patch introduces a boolean to enable or disable software updates from the network (application and/or extensions).
The fifth version of the patch adds the ability to connect to the X display manager (XDM) using Unix domain sockets (interface xserver_stream_connect_xdm()). Also the fifth version splits the whole patch into separate base policy / contrib policy patches as required.
The sixth version of this patch removes obsolete executable permission from the unconfined module.
This seventh version brings no changes in the base part of the patch.
--- policy/modules/roles/staff.te | 4 ++++ policy/modules/roles/sysadm.te | 4 ++++ policy/modules/roles/unprivuser.te | 4 ++++ policy/modules/services/xserver.if | 19 +++++++++++++++++++ policy/modules/system/libraries.fc | 2 ++ policy/modules/system/unconfined.fc | 1 - 6 files changed, 33 insertions(+), 1 deletion(-)
policy/modules/roles/staff.te +4 -0
@@ -141,6 +142,10 @@ ifndef(`distro_redhat',` ') optional_policy(` + ooffice_role(staff_r, staff_t) + ') + + optional_policy(` pyzor_role(staff_r, staff_t) ')
policy/modules/roles/sysadm.te +4 -0
@@ -721,6 +721,10 @@ optional_policy(` ') optional_policy(` + ooffice_role(sysadm_r, sysadm_t) +') + +optional_policy(` openct_admin(sysadm_t, sysadm_r) ')
policy/modules/roles/unprivuser.te +4 -0
@@ -114,6 +115,10 @@ ifndef(`distro_redhat',` ') optional_policy(` + ooffice_role(user_r, user_t) + ') + + optional_policy(` postgresql_role(user_r, user_t) ')
policy/modules/services/xserver.if +19 -0
@@ -602,6 +602,25 @@ interface(`xserver_read_user_xauth',` ######################################## ## <summary> +## Read all users .ICEauthority. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`xserver_read_user_iceauth',` + gen_require(` + type iceauth_home_t; + ') + + allow $1 iceauth_home_t:file read_file_perms; + userdom_search_user_home_dirs($1) +') + +######################################## +## <summary> ## Set the attributes of the X windows console named pipes. ## </summary> ## <param name="domain">
policy/modules/system/libraries.fc +2 -0
@@ -52,6 +52,8 @@ ifdef(`distro_redhat',` /opt/(.*/)?jre.*/.+\.so(\.[^/]*)* -- gen_context(system_u:object_r:textrel_shlib_t,s0) /opt/(.*/)?jre/.+\.jar -- gen_context(system_u:object_r:lib_t,s0) +/opt/openoffice4/program/.+\.so(\.[^/]*)* -- gen_context(system_u:object_r:lib_t,s0) + /opt/(.*/)?/RealPlayer/.+\.so(\.[^/]*)* -- gen_context(system_u:object_r:textrel_shlib_t,s0) # despite the extensions, they are actually libs /opt/Acrobat[5-9]/Reader/intellinux/plugins/.*\.api -- gen_context(system_u:object_r:lib_t,s0)
policy/modules/system/unconfined.fc +0 -1
@@ -6,7 +6,6 @@ /usr/bin/vncserver -- gen_context(system_u:object_r:unconfined_exec_t,s0) /usr/lib/ia32el/ia32x_loader -- gen_context(system_u:object_r:unconfined_execmem_exec_t,s0) -/usr/lib/openoffice\.org.*/program/.+\.bin -- gen_context(system_u:object_r:unconfined_execmem_exec_t,s0) /usr/local/RealPlayer/realplay\.bin -- gen_context(system_u:object_r:unconfined_execmem_exec_t,s0)
PATCH v8 1/2 Apache OpenOffice module (base policy part)
This is a patch that I have created and tested to support Apache OpenOffice with its own module (base policy part, 1/2).
The file contexts (and initial tests) are based on the default installation path for version 4 of the office suite.
Since the second version it includes revisions from Dominick Grift.
Since the third version it should correctly manage files in home directories and allow some other major functionality.
The fourth version of the patch introduces a boolean to enable or disable software updates from the network (application and/or extensions).
The fifth version of the patch adds the ability to connect to the X display manager (XDM) using Unix domain sockets (interface xserver_stream_connect_xdm()). Also the fifth version splits the whole patch into separate base policy / contrib policy patches as required.
The sixth version of this patch removes obsolete executable permission from the unconfined module.
The seventh and eighth versions brings no changes in the base part of the patch.
All released versions are safe to apply, each new version just brings improved application functionality and better integration with other desktop applications.
--- policy/modules/roles/staff.te | 4 ++++ policy/modules/roles/sysadm.te | 4 ++++ policy/modules/roles/unprivuser.te | 4 ++++ policy/modules/services/xserver.if | 19 +++++++++++++++++++ policy/modules/system/libraries.fc | 2 ++ policy/modules/system/unconfined.fc | 1 - 6 files changed, 33 insertions(+), 1 deletion(-)
policy/modules/roles/staff.te +4 -0
@@ -141,6 +142,10 @@ ifndef(`distro_redhat',` ') optional_policy(` + ooffice_role(staff_r, staff_t) + ') + + optional_policy(` pyzor_role(staff_r, staff_t) ')
policy/modules/roles/sysadm.te +4 -0
@@ -721,6 +721,10 @@ optional_policy(` ') optional_policy(` + ooffice_role(sysadm_r, sysadm_t) +') + +optional_policy(` openct_admin(sysadm_t, sysadm_r) ')
policy/modules/roles/unprivuser.te +4 -0
@@ -114,6 +115,10 @@ ifndef(`distro_redhat',` ') optional_policy(` + ooffice_role(user_r, user_t) + ') + + optional_policy(` postgresql_role(user_r, user_t) ')
policy/modules/services/xserver.if +19 -0
@@ -602,6 +602,25 @@ interface(`xserver_read_user_xauth',` ######################################## ## <summary> +## Read all users .ICEauthority. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`xserver_read_user_iceauth',` + gen_require(` + type iceauth_home_t; + ') + + allow $1 iceauth_home_t:file read_file_perms; + userdom_search_user_home_dirs($1) +') + +######################################## +## <summary> ## Set the attributes of the X windows console named pipes. ## </summary> ## <param name="domain">
policy/modules/system/libraries.fc +2 -0
@@ -52,6 +52,8 @@ ifdef(`distro_redhat',` /opt/(.*/)?jre.*/.+\.so(\.[^/]*)* -- gen_context(system_u:object_r:textrel_shlib_t,s0) /opt/(.*/)?jre/.+\.jar -- gen_context(system_u:object_r:lib_t,s0) +/opt/openoffice4/program/.+\.so(\.[^/]*)* -- gen_context(system_u:object_r:lib_t,s0) + /opt/(.*/)?/RealPlayer/.+\.so(\.[^/]*)* -- gen_context(system_u:object_r:textrel_shlib_t,s0) # despite the extensions, they are actually libs /opt/Acrobat[5-9]/Reader/intellinux/plugins/.*\.api -- gen_context(system_u:object_r:lib_t,s0)
policy/modules/system/unconfined.fc +0 -1
@@ -6,7 +6,6 @@ /usr/bin/vncserver -- gen_context(system_u:object_r:unconfined_exec_t,s0) /usr/lib/ia32el/ia32x_loader -- gen_context(system_u:object_r:unconfined_execmem_exec_t,s0) -/usr/lib/openoffice\.org.*/program/.+\.bin -- gen_context(system_u:object_r:unconfined_execmem_exec_t,s0) /usr/local/RealPlayer/realplay\.bin -- gen_context(system_u:object_r:unconfined_execmem_exec_t,s0)
PATCH v9 1/2 Apache OpenOffice module (base policy part)
This is a patch that I have created and tested to support Apache OpenOffice with its own module (base policy part, 1/2).
The file contexts (and initial tests) are based on the default installation path for version 4 of the office suite.
Since the second version it includes revisions from Dominick Grift.
Since the third version it should correctly manage files in home directories and allow some other major functionality.
The fourth version of the patch introduces a boolean to enable or disable software updates from the network (application and/or extensions).
The fifth version of the patch adds the ability to connect to the X display manager (XDM) using Unix domain sockets (interface xserver_stream_connect_xdm()). Also the fifth version splits the whole patch into separate base policy / contrib policy patches as required.
The sixth version of this patch removes obsolete executable permission from the unconfined module.
The seventh, eighth and nineth versions brings no changes in the base part of the patch.
All released versions are safe to apply, each new version just brings improved application functionality and better integration with other desktop applications.
--- policy/modules/roles/staff.te | 4 ++++ policy/modules/roles/sysadm.te | 4 ++++ policy/modules/roles/unprivuser.te | 4 ++++ policy/modules/services/xserver.if | 19 +++++++++++++++++++ policy/modules/system/libraries.fc | 2 ++ policy/modules/system/unconfined.fc | 1 - 6 files changed, 33 insertions(+), 1 deletion(-)
policy/modules/roles/staff.te +4 -0
@@ -141,6 +142,10 @@ ifndef(`distro_redhat',` ') optional_policy(` + ooffice_role(staff_r, staff_t) + ') + + optional_policy(` pyzor_role(staff_r, staff_t) ')
policy/modules/roles/sysadm.te +4 -0
@@ -721,6 +721,10 @@ optional_policy(` ') optional_policy(` + ooffice_role(sysadm_r, sysadm_t) +') + +optional_policy(` openct_admin(sysadm_t, sysadm_r) ')
policy/modules/roles/unprivuser.te +4 -0
@@ -114,6 +115,10 @@ ifndef(`distro_redhat',` ') optional_policy(` + ooffice_role(user_r, user_t) + ') + + optional_policy(` postgresql_role(user_r, user_t) ')
policy/modules/services/xserver.if +19 -0
@@ -602,6 +602,25 @@ interface(`xserver_read_user_xauth',` ######################################## ## <summary> +## Read all users .ICEauthority. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`xserver_read_user_iceauth',` + gen_require(` + type iceauth_home_t; + ') + + allow $1 iceauth_home_t:file read_file_perms; + userdom_search_user_home_dirs($1) +') + +######################################## +## <summary> ## Set the attributes of the X windows console named pipes. ## </summary> ## <param name="domain">
policy/modules/system/libraries.fc +2 -0
@@ -52,6 +52,8 @@ ifdef(`distro_redhat',` /opt/(.*/)?jre.*/.+\.so(\.[^/]*)* -- gen_context(system_u:object_r:textrel_shlib_t,s0) /opt/(.*/)?jre/.+\.jar -- gen_context(system_u:object_r:lib_t,s0) +/opt/openoffice4/program/.+\.so(\.[^/]*)* -- gen_context(system_u:object_r:lib_t,s0) + /opt/(.*/)?/RealPlayer/.+\.so(\.[^/]*)* -- gen_context(system_u:object_r:textrel_shlib_t,s0) # despite the extensions, they are actually libs /opt/Acrobat[5-9]/Reader/intellinux/plugins/.*\.api -- gen_context(system_u:object_r:lib_t,s0)
policy/modules/system/unconfined.fc +0 -1
@@ -6,7 +6,6 @@ /usr/bin/vncserver -- gen_context(system_u:object_r:unconfined_exec_t,s0) /usr/lib/ia32el/ia32x_loader -- gen_context(system_u:object_r:unconfined_execmem_exec_t,s0) -/usr/lib/openoffice\.org.*/program/.+\.bin -- gen_context(system_u:object_r:unconfined_execmem_exec_t,s0) /usr/local/RealPlayer/realplay\.bin -- gen_context(system_u:object_r:unconfined_execmem_exec_t,s0)
PATCH v5 2/2 Apache OpenOffice module (contrib policy part)
In reply to Chris PeBenitoThis is a minimal patch that I am testing to support Apache OpenOffice with its own module (contrib policy part, 2/2).
The file contexts (and initial tests) are based on the default installation path for version 4 of the office suite.
Since the second version it includes revisions from Dominick Grift.
Since the third version it should correctly manage files in home directories and allow some other major functionality.
The fourth version of the patch introduces a boolean to enable or disable software updates from the network (application and/or extensions).
This fifth version of the patch adds the ability to connect to the X display manager (XDM) using Unix domain sockets (interface xserver_stream_connect_xdm()). Also the fifth version splits the whole patch into separate base policy / contrib policy patches as required.
It should be noted that this patch can be probably adapted very easily to also support version 3 (at least), by simply adding duplicate file contexts (~/.openoffice.org in addition to ~/openoffice for ooffice_home_t and /opt/openoffice.org in addition to /opt/openoffice4 for the default installation path): however, this has not been tested.
--- policy/modules/contrib/openoffice.fc | 30 +++++++++ policy/modules/contrib/openoffice.if | 48 +++++++++++++++ policy/modules/contrib/openoffice.te | 108 +++++++++++++++++++++++++++++++++++ 3 files changed, 186 insertions(+)
policy/modules/contrib/openoffice.fc +30 -0
@@ -0,0 +1,30 @@ +HOME_DIR/\.openoffice(/.*)? gen_context(system_u:object_r:ooffice_home_t,s0) + +/opt/openoffice4/program/cde-open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/gnome-open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/gnome-open-url\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/javaldx -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/kde-open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/pagein -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/regcomp\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/regmerge -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/regview -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/sbase -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/scalc -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/sdraw -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/senddoc -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/simpress -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/smath -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/soffice -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/soffice\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/spadmin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/spadmin\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/startup\.sh -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/swriter -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/uno\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/unoinfo -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/unopkg -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/unopkg\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/unpack_update -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice4/program/uri-encode -- gen_context(system_u:object_r:ooffice_exec_t,s0)
policy/modules/contrib/openoffice.if +48 -0
48 lines not on this page · raw message
policy/modules/contrib/openoffice.te +108 -0
108 lines not on this page · raw message
PATCH v6 2/2 Apache OpenOffice module (contrib policy part)
This is a patch that I have created and tested to support Apache OpenOffice with its own module (contrib policy part, 2/2).
The file contexts (and initial tests) are based on the default installation path for version 4 of the office suite.
Since the second version it includes revisions from Dominick Grift.
Since the third version it should correctly manage files in home directories and allow some other major functionality.
The fourth version of the patch introduces a boolean to enable or disable software updates from the network (application and/or extensions).
The fifth version of the patch adds the ability to connect to the X display manager (XDM) using Unix domain sockets (interface xserver_stream_connect_xdm()). Also the fifth version splits the whole patch into separate base policy / contrib policy patches as required.
This sixth version of the patch adds the ability to run the evolution email application.
Although this patch has only been tested with Apache OpenOffice version 4, it might also work with earlier versions (in particular version 3) or at least it can be easily adapted for the purpose.
--- policy/modules/contrib/evolution.if | 20 +++++ policy/modules/contrib/openoffice.fc | 30 ++++++++ policy/modules/contrib/openoffice.if | 48 ++++++++++++++ policy/modules/contrib/openoffice.te | 117 +++++++++++++++++++++++++++++++++++ 4 files changed, 215 insertions(+)
policy/modules/contrib/evolution.if +20 -0
@@ -188,3 +188,23 @@ interface(`evolution_alarm_dbus_chat',` allow $1 evolution_alarm_t:dbus send_msg; allow evolution_alarm_t $1:dbus send_msg; ') + +######################################## +## <summary> +## Make a domain transition to the +## evolution target domain. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`evolution_domtrans',` + gen_require(` + type evolution_t, evolution_exec_t; + ') + + corecmd_search_bin($1) + domtrans_pattern($1, evolution_exec_t, evolution_t); +')
policy/modules/contrib/openoffice.fc +30 -0
@@ -0,0 +1,30 @@ +HOME_DIR/\.openoffice(\.org)?(/.*)? gen_context(system_u:object_r:ooffice_home_t,s0) + +/opt/openoffice(.*)?/program/cde-open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/gnome-open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/gnome-open-url\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/javaldx -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/kde-open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/pagein -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/regcomp\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/regmerge -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/regview -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/sbase -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/scalc -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/sdraw -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/senddoc -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/simpress -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/smath -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/soffice -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/soffice\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/spadmin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/spadmin\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/startup\.sh -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/swriter -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/uno\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/unoinfo -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/unopkg -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/unopkg\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/unpack_update -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/uri-encode -- gen_context(system_u:object_r:ooffice_exec_t,s0)
policy/modules/contrib/openoffice.if +48 -0
48 lines not on this page · raw message
policy/modules/contrib/openoffice.te +117 -0
117 lines not on this page · raw message
PATCH v7 2/2 Apache OpenOffice module (contrib policy part)
This is a patch that I have created and tested to support Apache OpenOffice with its own module (contrib policy part, 2/2).
The file contexts (and initial tests) are based on the default installation path for version 4 of the office suite.
Since the second version it includes revisions from Dominick Grift.
Since the third version it should correctly manage files in home directories and allow some other major functionality.
The fourth version of the patch introduces a boolean to enable or disable software updates from the network (application and/or extensions).
The fifth version of the patch adds the ability to connect to the X display manager (XDM) using Unix domain sockets (interface xserver_stream_connect_xdm()). Also the fifth version splits the whole patch into separate base policy / contrib policy patches as required.
The sixth version of the patch adds the ability to run the evolution email application.
This seventh version of the patch, improves the integration with the evolution email application.
Although this patch has only been tested with Apache OpenOffice version 4, it might also work with earlier versions (in particular version 3) or at least it can be easily adapted for the purpose.
--- policy/modules/contrib/evolution.if | 38 +++++++++++ policy/modules/contrib/evolution.te | 5 + policy/modules/contrib/openoffice.fc | 30 ++++++++ policy/modules/contrib/openoffice.if | 67 +++++++++++++++++++ policy/modules/contrib/openoffice.te | 118 +++++++++++++++++++++++++++++++++++ 5 files changed, 258 insertions(+)
policy/modules/contrib/evolution.if +38 -0
@@ -107,6 +107,24 @@ interface(`evolution_home_filetrans',` ######################################## ## <summary> +## Read evolution home files. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`evolution_read_evolution_home_files',` + gen_require(` + type evolution_t, evolution_home_t; + ') + + read_files_pattern($1, evolution_home_t, evolution_home_t) +') + +######################################## +## <summary> ## Connect to evolution using a unix ## domain stream socket. ## </summary>
@@ -188,3 +206,23 @@ interface(`evolution_alarm_dbus_chat',` allow $1 evolution_alarm_t:dbus send_msg; allow evolution_alarm_t $1:dbus send_msg; ') + +######################################## +## <summary> +## Make a domain transition to the +## evolution target domain. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`evolution_domtrans',` + gen_require(` + type evolution_t, evolution_exec_t; + ') + + corecmd_search_bin($1) + domtrans_pattern($1, evolution_exec_t, evolution_t); +')
policy/modules/contrib/evolution.te +5 -0
@@ -270,6 +270,11 @@ optional_policy(` ') optional_policy(` + ooffice_domtrans(evolution_t) + ooffice_rw_ooffice_tmp_files(evolution_t) +') + +optional_policy(` spamassassin_exec_spamd(evolution_t) spamassassin_domtrans_client(evolution_t) spamassassin_domtrans_local_client(evolution_t)
policy/modules/contrib/openoffice.fc +30 -0
@@ -0,0 +1,30 @@ +HOME_DIR/\.openoffice(\.org)?(/.*)? gen_context(system_u:object_r:ooffice_home_t,s0) + +/opt/openoffice(.*)?/program/cde-open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/gnome-open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/gnome-open-url\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/javaldx -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/kde-open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/pagein -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/regcomp\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/regmerge -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/regview -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/sbase -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/scalc -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/sdraw -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/senddoc -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/simpress -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/smath -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/soffice -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/soffice\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/spadmin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/spadmin\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/startup\.sh -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/swriter -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/uno\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/unoinfo -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/unopkg -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/unopkg\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/unpack_update -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/uri-encode -- gen_context(system_u:object_r:ooffice_exec_t,s0)
policy/modules/contrib/openoffice.if +67 -0
67 lines not on this page · raw message
policy/modules/contrib/openoffice.te +118 -0
118 lines not on this page · raw message
PATCH v7 2/2 Apache OpenOffice module (contrib policy part)
Quoted 24 lines · Guido Trentalancia via refpolicy
This is a patch that I have created and tested to support Apache OpenOffice with its own module (contrib policy part, 2/2).
The file contexts (and initial tests) are based on the default installation path for version 4 of the office suite.
Since the second version it includes revisions from Dominick Grift.
Since the third version it should correctly manage files in home directories and allow some other major functionality.
The fourth version of the patch introduces a boolean to enable or disable software updates from the network (application and/or extensions).
The fifth version of the patch adds the ability to connect to the X display manager (XDM) using Unix domain sockets (interface
xserver_stream_connect_xdm()). Also the fifth version splits the whole patch into separate base policy / contrib policy patches as required.The sixth version of the patch adds the ability to run the evolution email application.
Quoted 6 lines
This seventh version of the patch, improves the integration with the evolution email application.
Although this patch has only been tested with Apache OpenOffice version 4, it might also work with earlier versions (in particular version 3) or at least it can be easily adapted for the purpose.
Are you still working on this? I was about to merge v6 when this appeared.
Quoted 308 lines
Signed-off-by Guido Trentalancia <[email protected]>--- policy/modules/contrib/evolution.if | 38 +++++++++++ policy/modules/contrib/evolution.te | 5 + policy/modules/contrib/openoffice.fc | 30 ++++++++ policy/modules/contrib/openoffice.if | 67 +++++++++++++++++++ policy/modules/contrib/openoffice.te | 118 +++++++++++++++++++++++++++++++++++ 5 files changed, 258 insertions(+)diff -pruN refpolicy-git-25112016-orig/policy/modules/contrib/evolution.if refpolicy-git-25112016/policy/modules/contrib/evolution.if
policy/modules/contrib/evolution.if +38
-0@@ -107,6 +107,24 @@ interface(`evolution_home_filetrans',` ######################################## ## <summary> +## Read evolution home files. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`evolution_read_evolution_home_files',` + gen_require(` + type evolution_t, evolution_home_t; + ') + + read_files_pattern($1, evolution_home_t, evolution_home_t) +') + +######################################## +## <summary> ## Connect to evolution using a unix ## domain stream socket. ## </summary>@@ -188,3 +206,23 @@ interface(`evolution_alarm_dbus_chat',` allow $1 evolution_alarm_t:dbus send_msg; allow evolution_alarm_t $1:dbus send_msg; ') + +######################################## +## <summary> +## Make a domain transition to the +## evolution target domain. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`evolution_domtrans',` + gen_require(` + type evolution_t, evolution_exec_t; + ') + + corecmd_search_bin($1) + domtrans_pattern($1, evolution_exec_t, evolution_t); +')diff -pruN refpolicy-git-25112016-orig/policy/modules/contrib/evolution.te refpolicy-git-25112016/policy/modules/contrib/evolution.te
policy/modules/contrib/evolution.te +5
-0@@ -270,6 +270,11 @@ optional_policy(` ') optional_policy(` + ooffice_domtrans(evolution_t) + ooffice_rw_ooffice_tmp_files(evolution_t) +') + +optional_policy(` spamassassin_exec_spamd(evolution_t) spamassassin_domtrans_client(evolution_t) spamassassin_domtrans_local_client(evolution_t)diff -pruN refpolicy-git-25112016-orig/policy/modules/contrib/openoffice.fc refpolicy-git-25112016/policy/modules/contrib/openoffice.fc
policy/modules/contrib/openoffice.fc +30
-0@@ -0,0 +1,30 @@ +HOME_DIR/\.openoffice(\.org)?(/.*)? gen_context(system_u:object_r:ooffice_home_t,s0) + +/opt/openoffice(.*)?/program/cde-open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/gnome-open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/gnome-open-url\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/javaldx -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/kde-open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/pagein -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/regcomp\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/regmerge -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/regview -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/sbase -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/scalc -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/sdraw -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/senddoc -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/simpress -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/smath -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/soffice -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/soffice\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/spadmin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/spadmin\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/startup\.sh -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/swriter -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/uno\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/unoinfo -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/unopkg -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/unopkg\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/unpack_update -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/uri-encode -- gen_context(system_u:object_r:ooffice_exec_t,s0)diff -pruN refpolicy-git-25112016-orig/policy/modules/contrib/openoffice.if refpolicy-git-25112016/policy/modules/contrib/openoffice.if
policy/modules/contrib/openoffice.if +67
-0@@ -0,0 +1,67 @@ +## <summary>Openoffice suite.</summary> + +############################################################ +## <summary> +## Role access for openoffice. +## </summary> +## <param name="role"> +## <summary> +## Role allowed access. +## </summary> +## </param> +## <param name="domain"> +## <summary> +## User domain for the role. +## </summary> +## </param> +# +interface(`ooffice_role',` + gen_require(` + attribute_role ooffice_roles; + type ooffice_t, ooffice_exec_t; + ') + + roleattribute $1 ooffice_roles; + + domtrans_pattern($2, ooffice_exec_t, ooffice_t) + + allow $2 ooffice_t:process { ptrace signal_perms }; + ps_process_pattern($2, ooffice_t) +') + +######################################## +## <summary> +## Run openoffice in its own domain. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed to transition. +## </summary> +## </param> +# +interface(`ooffice_domtrans',` + gen_require(` + type ooffice_t, ooffice_exec_t; + ') + + domtrans_pattern($1, ooffice_exec_t, ooffice_t) +') + +######################################## +## <summary> +## Read and write temporary +## openoffice files. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`ooffice_rw_ooffice_tmp_files',` + gen_require(` + type ooffice_tmp_t; + ') + + rw_files_pattern($1, ooffice_tmp_t, ooffice_tmp_t) +')diff -pruN refpolicy-git-25112016-orig/policy/modules/contrib/openoffice.te refpolicy-git-25112016/policy/modules/contrib/openoffice.te
policy/modules/contrib/openoffice.te +118
-0@@ -0,0 +1,118 @@ +policy_module(openoffice, 1.0.0) + +############################## +# +# Declarations +# + +## <desc> +## <p> +## Determine whether openoffice can +## download software updates from the +## network (application and/or +## extensions). +## </p> +## </desc> +gen_tunable(openoffice_allow_update, true) + +attribute_role ooffice_roles; + +type ooffice_t; +type ooffice_exec_t; +userdom_user_application_domain(ooffice_t, ooffice_exec_t) +role ooffice_roles types ooffice_t; + +type ooffice_home_t; +userdom_user_home_content(ooffice_home_t) + +type ooffice_tmp_t; +files_tmp_file(ooffice_tmp_t) + +############################## +# +# Openoffice local policy +# + +allow ooffice_t self:process { execmem getsched signal }; +allow ooffice_t self:shm create_shm_perms; +allow ooffice_t self:fifo_file rw_fifo_file_perms; +allow ooffice_t self:unix_stream_socket connectto; + +allow ooffice_t ooffice_home_t:dir manage_dir_perms; +allow ooffice_t ooffice_home_t:file manage_file_perms; +allow ooffice_t ooffice_home_t:lnk_file manage_lnk_file_perms; +userdom_user_home_dir_filetrans(ooffice_t, ooffice_home_t, dir, ".openoffice") + +manage_dirs_pattern(ooffice_t, ooffice_tmp_t, ooffice_tmp_t) +manage_files_pattern(ooffice_t, ooffice_tmp_t, ooffice_tmp_t) +manage_sock_files_pattern(ooffice_t, ooffice_tmp_t, ooffice_tmp_t) +files_tmp_filetrans(ooffice_t, ooffice_tmp_t, { dir file sock_file }) + +can_exec(ooffice_t, ooffice_exec_t) + +corecmd_exec_bin(ooffice_t) +corecmd_exec_shell(ooffice_t) + +dev_read_sysfs(ooffice_t) +dev_read_urand(ooffice_t) + +files_getattr_all_dirs(ooffice_t) +files_getattr_all_files(ooffice_t) +files_getattr_all_symlinks(ooffice_t) +files_read_etc_files(ooffice_t) +files_read_usr_files(ooffice_t) + +fs_getattr_xattr_fs(ooffice_t) + +miscfiles_read_fonts(ooffice_t) +miscfiles_read_localization(ooffice_t) + +sysnet_dns_name_resolve(ooffice_t) + +userdom_dontaudit_exec_user_home_content_files(ooffice_t) +userdom_manage_user_home_content_dirs(ooffice_t) +userdom_manage_user_home_content_files(ooffice_t) +userdom_manage_user_home_content_symlinks(ooffice_t) +userdom_user_home_dir_filetrans_user_home_content(ooffice_t, { dir file lnk_file fifo_file sock_file }) + +tunable_policy(`openoffice_allow_update',` + corenet_tcp_connect_http_port(ooffice_t) +') + +optional_policy(` + cups_read_config(ooffice_t) + cups_stream_connect(ooffice_t) +') + +optional_policy(` + dbus_all_session_bus_client(ooffice_t) +') + +optional_policy(` + evolution_domtrans(ooffice_t) + evolution_read_evolution_home_files(ooffice_t) +') + +optional_policy(` + hostname_exec(ooffice_t) +') + +optional_policy(` + java_exec(ooffice_t) +') + +optional_policy(` + mozilla_domtrans(ooffice_t) +') + +optional_policy(` + thunderbird_domtrans(ooffice_t) +') + +optional_policy(` + xserver_read_user_iceauth(ooffice_t) + xserver_read_user_xauth(ooffice_t) + xserver_read_xdm_tmp_files(ooffice_t) + xserver_stream_connect(ooffice_t) + xserver_stream_connect_xdm(ooffice_t) +')_______________________________________________
refpolicy mailing list
refpolicy at oss.tresys.com
http://oss.tresys.com/mailman/listinfo/refpolicy
Signature · 1 line
Chris PeBenito
PATCH v7 2/2 Apache OpenOffice module (contrib policy part)
You can safely merge both patches.
Thanks,
Guido
Quoted 408 lines · On the 4th of December 2016 18:51:44 CET, Chris PeBenito <[email protected]>…
Quoted 24 lines · Guido Trentalancia via refpolicy
This is a patch that I have created and tested to support Apache OpenOffice with its own module (contrib policy part, 2/2).
The file contexts (and initial tests) are based on the default installation path for version 4 of the office suite.
Since the second version it includes revisions from Dominick Grift.
Since the third version it should correctly manage files in home directories and allow some other major functionality.
The fourth version of the patch introduces a boolean to enable or disable software updates from the network (application and/or extensions).
The fifth version of the patch adds the ability to connect to the X display manager (XDM) using Unix domain sockets (interface
xserver_stream_connect_xdm()). Also the fifth version splits the whole patch into separate base policy / contrib policy patches as required.The sixth version of the patch adds the ability to run the evolution email application.
Quoted 6 lines
This seventh version of the patch, improves the integration with the evolution email application.
Although this patch has only been tested with Apache OpenOffice version 4, it might also work with earlier versions (in particular version 3) or at least it can be easily adapted for the purpose.
Are you still working on this? I was about to merge v6 when this appeared.
Quoted 7 lines
Signed-off-by Guido Trentalancia <[email protected]>--- policy/modules/contrib/evolution.if | 38 +++++++++++ policy/modules/contrib/evolution.te | 5 + policy/modules/contrib/openoffice.fc | 30 ++++++++ policy/modules/contrib/openoffice.if | 67 +++++++++++++++++++ policy/modules/contrib/openoffice.te | 118+++++++++++++++++++++++++++++++++++
Quoted 3 lines
5 files changed, 258 insertions(+)diff -pruN
refpolicy-git-25112016-orig/policy/modules/contrib/evolution.if refpolicy-git-25112016/policy/modules/contrib/evolution.if
Quoted 1 line
---
refpolicy-git-25112016-orig/policy/modules/contrib/evolution.if 2016-12-04
16:02:48.317069925 +0100Quoted 1 line
+++
refpolicy-git-25112016/policy/modules/contrib/evolution.if 2016-12-04
16:03:37.777350810 +0100Quoted 49 lines
policy/modules/contrib/evolution.if +38
-0@@ -107,6 +107,24 @@ interface(`evolution_home_filetrans',` ######################################## ## <summary> +## Read evolution home files. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`evolution_read_evolution_home_files',` + gen_require(` + type evolution_t, evolution_home_t; + ') + + read_files_pattern($1, evolution_home_t, evolution_home_t) +') + +######################################## +## <summary> ## Connect to evolution using a unix ## domain stream socket. ## </summary>@@ -188,3 +206,23 @@ interface(`evolution_alarm_dbus_chat',` allow $1 evolution_alarm_t:dbus send_msg; allow evolution_alarm_t $1:dbus send_msg; ') + +######################################## +## <summary> +## Make a domain transition to the +## evolution target domain. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`evolution_domtrans',` + gen_require(` + type evolution_t, evolution_exec_t; + ') + + corecmd_search_bin($1) + domtrans_pattern($1, evolution_exec_t, evolution_t); +')Quoted 1 line
diff -pruN
refpolicy-git-25112016-orig/policy/modules/contrib/evolution.te refpolicy-git-25112016/policy/modules/contrib/evolution.te
Quoted 1 line
---
refpolicy-git-25112016-orig/policy/modules/contrib/evolution.te 2016-12-04
15:48:16.164030673 +0100Quoted 1 line
+++
refpolicy-git-25112016/policy/modules/contrib/evolution.te 2016-12-04
15:48:37.116534261 +0100Quoted 12 lines
policy/modules/contrib/evolution.te +5
-0@@ -270,6 +270,11 @@ optional_policy(` ') optional_policy(` + ooffice_domtrans(evolution_t) + ooffice_rw_ooffice_tmp_files(evolution_t) +') + +optional_policy(` spamassassin_exec_spamd(evolution_t) spamassassin_domtrans_client(evolution_t) spamassassin_domtrans_local_client(evolution_t)Quoted 1 line
diff -pruN
refpolicy-git-25112016-orig/policy/modules/contrib/openoffice.fc refpolicy-git-25112016/policy/modules/contrib/openoffice.fc
Quoted 1 line
---
refpolicy-git-25112016-orig/policy/modules/contrib/openoffice.fc 1970-01-01
01:00:00.000000000 +0100Quoted 1 line
+++
refpolicy-git-25112016/policy/modules/contrib/openoffice.fc 2016-12-04
14:34:22.734742098 +0100Review
Quoted 2 lines
(quoted diff) +0
-0@@ -0,0 +1,30 @@+HOME_DIR/\.openoffice(\.org)?(/.*)?
gen_context(system_u:object_r:ooffice_home_t,s0)Review line 1
Quoted 2 lines
(quoted diff) +1
-0++/opt/openoffice(.*)?/program/cde-open-url --
gen_context(system_u:object_r:ooffice_exec_t,s0)Quoted 1 line
+/opt/openoffice(.*)?/program/gnome-open-url --
gen_context(system_u:object_r:ooffice_exec_t,s0)Quoted 1 line
+/opt/openoffice(.*)?/program/gnome-open-url\.bin --
gen_context(system_u:object_r:ooffice_exec_t,s0)Quoted 1 line
+/opt/openoffice(.*)?/program/javaldx --
gen_context(system_u:object_r:ooffice_exec_t,s0)Quoted 1 line
+/opt/openoffice(.*)?/program/kde-open-url --
gen_context(system_u:object_r:ooffice_exec_t,s0)Quoted 1 line
+/opt/openoffice(.*)?/program/open-url --
gen_context(system_u:object_r:ooffice_exec_t,s0)Quoted 1 line
+/opt/openoffice(.*)?/program/pagein --
gen_context(system_u:object_r:ooffice_exec_t,s0)Quoted 1 line
+/opt/openoffice(.*)?/program/regcomp\.bin --
gen_context(system_u:object_r:ooffice_exec_t,s0)Quoted 1 line
+/opt/openoffice(.*)?/program/regmerge --
gen_context(system_u:object_r:ooffice_exec_t,s0)Quoted 1 line
+/opt/openoffice(.*)?/program/regview --
gen_context(system_u:object_r:ooffice_exec_t,s0)Quoted 1 line
+/opt/openoffice(.*)?/program/sbase --
gen_context(system_u:object_r:ooffice_exec_t,s0)Quoted 1 line
+/opt/openoffice(.*)?/program/scalc --
gen_context(system_u:object_r:ooffice_exec_t,s0)Quoted 1 line
+/opt/openoffice(.*)?/program/sdraw --
gen_context(system_u:object_r:ooffice_exec_t,s0)Quoted 1 line
+/opt/openoffice(.*)?/program/senddoc --
gen_context(system_u:object_r:ooffice_exec_t,s0)Quoted 1 line
+/opt/openoffice(.*)?/program/simpress --
gen_context(system_u:object_r:ooffice_exec_t,s0)Quoted 1 line
+/opt/openoffice(.*)?/program/smath --
gen_context(system_u:object_r:ooffice_exec_t,s0)Quoted 1 line
+/opt/openoffice(.*)?/program/soffice --
gen_context(system_u:object_r:ooffice_exec_t,s0)Quoted 1 line
+/opt/openoffice(.*)?/program/soffice\.bin --
gen_context(system_u:object_r:ooffice_exec_t,s0)Quoted 1 line
+/opt/openoffice(.*)?/program/spadmin --
gen_context(system_u:object_r:ooffice_exec_t,s0)Quoted 1 line
+/opt/openoffice(.*)?/program/spadmin\.bin --
gen_context(system_u:object_r:ooffice_exec_t,s0)Quoted 1 line
+/opt/openoffice(.*)?/program/startup\.sh --
gen_context(system_u:object_r:ooffice_exec_t,s0)Quoted 1 line
+/opt/openoffice(.*)?/program/swriter --
gen_context(system_u:object_r:ooffice_exec_t,s0)Quoted 1 line
+/opt/openoffice(.*)?/program/uno\.bin --
gen_context(system_u:object_r:ooffice_exec_t,s0)Quoted 1 line
+/opt/openoffice(.*)?/program/unoinfo --
gen_context(system_u:object_r:ooffice_exec_t,s0)Quoted 1 line
+/opt/openoffice(.*)?/program/unopkg --
gen_context(system_u:object_r:ooffice_exec_t,s0)Quoted 1 line
+/opt/openoffice(.*)?/program/unopkg\.bin --
gen_context(system_u:object_r:ooffice_exec_t,s0)Quoted 1 line
+/opt/openoffice(.*)?/program/unpack_update --
gen_context(system_u:object_r:ooffice_exec_t,s0)Quoted 1 line
+/opt/openoffice(.*)?/program/uri-encode --
gen_context(system_u:object_r:ooffice_exec_t,s0)Quoted 1 line
diff -pruN
refpolicy-git-25112016-orig/policy/modules/contrib/openoffice.if refpolicy-git-25112016/policy/modules/contrib/openoffice.if
Quoted 1 line
---
refpolicy-git-25112016-orig/policy/modules/contrib/openoffice.if 1970-01-01
01:00:00.000000000 +0100Quoted 1 line
+++
refpolicy-git-25112016/policy/modules/contrib/openoffice.if 2016-12-04
15:36:53.136278874 +0100Quoted 68 lines
policy/modules/contrib/openoffice.if +67
-0@@ -0,0 +1,67 @@ +## <summary>Openoffice suite.</summary> + +############################################################ +## <summary> +## Role access for openoffice. +## </summary> +## <param name="role"> +## <summary> +## Role allowed access. +## </summary> +## </param> +## <param name="domain"> +## <summary> +## User domain for the role. +## </summary> +## </param> +# +interface(`ooffice_role',` + gen_require(` + attribute_role ooffice_roles; + type ooffice_t, ooffice_exec_t; + ') + + roleattribute $1 ooffice_roles; + + domtrans_pattern($2, ooffice_exec_t, ooffice_t) + + allow $2 ooffice_t:process { ptrace signal_perms }; + ps_process_pattern($2, ooffice_t) +') + +######################################## +## <summary> +## Run openoffice in its own domain. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed to transition. +## </summary> +## </param> +# +interface(`ooffice_domtrans',` + gen_require(` + type ooffice_t, ooffice_exec_t; + ') + + domtrans_pattern($1, ooffice_exec_t, ooffice_t) +') + +######################################## +## <summary> +## Read and write temporary +## openoffice files. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`ooffice_rw_ooffice_tmp_files',` + gen_require(` + type ooffice_tmp_t; + ') + + rw_files_pattern($1, ooffice_tmp_t, ooffice_tmp_t) +')Quoted 1 line
diff -pruN
refpolicy-git-25112016-orig/policy/modules/contrib/openoffice.te refpolicy-git-25112016/policy/modules/contrib/openoffice.te
Quoted 1 line
---
refpolicy-git-25112016-orig/policy/modules/contrib/openoffice.te 1970-01-01
01:00:00.000000000 +0100Quoted 1 line
+++
refpolicy-git-25112016/policy/modules/contrib/openoffice.te 2016-12-04
16:05:06.872422860 +0100Quoted 35 lines
policy/modules/contrib/openoffice.te +34
-0@@ -0,0 +1,118 @@ +policy_module(openoffice, 1.0.0) + +############################## +# +# Declarations +# + +## <desc> +## <p> +## Determine whether openoffice can +## download software updates from the +## network (application and/or +## extensions). +## </p> +## </desc> +gen_tunable(openoffice_allow_update, true) + +attribute_role ooffice_roles; + +type ooffice_t; +type ooffice_exec_t; +userdom_user_application_domain(ooffice_t, ooffice_exec_t) +role ooffice_roles types ooffice_t; + +type ooffice_home_t; +userdom_user_home_content(ooffice_home_t) + +type ooffice_tmp_t; +files_tmp_file(ooffice_tmp_t) + +############################## +# +# Openoffice local policy +#policy/modules/contrib/openoffice.te line 44
Quoted 10 lines
policy/modules/contrib/openoffice.te +10
-0+ +allow ooffice_t self:process { execmem getsched signal }; +allow ooffice_t self:shm create_shm_perms; +allow ooffice_t self:fifo_file rw_fifo_file_perms; +allow ooffice_t self:unix_stream_socket connectto; + +allow ooffice_t ooffice_home_t:dir manage_dir_perms; +allow ooffice_t ooffice_home_t:file manage_file_perms; +allow ooffice_t ooffice_home_t:lnk_file manage_lnk_file_perms; +userdom_user_home_dir_filetrans(ooffice_t, ooffice_home_t, dir,".openoffice")
policy/modules/contrib/openoffice.te
Quoted 5 lines
policy/modules/contrib/openoffice.te +5
-0+ +manage_dirs_pattern(ooffice_t, ooffice_tmp_t, ooffice_tmp_t) +manage_files_pattern(ooffice_t, ooffice_tmp_t, ooffice_tmp_t) +manage_sock_files_pattern(ooffice_t, ooffice_tmp_t, ooffice_tmp_t) +files_tmp_filetrans(ooffice_t, ooffice_tmp_t, { dir file sock_file})
Quoted 17 lines
policy/modules/contrib/openoffice.te +17
-0+ +can_exec(ooffice_t, ooffice_exec_t) + +corecmd_exec_bin(ooffice_t) +corecmd_exec_shell(ooffice_t) + +dev_read_sysfs(ooffice_t) +dev_read_urand(ooffice_t) + +files_getattr_all_dirs(ooffice_t) +files_getattr_all_files(ooffice_t) +files_getattr_all_symlinks(ooffice_t) +files_read_etc_files(ooffice_t) +files_read_usr_files(ooffice_t) + +fs_getattr_xattr_fs(ooffice_t) +policy/modules/contrib/openoffice.te
Quoted 10 lines
policy/modules/contrib/openoffice.te +10
-0+miscfiles_read_fonts(ooffice_t) +miscfiles_read_localization(ooffice_t) + +sysnet_dns_name_resolve(ooffice_t) + +userdom_dontaudit_exec_user_home_content_files(ooffice_t) +userdom_manage_user_home_content_dirs(ooffice_t) +userdom_manage_user_home_content_files(ooffice_t) +userdom_manage_user_home_content_symlinks(ooffice_t) +userdom_user_home_dir_filetrans_user_home_content(ooffice_t, { dirfile
lnk_filefifo_filesock_file})Quoted 47 lines
policy/modules/contrib/openoffice.te +42
-0+ +tunable_policy(`openoffice_allow_update',` + corenet_tcp_connect_http_port(ooffice_t) +') + +optional_policy(` + cups_read_config(ooffice_t) + cups_stream_connect(ooffice_t) +') + +optional_policy(` + dbus_all_session_bus_client(ooffice_t) +') + +optional_policy(` + evolution_domtrans(ooffice_t) + evolution_read_evolution_home_files(ooffice_t) +') + +optional_policy(` + hostname_exec(ooffice_t) +') + +optional_policy(` + java_exec(ooffice_t) +') + +optional_policy(` + mozilla_domtrans(ooffice_t) +') + +optional_policy(` + thunderbird_domtrans(ooffice_t) +') + +optional_policy(` + xserver_read_user_iceauth(ooffice_t) + xserver_read_user_xauth(ooffice_t) + xserver_read_xdm_tmp_files(ooffice_t) + xserver_stream_connect(ooffice_t) + xserver_stream_connect_xdm(ooffice_t) +')_______________________________________________
refpolicy mailing list
refpolicy at oss.tresys.com
http://oss.tresys.com/mailman/listinfo/refpolicy
PATCH v8 2/2 Apache OpenOffice module (contrib policy part)
In reply to Guido TrentalanciaThis is a patch that I have created and tested to support Apache OpenOffice with its own module (contrib policy part, 2/2).
The file contexts (and initial tests) are based on the default installation path for version 4 of the office suite.
Since the second version it includes revisions from Dominick Grift.
Since the third version it should correctly manage files in home directories and allow some other major functionality.
The fourth version of the patch introduces a boolean to enable or disable software updates from the network (application and/or extensions).
The fifth version of the patch adds the ability to connect to the X display manager (XDM) using Unix domain sockets (interface xserver_stream_connect_xdm()). Also the fifth version splits the whole patch into separate base policy / contrib policy patches as required.
The sixth version of the patch adds the ability to run the evolution email application.
The seventh version of the patch, improves the integration with the evolution email application.
This eighth version of the patch, adds the support for integration with mozilla and improves the integration with thunderbird.
All released versions are safe to apply, each new version just brings improved application functionality and better integration with other desktop applications.
Although this patch has only been tested with Apache OpenOffice version 4, it might also work with earlier versions (in particular version 3) or at least it can be easily adapted for the purpose.
--- policy/modules/contrib/evolution.if | 38 ++++++++++ policy/modules/contrib/evolution.te | 5 + policy/modules/contrib/mozilla.te | 5 + policy/modules/contrib/openoffice.fc | 30 ++++++++ policy/modules/contrib/openoffice.if | 67 +++++++++++++++++++ policy/modules/contrib/openoffice.te | 118 ++++++++++++++++++++++++++++++++++ policy/modules/contrib/thunderbird.te | 5 + 7 files changed, 268 insertions(+)
policy/modules/contrib/evolution.if +38 -0
@@ -107,6 +107,24 @@ interface(`evolution_home_filetrans',` ######################################## ## <summary> +## Read evolution home files. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`evolution_read_evolution_home_files',` + gen_require(` + type evolution_t, evolution_home_t; + ') + + read_files_pattern($1, evolution_home_t, evolution_home_t) +') + +######################################## +## <summary> ## Connect to evolution using a unix ## domain stream socket. ## </summary>
@@ -188,3 +206,23 @@ interface(`evolution_alarm_dbus_chat',` allow $1 evolution_alarm_t:dbus send_msg; allow evolution_alarm_t $1:dbus send_msg; ') + +######################################## +## <summary> +## Make a domain transition to the +## evolution target domain. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`evolution_domtrans',` + gen_require(` + type evolution_t, evolution_exec_t; + ') + + corecmd_search_bin($1) + domtrans_pattern($1, evolution_exec_t, evolution_t); +')
policy/modules/contrib/evolution.te +5 -0
@@ -270,6 +270,11 @@ optional_policy(` ') optional_policy(` + ooffice_domtrans(evolution_t) + ooffice_rw_ooffice_tmp_files(evolution_t) +') + +optional_policy(` spamassassin_exec_spamd(evolution_t) spamassassin_domtrans_client(evolution_t) spamassassin_domtrans_local_client(evolution_t)
policy/modules/contrib/mozilla.te +5 -0
@@ -296,6 +296,11 @@ optional_policy(` ') optional_policy(` + ooffice_domtrans(mozilla_t) + ooffice_rw_ooffice_tmp_files(mozilla_t) +') + +optional_policy(` pulseaudio_run(mozilla_t, mozilla_roles) pulseaudio_rw_tmpfs_files(mozilla_t) pulseaudio_use_fds(mozilla_t)
policy/modules/contrib/openoffice.fc +30 -0
@@ -0,0 +1,30 @@ +HOME_DIR/\.openoffice(\.org)?(/.*)? gen_context(system_u:object_r:ooffice_home_t,s0) + +/opt/openoffice(.*)?/program/cde-open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/gnome-open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/gnome-open-url\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/javaldx -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/kde-open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/pagein -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/regcomp\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/regmerge -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/regview -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/sbase -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/scalc -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/sdraw -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/senddoc -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/simpress -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/smath -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/soffice -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/soffice\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/spadmin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/spadmin\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/startup\.sh -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/swriter -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/uno\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/unoinfo -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/unopkg -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/unopkg\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/unpack_update -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/uri-encode -- gen_context(system_u:object_r:ooffice_exec_t,s0)
policy/modules/contrib/openoffice.if +67 -0
67 lines not on this page · raw message
policy/modules/contrib/openoffice.te +118 -0
118 lines not on this page · raw message
policy/modules/contrib/thunderbird.te +5 -0
@@ -166,3 +166,8 @@ optional_policy(` mozilla_read_user_home_files(thunderbird_t) mozilla_domtrans(thunderbird_t) ') + +optional_policy(` + ooffice_domtrans(thunderbird_t) + ooffice_rw_ooffice_tmp_files(thunderbird_t) +')
PATCH v9 2/2 Apache OpenOffice module (contrib policy part)
This is a patch that I have created and tested to support Apache OpenOffice with its own module (contrib policy part, 2/2).
The file contexts (and initial tests) are based on the default installation path for version 4 of the office suite.
Since the second version it includes revisions from Dominick Grift.
Since the third version it should correctly manage files in home directories and allow some other major functionality.
The fourth version of the patch introduces a boolean to enable or disable software updates from the network (application and/or extensions).
The fifth version of the patch adds the ability to connect to the X display manager (XDM) using Unix domain sockets (interface xserver_stream_connect_xdm()). Also the fifth version splits the whole patch into separate base policy / contrib policy patches as required.
The sixth version of the patch adds the ability to run the evolution email application.
The seventh version of the patch, improves the integration with the evolution email application.
The eighth version of the patch, adds the support for integration with mozilla and improves the integration with thunderbird.
This nineth version of the patch, avoids auditing some denial messages.
All released versions are safe to apply, each new version just brings improved application functionality and better integration with other desktop applications.
Although this patch has only been tested with Apache OpenOffice version 4, it might also work with earlier versions (in particular version 3) or at least it can be easily adapted for the purpose.
--- policy/modules/contrib/evolution.if | 38 ++++++++++ policy/modules/contrib/evolution.te | 5 + policy/modules/contrib/mozilla.te | 5 + policy/modules/contrib/openoffice.fc | 30 ++++++++ policy/modules/contrib/openoffice.if | 88 ++++++++++++++++++++++++ policy/modules/contrib/openoffice.te | 120 ++++++++++++++++++++++++++++++++++ policy/modules/contrib/thunderbird.te | 5 + 7 files changed, 291 insertions(+)
policy/modules/contrib/evolution.if +38 -0
@@ -107,6 +107,24 @@ interface(`evolution_home_filetrans',` ######################################## ## <summary> +## Read evolution home files. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`evolution_read_evolution_home_files',` + gen_require(` + type evolution_t, evolution_home_t; + ') + + read_files_pattern($1, evolution_home_t, evolution_home_t) +') + +######################################## +## <summary> ## Connect to evolution using a unix ## domain stream socket. ## </summary>
@@ -188,3 +206,23 @@ interface(`evolution_alarm_dbus_chat',` allow $1 evolution_alarm_t:dbus send_msg; allow evolution_alarm_t $1:dbus send_msg; ') + +######################################## +## <summary> +## Make a domain transition to the +## evolution target domain. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`evolution_domtrans',` + gen_require(` + type evolution_t, evolution_exec_t; + ') + + corecmd_search_bin($1) + domtrans_pattern($1, evolution_exec_t, evolution_t); +')
policy/modules/contrib/evolution.te +5 -0
@@ -270,6 +270,11 @@ optional_policy(` ') optional_policy(` + ooffice_domtrans(evolution_t) + ooffice_rw_ooffice_tmp_files(evolution_t) +') + +optional_policy(` spamassassin_exec_spamd(evolution_t) spamassassin_domtrans_client(evolution_t) spamassassin_domtrans_local_client(evolution_t)
policy/modules/contrib/mozilla.te +5 -0
@@ -296,6 +296,11 @@ optional_policy(` ') optional_policy(` + ooffice_domtrans(mozilla_t) + ooffice_rw_ooffice_tmp_files(mozilla_t) +') + +optional_policy(` pulseaudio_run(mozilla_t, mozilla_roles) pulseaudio_rw_tmpfs_files(mozilla_t) pulseaudio_use_fds(mozilla_t)
policy/modules/contrib/openoffice.fc +30 -0
@@ -0,0 +1,30 @@ +HOME_DIR/\.openoffice(\.org)?(/.*)? gen_context(system_u:object_r:ooffice_home_t,s0) + +/opt/openoffice(.*)?/program/cde-open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/gnome-open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/gnome-open-url\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/javaldx -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/kde-open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/open-url -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/pagein -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/regcomp\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/regmerge -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/regview -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/sbase -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/scalc -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/sdraw -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/senddoc -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/simpress -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/smath -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/soffice -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/soffice\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/spadmin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/spadmin\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/startup\.sh -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/swriter -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/uno\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/unoinfo -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/unopkg -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/unopkg\.bin -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/unpack_update -- gen_context(system_u:object_r:ooffice_exec_t,s0) +/opt/openoffice(.*)?/program/uri-encode -- gen_context(system_u:object_r:ooffice_exec_t,s0)
policy/modules/contrib/openoffice.if +88 -0
88 lines not on this page · raw message
policy/modules/contrib/openoffice.te +120 -0
120 lines not on this page · raw message
policy/modules/contrib/thunderbird.te +5 -0
@@ -166,3 +166,8 @@ optional_policy(` mozilla_read_user_home_files(thunderbird_t) mozilla_domtrans(thunderbird_t) ') + +optional_policy(` + ooffice_domtrans(thunderbird_t) + ooffice_rw_ooffice_tmp_files(thunderbird_t) +')
PATCH v9 2/2 Apache OpenOffice module (contrib policy part)
Quoted 33 lines · Guido Trentalancia via refpolicy
This is a patch that I have created and tested to support Apache OpenOffice with its own module (contrib policy part, 2/2).
The file contexts (and initial tests) are based on the default installation path for version 4 of the office suite.
Since the second version it includes revisions from Dominick Grift.
Since the third version it should correctly manage files in home directories and allow some other major functionality.
The fourth version of the patch introduces a boolean to enable or disable software updates from the network (application and/or extensions).
The fifth version of the patch adds the ability to connect to the X display manager (XDM) using Unix domain sockets (interface
xserver_stream_connect_xdm()). Also the fifth version splits the whole patch into separate base policy / contrib policy patches as required.The sixth version of the patch adds the ability to run the evolution email application.
The seventh version of the patch, improves the integration with the evolution email application.
The eighth version of the patch, adds the support for integration with mozilla and improves the integration with thunderbird.
This nineth version of the patch, avoids auditing some denial messages.
Quoted 7 lines
All released versions are safe to apply, each new version just brings improved application functionality and better integration with other desktop applications.
Although this patch has only been tested with Apache OpenOffice version 4, it might also work with earlier versions (in particular version 3) or at least it can be easily adapted for the purpose.
I've merged this, but I'd like a couple interface renames (noted below).
Quoted 17 lines
Signed-off-by Guido Trentalancia <[email protected]>--- policy/modules/contrib/evolution.if | 38 ++++++++++ policy/modules/contrib/evolution.te | 5 + policy/modules/contrib/mozilla.te | 5 + policy/modules/contrib/openoffice.fc | 30 ++++++++ policy/modules/contrib/openoffice.if | 88 ++++++++++++++++++++++++ policy/modules/contrib/openoffice.te | 120 ++++++++++++++++++++++++++++++++++ policy/modules/contrib/thunderbird.te | 5 + 7 files changed, 291 insertions(+)diff -pruN refpolicy-git-25112016-orig/policy/modules/contrib/evolution.if refpolicy-git-25112016/policy/modules/contrib/evolution.if
policy/modules/contrib/evolution.if +0
-0@@ -107,6 +107,24 @@ interface(`evolution_home_filetrans',` ########################################
policy/modules/contrib/evolution.if interface(`evolution_home_filetrans',` · line 118
Quoted 10 lines
policy/modules/contrib/evolution.if +9
-0## <summary> +## Read evolution home files. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`evolution_read_evolution_home_files',`
evolution_read_home_files().
Quoted 12 lines
policy/modules/contrib/evolution.if +9
-0+ gen_require(` + type evolution_t, evolution_home_t; + ') + + read_files_pattern($1, evolution_home_t, evolution_home_t) +') + +######################################## +## <summary> ## Connect to evolution using a unix ## domain stream socket. ## </summary>
[...]
Quoted 3 lines
diff -pruN refpolicy-git-25112016-orig/policy/modules/contrib/openoffice.if refpolicy-git-25112016/policy/modules/contrib/openoffice.if
policy/modules/contrib/openoffice.if +0
-0
[...]
policy/modules/contrib/openoffice.if line 63
Quoted 13 lines
policy/modules/contrib/openoffice.if +13
-0+ +######################################## +## <summary> +## Read and write temporary +## openoffice files. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`ooffice_rw_ooffice_tmp_files',`
ooffice_rw_tmp_files()
Quoted 25 lines
policy/modules/contrib/openoffice.if +25
-0+ gen_require(` + type ooffice_tmp_t; + ') + + rw_files_pattern($1, ooffice_tmp_t, ooffice_tmp_t) +') + +######################################## +## <summary> +## Do not audit attempts to execute +## files in temporary directories. +## </summary> +## <param name="domain"> +## <summary> +## Domain to not audit. +## </summary> +## </param> +# +interface(`ooffice_dontaudit_exec_tmp_files',` + gen_require(` + type ooffice_tmp_t; + ') + + dontaudit $1 ooffice_tmp_t:file exec_file_perms; +')
Signature · 1 line
Chris PeBenito
PATCH 1/1 openoffice: rename two interfaces in openoffice and evolution
Hello Christopher,
thanks very much for applying this patch !
Quoted 4 lines · Chris PeBenito
Quoted 3 lines · Guido Trentalancia via refpolicy
This is a patch that I have created and tested to support Apache OpenOffice with its own module (contrib policy part, 2/2).
[...]
Quoted 2 lines
I've merged this, but I'd like a couple interface renames (noted below).
I have created a small patch to rename the two interfaces as you suggest. I just hope there will not be any collision with future interfaces that access raw tmp files...
Quoted 102 lines
Quoted 25 lines
Signed-off-by Guido Trentalancia <[email protected]>---
?policy/modules/contrib/evolution.if???|???38 ++++++++++ ?policy/modules/contrib/evolution.te???|????5 + ?policy/modules/contrib/mozilla.te?????|????5 + ?policy/modules/contrib/openoffice.fc??|???30 ++++++++ ?policy/modules/contrib/openoffice.if??|???88++++++++++++++++++++++++
?policy/modules/contrib/openoffice.te??|??120
++++++++++++++++++++++++++++++++++
?policy/modules/contrib/thunderbird.te |????5 +
?7 files changed, 291 insertions(+)diff -pruN refpolicy-git-25112016- orig/policy/modules/contrib/evolution.if refpolicy-git- 25112016/policy/modules/contrib/evolution.if
--- refpolicy-git-25112016-orig/policy/modules/contrib/evolution.if2016-12-04 16:02:48.317069925 +0100 +++ refpolicy-git-25112016/policy/modules/contrib/evolution.if 2016-12-04 16:03:37.777350810 +0100(quoted diff) +0
-0@@ -107,6 +107,24 @@ interface(`evolution_home_filetrans',`?########################################
?## <summary>Review
Quoted 9 lines
(quoted diff) +9
-0+## Read evolution home files. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`evolution_read_evolution_home_files',`
evolution_read_home_files().Quoted 13 lines
(quoted diff) +9
-0+ gen_require(` + type evolution_t, evolution_home_t; + ') + + read_files_pattern($1, evolution_home_t, evolution_home_t) +') + +######################################## +## <summary>?## Connect to evolution using a unix
?## domain stream socket.
?## </summary>[...]
Quoted 9 lines
diff -pruN refpolicy-git-25112016- orig/policy/modules/contrib/openoffice.if refpolicy-git- 25112016/policy/modules/contrib/openoffice.if
--- refpolicy-git-25112016-
orig/policy/modules/contrib/openoffice.if 1970-01-01
01:00:00.000000000 +0100
+++ refpolicy-git-25112016/policy/modules/contrib/openoffice.if2016-12-06 21:27:07.252411657 +0100[...]
Quoted 4 lines
(quoted diff) +3
-0+ +######################################## +## <summary>Review
Quoted 10 lines
(quoted diff) +10
-0+## Read and write temporary +## openoffice files. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`ooffice_rw_ooffice_tmp_files',`
ooffice_rw_tmp_files()Quoted 18 lines
(quoted diff) +17
-0+ gen_require(` + type ooffice_tmp_t; + ') + + rw_files_pattern($1, ooffice_tmp_t, ooffice_tmp_t) +') + +######################################## +## <summary> +## Do not audit attempts to execute +## files in temporary directories. +## </summary> +## <param name="domain"> +## <summary> +## Domain to not audit. +## </summary> +## </param>
Quoted 8 lines
Review
Quoted 8 lines
(quoted diff) +8
-0+# +interface(`ooffice_dontaudit_exec_tmp_files',` + gen_require(` + type ooffice_tmp_t; + ') + + dontaudit $1 ooffice_tmp_t:file exec_file_perms; +')
[cut]
Rename 1 openoffice interface and 1 evolution interfaces that have been recently added with the new openoffice module.
--- policy/modules/contrib/evolution.if | 2 +- policy/modules/contrib/evolution.te | 2 +- policy/modules/contrib/mozilla.te | 2 +- policy/modules/contrib/openoffice.if | 2 +- policy/modules/contrib/openoffice.te | 2 +- policy/modules/contrib/thunderbird.te | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-)
policy/modules/contrib/evolution.if +1 -1
@@ -115,7 +115,7 @@ interface(`evolution_home_filetrans',` ## </summary> ## </param> # -interface(`evolution_read_evolution_home_files',` +interface(`evolution_read_home_files',` gen_require(` type evolution_t, evolution_home_t; ')
policy/modules/contrib/evolution.te +1 -1
@@ -271,7 +271,7 @@ optional_policy(` optional_policy(` ooffice_domtrans(evolution_t) - ooffice_rw_ooffice_tmp_files(evolution_t) + ooffice_rw_tmp_files(evolution_t) ') optional_policy(`
policy/modules/contrib/mozilla.te +1 -1
@@ -297,7 +297,7 @@ optional_policy(` optional_policy(` ooffice_domtrans(mozilla_t) - ooffice_rw_ooffice_tmp_files(mozilla_t) + ooffice_rw_tmp_files(mozilla_t) ') optional_policy(`
policy/modules/contrib/openoffice.if +1 -1
@@ -60,7 +60,7 @@ interface(`ooffice_domtrans',` ## </summary> ## </param> # -interface(`ooffice_rw_ooffice_tmp_files',` +interface(`ooffice_rw_tmp_files',` gen_require(` type ooffice_tmp_t; ')
policy/modules/contrib/openoffice.te +1 -1
@@ -92,7 +92,7 @@ optional_policy(` optional_policy(` evolution_domtrans(ooffice_t) - evolution_read_evolution_home_files(ooffice_t) + evolution_read_home_files(ooffice_t) ') optional_policy(`
policy/modules/contrib/thunderbird.te +1 -1
@@ -169,5 +169,5 @@ optional_policy(` optional_policy(` ooffice_domtrans(thunderbird_t) - ooffice_rw_ooffice_tmp_files(thunderbird_t) + ooffice_rw_tmp_files(thunderbird_t) ')
PATCH 1/1 openoffice: rename two interfaces in openoffice and evolution
Quoted 2 lines
Rename 1 openoffice interface and 1 evolution interfaces that have been recently added with the new openoffice module.
Merged.
Quoted 85 lines
Signed-off-by Guido Trentalancia <[email protected]>--- policy/modules/contrib/evolution.if | 2 +- policy/modules/contrib/evolution.te | 2 +- policy/modules/contrib/mozilla.te | 2 +- policy/modules/contrib/openoffice.if | 2 +- policy/modules/contrib/openoffice.te | 2 +- policy/modules/contrib/thunderbird.te | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-)diff -pruN refpolicy-git-07122016-orig/policy/modules/contrib/evolution.if refpolicy-git-07122016/policy/modules/contrib/evolution.if
policy/modules/contrib/evolution.if +1
-1@@ -115,7 +115,7 @@ interface(`evolution_home_filetrans',` ## </summary> ## </param> # -interface(`evolution_read_evolution_home_files',` +interface(`evolution_read_home_files',` gen_require(` type evolution_t, evolution_home_t; ')diff -pruN refpolicy-git-07122016-orig/policy/modules/contrib/evolution.te refpolicy-git-07122016/policy/modules/contrib/evolution.te
policy/modules/contrib/evolution.te +1
-1@@ -271,7 +271,7 @@ optional_policy(` optional_policy(` ooffice_domtrans(evolution_t) - ooffice_rw_ooffice_tmp_files(evolution_t) + ooffice_rw_tmp_files(evolution_t) ') optional_policy(`diff -pruN refpolicy-git-07122016-orig/policy/modules/contrib/mozilla.te refpolicy-git-07122016/policy/modules/contrib/mozilla.te
policy/modules/contrib/mozilla.te +1
-1@@ -297,7 +297,7 @@ optional_policy(` optional_policy(` ooffice_domtrans(mozilla_t) - ooffice_rw_ooffice_tmp_files(mozilla_t) + ooffice_rw_tmp_files(mozilla_t) ') optional_policy(`diff -pruN refpolicy-git-07122016-orig/policy/modules/contrib/openoffice.if refpolicy-git-07122016/policy/modules/contrib/openoffice.if
policy/modules/contrib/openoffice.if +1
-1@@ -60,7 +60,7 @@ interface(`ooffice_domtrans',` ## </summary> ## </param> # -interface(`ooffice_rw_ooffice_tmp_files',` +interface(`ooffice_rw_tmp_files',` gen_require(` type ooffice_tmp_t; ')diff -pruN refpolicy-git-07122016-orig/policy/modules/contrib/openoffice.te refpolicy-git-07122016/policy/modules/contrib/openoffice.te
policy/modules/contrib/openoffice.te +1
-1@@ -92,7 +92,7 @@ optional_policy(` optional_policy(` evolution_domtrans(ooffice_t) - evolution_read_evolution_home_files(ooffice_t) + evolution_read_home_files(ooffice_t) ') optional_policy(`diff -pruN refpolicy-git-07122016-orig/policy/modules/contrib/thunderbird.te refpolicy-git-07122016/policy/modules/contrib/thunderbird.te
policy/modules/contrib/thunderbird.te +1
-1@@ -169,5 +169,5 @@ optional_policy(` optional_policy(` ooffice_domtrans(thunderbird_t) - ooffice_rw_ooffice_tmp_files(thunderbird_t) + ooffice_rw_tmp_files(thunderbird_t) ')_______________________________________________
refpolicy mailing list
refpolicy at oss.tresys.com
http://oss.tresys.com/mailman/listinfo/refpolicy
Signature · 1 line
Chris PeBenito