SELinux-Refpolicy Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 0/2] Fixes to enable slapd to run
@ 2019-12-06 19:25 Lawrence, Stephen
  2019-12-06 19:25 ` [PATCH 1/2] ldap: various permissions required by slapd Lawrence, Stephen
  2019-12-06 19:25 ` [PATCH 2/2] miscfiles: reading certs allows map permission also Lawrence, Stephen
  0 siblings, 2 replies; 4+ messages in thread
From: Lawrence, Stephen @ 2019-12-06 19:25 UTC (permalink / raw)
  To: SELinux Refpolicy

slapd requires the map permission on some files, including certs, files
in /usr, and the slapd database. Also uses symlink in /tmp and crypto
sysctls. These two patches add the needed permissions.

Steve Lawrence (2):
  ldap: various permissions required by slapd
  miscfiles: reading certs allows map permission also

 policy/modules/services/ldap.te    | 6 +++++-
 policy/modules/system/miscfiles.if | 2 ++
 2 files changed, 7 insertions(+), 1 deletion(-)

-- 
2.21.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] ldap: various permissions required by slapd
  2019-12-06 19:25 [PATCH 0/2] Fixes to enable slapd to run Lawrence, Stephen
@ 2019-12-06 19:25 ` Lawrence, Stephen
  2019-12-06 19:25 ` [PATCH 2/2] miscfiles: reading certs allows map permission also Lawrence, Stephen
  1 sibling, 0 replies; 4+ messages in thread
From: Lawrence, Stephen @ 2019-12-06 19:25 UTC (permalink / raw)
  To: SELinux Refpolicy

- requires the map permission when reading /usr and LDAP database files
- creates symlinks in /tmp in addition to files and directory
- needs to read crypto sysctls
---
 policy/modules/services/ldap.te | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/policy/modules/services/ldap.te b/policy/modules/services/ldap.te
index 83478fa0..47d40770 100644
--- a/policy/modules/services/ldap.te
+++ b/policy/modules/services/ldap.te
@@ -63,6 +63,7 @@ read_lnk_files_pattern(slapd_t, slapd_cert_t, slapd_cert_t)
 manage_dirs_pattern(slapd_t, slapd_db_t, slapd_db_t)
 manage_files_pattern(slapd_t, slapd_db_t, slapd_db_t)
 manage_lnk_files_pattern(slapd_t, slapd_db_t, slapd_db_t)
+mmap_read_files_pattern(slapd_t, slapd_db_t, slapd_db_t)
 
 allow slapd_t slapd_etc_t:file read_file_perms;
 
@@ -83,7 +84,8 @@ manage_lnk_files_pattern(slapd_t, slapd_replog_t, slapd_replog_t)
 
 manage_dirs_pattern(slapd_t, slapd_tmp_t, slapd_tmp_t)
 manage_files_pattern(slapd_t, slapd_tmp_t, slapd_tmp_t)
-files_tmp_filetrans(slapd_t, slapd_tmp_t, { file dir })
+manage_lnk_files_pattern(slapd_t, slapd_tmp_t, slapd_tmp_t)
+files_tmp_filetrans(slapd_t, slapd_tmp_t, { file dir lnk_file })
 
 manage_files_pattern(slapd_t, slapd_tmpfs_t, slapd_tmpfs_t)
 fs_tmpfs_filetrans(slapd_t, slapd_tmpfs_t, file)
@@ -94,6 +96,7 @@ manage_sock_files_pattern(slapd_t, slapd_runtime_t, slapd_runtime_t)
 files_pid_filetrans(slapd_t, slapd_runtime_t, { dir file sock_file })
 
 kernel_read_system_state(slapd_t)
+kernel_read_crypto_sysctls(slapd_t)
 kernel_read_kernel_sysctls(slapd_t)
 
 corenet_all_recvfrom_unlabeled(slapd_t)
@@ -118,6 +121,7 @@ fs_getattr_all_fs(slapd_t)
 fs_search_auto_mountpoints(slapd_t)
 
 files_read_etc_runtime_files(slapd_t)
