Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need search perms on cert_t/tls_privkey_t when using private types #835

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 45 additions & 4 deletions policy/modules/system/miscfiles.if
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
## </p>
## <p>
## type mycertfile_t;
## cert_type(mycertfile_t)
## miscfiles_cert_type(mycertfile_t)
## allow mydomain_t mycertfile_t:file read_file_perms;
## files_search_etc(mydomain_t)
## miscfiles_search_generic_cert_dirs(mydomain_t)
## </p>
## </desc>
## <param name="type">
Expand Down Expand Up @@ -68,9 +68,9 @@ interface(`miscfiles_cert_type',`
## </p>
## <p>
## type mytlsprivkeyfile_t;
## tls_privkey_type(mytlsprivkeyfile_t)
## miscfiles_tls_privkey_type(mytlsprivkeyfile_t)
## allow mydomain_t mytlsprivkeyfile_t:file read_file_perms;
## files_search_etc(mydomain_t)
## miscfiles_search_tls_privkey_dirs(mydomain_t)
## </p>
## </desc>
## <param name="type">
Expand Down Expand Up @@ -110,6 +110,26 @@ interface(`miscfiles_read_all_certs',`
read_lnk_files_pattern($1, cert_type, cert_type)
')

########################################
## <summary>
## Search generic SSL/TLS directories.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
## <rolecap/>
#
interface(`miscfiles_search_generic_cert_dirs',`
gen_require(`
type cert_t;
')

files_search_etc($1)
allow $1 cert_t:dir search_dir_perms;
')

########################################
## <summary>
## Read generic SSL/TLS certificates.
Expand Down Expand Up @@ -209,6 +229,27 @@ interface(`miscfiles_mounton_generic_cert_dirs',`
allow $1 cert_t:dir mounton;
')


########################################
## <summary>
## Search SSL/TLS private key directories.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
## <rolecap/>
#
interface(`miscfiles_search_tls_privkey_dirs',`
gen_require(`
type tls_privkey_t;
')

miscfiles_search_generic_cert_dirs($1)
allow $1 tls_privkey_t:dir search_dir_perms;
')

########################################
## <summary>
## Read generic SSL/TLS private
Expand Down
Loading