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

Allow rhcd create and write to .run_insights_client_next_boot #1921

Draft
wants to merge 1 commit into
base: rawhide
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions policy/modules/contrib/insights_client.fc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/etc/insights-client/\.lastupload -- gen_context(system_u:object_r:insights_client_etc_rw_t,s0)
/etc/insights-client/\.last-upload\.results -- gen_context(system_u:object_r:insights_client_etc_rw_t,s0)
/etc/insights-client/\.registered -- gen_context(system_u:object_r:insights_client_etc_rw_t,s0)
/etc/insights-client/\.run_insights_client_next_boot -- gen_context(system_u:object_r:insights_client_etc_rw_t,s0)
/etc/insights-client/\.unregistered -- gen_context(system_u:object_r:insights_client_etc_rw_t,s0)
/etc/insights-client/insights-client-egg-release -- gen_context(system_u:object_r:insights_client_etc_rw_t,s0)
/etc/insights-client/machine-id -- gen_context(system_u:object_r:insights_client_etc_rw_t,s0)
Expand Down
22 changes: 21 additions & 1 deletion policy/modules/contrib/insights_client.if
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ interface(`insights_client_filetrans_named_content',`
filetrans_pattern($1, insights_client_etc_t, insights_client_etc_rw_t, file, ".lastupload")
filetrans_pattern($1, insights_client_etc_t, insights_client_etc_rw_t, file, ".last-upload.results")
filetrans_pattern($1, insights_client_etc_t, insights_client_etc_rw_t, file, ".registered")
filetrans_pattern($1, insights_client_etc_t, insights_client_etc_rw_t, file, ".run_insights_client_next_boot")
filetrans_pattern($1, insights_client_etc_t, insights_client_etc_rw_t, file, ".unregistered")
filetrans_pattern($1, insights_client_etc_t, insights_client_etc_rw_t, file, "insights-client-egg-release")
filetrans_pattern($1, insights_client_etc_t, insights_client_etc_rw_t, file, "machine-id")
Expand Down Expand Up @@ -164,7 +165,26 @@ interface(`insights_client_read_config',`

files_search_etc($1)
read_files_pattern($1, insights_client_etc_t, insights_client_etc_t)
read_files_pattern($1, insights_client_etc_rw_t, insights_client_etc_rw_t)
read_files_pattern($1, insights_client_etc_t, insights_client_etc_rw_t)
')

########################################
## <summary>
## Write insights_client r/w config files.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`insights_client_write_config',`
gen_require(`
type insights_client_etc_t, insights_client_etc_rw_t;
')

files_search_etc($1)
write_files_pattern($1, insights_client_etc_t, insights_client_etc_rw_t)
')

########################################
Expand Down
3 changes: 3 additions & 0 deletions policy/modules/contrib/rhcd.te
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ files_status_etc(rhcd_t)

fs_getattr_all_fs(rhcd_t)

init_status(rhcd_t)
init_view_key(rhcd_t)

libs_exec_ldconfig(rhcd_t)
Expand Down Expand Up @@ -149,7 +150,9 @@ optional_policy(`

optional_policy(`
insights_client_domtrans(rhcd_t)
insights_client_filetrans_named_content(rhcd_t)
insights_client_read_config(rhcd_t)
insights_client_write_config(rhcd_t)
')

optional_policy(`
Expand Down