+files_map_usr_files(slapd_t)
 files_read_usr_files(slapd_t)
 files_list_var_lib(slapd_t)
 
-- 
2.21.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/2] miscfiles: reading certs allows map permission also
  2019-12-06 19:25 [PATCH 0/2] Fixes to enable slapd to run Lawrence, Stephen
  2019-12-06 19:25 ` [PATCH 1/2] ldap: various permissions required by slapd Lawrence, Stephen
@ 2019-12-06 19:25 ` Lawrence, Stephen
  2019-12-26 16:58   ` Chris PeBenito
  1 sibling, 1 reply; 4+ messages in thread
From: Lawrence, Stephen @ 2019-12-06 19:25 UTC (permalink / raw)
  To: SELinux Refpolicy

---
 policy/modules/system/miscfiles.if | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/policy/modules/system/miscfiles.if b/policy/modules/system/miscfiles.if
index df11794a..4ff82afb 100644
--- a/policy/modules/system/miscfiles.if
+++ b/policy/modules/system/miscfiles.if
@@ -107,6 +107,7 @@ interface(`miscfiles_read_all_certs',`
 
 	allow $1 cert_type:dir list_dir_perms;
 	read_files_pattern($1, cert_type, cert_type)
+	allow $1 cert_type:file map;
 	read_lnk_files_pattern($1, cert_type, cert_type)
 ')
 
@@ -128,6 +129,7 @@ interface(`miscfiles_read_generic_certs',`
 
 	allow $1 cert_t:dir list_dir_perms;
 	read_files_pattern($1, cert_t, cert_t)
+	allow $1 cert_t:file map;
 	read_lnk_files_pattern($1, cert_t, cert_t)
 ')
 
-- 
2.21.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] miscfiles: reading certs allows map permission also
  2019-12-06 19:25 ` [PATCH 2/2] miscfiles: reading certs allows map permission also Lawrence, Stephen
@ 2019-12-26 16:58   ` Chris PeBenito
  0 siblings, 0 replies; 4+ messages in thread
From: Chris PeBenito @ 2019-12-26 16:58 UTC (permalink / raw)
  To: Lawrence, Stephen, SELinux Refpolicy

On 12/6/19 2:25 PM, Lawrence, Stephen wrote:
> ---
>   policy/modules/system/miscfiles.if | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/policy/modules/system/miscfiles.if b/policy/modules/system/miscfiles.if
> index df11794a..4ff82afb 100644
> --- a/policy/modules/system/miscfiles.if
> +++ b/policy/modules/system/miscfiles.if
> @@ -107,6 +107,7 @@ interface(`miscfiles_read_all_certs',`
>   
>   	allow $1 cert_type:dir list_dir_perms;
>   	read_files_pattern($1, cert_type, cert_type)
> +	allow $1 cert_type:file map;
>   	read_lnk_files_pattern($1, cert_type, cert_type)
>   ')
>   
> @@ -128,6 +129,7 @@ interface(`miscfiles_read_generic_certs',`
>   
>   	allow $1 cert_t:dir list_dir_perms;
>   	read_files_pattern($1, cert_t, cert_t)
> +	allow $1 cert_t:file map;
>   	read_lnk_files_pattern($1, cert_t, cert_t)
>   ')

Needs a separate map or mmap_read interface.  I'm not aware of all cert 
reading requiring mmap.

-- 
Chris PeBenito

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-06 19:25 [PATCH 0/2] Fixes to enable slapd to run Lawrence, Stephen
2019-12-06 19:25 ` [PATCH 1/2] ldap: various permissions required by slapd Lawrence, Stephen
2019-12-06 19:25 ` [PATCH 2/2] miscfiles: reading certs allows map permission also Lawrence, Stephen
2019-12-26 16:58   ` Chris PeBenito

SELinux-Refpolicy Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/selinux-refpolicy/0 selinux-refpolicy/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 selinux-refpolicy selinux-refpolicy/ https://lore.kernel.org/selinux-refpolicy \
		selinux-refpolicy@vger.kernel.org
	public-inbox-index selinux-refpolicy

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.selinux-refpolicy


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git