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

Tmux confined users #2399

Merged
merged 2 commits into from
Oct 23, 2024
Merged
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
3 changes: 3 additions & 0 deletions policy/modules/contrib/screen.fc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ HOME_DIR/\.screen(/.*)? gen_context(system_u:object_r:screen_home_t,s0)
HOME_DIR/\.screenrc -- gen_context(system_u:object_r:screen_home_t,s0)
HOME_DIR/\.tmux\.conf -- gen_context(system_u:object_r:screen_home_t,s0)

/root/\.screenrc -- gen_context(system_u:object_r:screen_home_t,s0)
/root/\.tmux\.conf -- gen_context(system_u:object_r:screen_home_t,s0)

/root/\.screen(/.*)? gen_context(system_u:object_r:screen_home_t,s0)

/usr/bin/screen -- gen_context(system_u:object_r:screen_exec_t,s0)
Expand Down
31 changes: 30 additions & 1 deletion policy/modules/contrib/screen.if
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ template(`screen_role_template',`

domtrans_pattern($3, screen_exec_t, $1_screen_t)
allow $3 $1_screen_t:process { signal sigchld };
dontaudit $3 $1_screen_t:unix_stream_socket { ioctl read write };
allow $3 $1_screen_t:unix_stream_socket { ioctl read write };
allow $1_screen_t $3:unix_stream_socket { connectto };
allow $1_screen_t $3:process signal;
allow $3 screen_exec_t:file entrypoint;
Expand Down Expand Up @@ -99,6 +99,35 @@ template(`screen_role_template',`
')
')

#######################################
## <summary>
## The admin role template for the screen module
## </summary>
## <param name="role_prefix">
## <summary>
## The prefix of the user role (e.g., user
## is the prefix for user_r).
## </summary>
## </param>
## <param name="user_role">
## <summary>
## The role associated with the user domain.
## </summary>
## </param>
## <param name="user_domain">
## <summary>
## The type of the user domain.
## </summary>
## </param>
#
template(`screen_admin_role_template',`
screen_role_template($1, $2, $3)

userdom_admin_home_dir_filetrans($1_screen_t, screen_home_t, file, ".screenrc")
userdom_admin_home_dir_filetrans($1_screen_t, screen_home_t, file, ".tmux.conf")
')


#######################################
## <summary>
## Execute the rssh program
Expand Down
2 changes: 1 addition & 1 deletion policy/modules/roles/auditadm.te
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ optional_policy(`
')

optional_policy(`
screen_role_template(auditadm, auditadm_r, auditadm_t)
screen_admin_role_template(auditadm, auditadm_r, auditadm_t)
')

optional_policy(`
Expand Down
2 changes: 1 addition & 1 deletion policy/modules/roles/secadm.te
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ optional_policy(`
')

optional_policy(`
screen_role_template(secadm, secadm_r, secadm_t)
screen_admin_role_template(secadm, secadm_r, secadm_t)
')

optional_policy(`
Expand Down
2 changes: 1 addition & 1 deletion policy/modules/roles/sysadm.te
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ optional_policy(`
')

optional_policy(`
screen_role_template(sysadm, sysadm_r, sysadm_t)
screen_admin_role_template(sysadm, sysadm_r, sysadm_t)
allow sysadm_screen_t self:capability { dac_read_search dac_override chown };
')

Expand Down