Chris PeBenito 17de1b7
Chris PeBenito 9570b28
policy_module(ssh, 2.1.0)
Chris PeBenito 17de1b7
Chris PeBenito 17de1b7
########################################
Chris PeBenito 17de1b7
#
Chris PeBenito 17de1b7
# Declarations
Chris PeBenito 17de1b7
#
Chris PeBenito 17de1b7
Chris PeBenito 56e1b3d
## <desc>
Chris PeBenito 56e1b3d
## 

Chris PeBenito 56e1b3d
## allow host key based authentication
Chris PeBenito 56e1b3d
## 

Chris PeBenito 56e1b3d
## </desc>
Chris PeBenito 0bfccda
gen_tunable(allow_ssh_keysign, false)
Chris PeBenito 56e1b3d
Chris PeBenito 56e1b3d
## <desc>
Chris PeBenito 56e1b3d
## 

Chris PeBenito 56e1b3d
## Allow ssh logins as sysadm_r:sysadm_t
Chris PeBenito 56e1b3d
## 

Chris PeBenito 56e1b3d
## </desc>
Chris PeBenito 0bfccda
gen_tunable(ssh_sysadm_login, false)
Chris PeBenito 56e1b3d
Chris PeBenito 17de1b7
attribute ssh_server;
Chris PeBenito 296273a
attribute ssh_agent_type;
Chris PeBenito 17de1b7
Chris PeBenito 75beb95
type ssh_keygen_t;
Chris PeBenito 17de1b7
type ssh_keygen_exec_t;
Chris PeBenito 0bfccda
init_system_domain(ssh_keygen_t, ssh_keygen_exec_t)
Chris PeBenito 75beb95
role system_r types ssh_keygen_t;
Chris PeBenito 17de1b7
Chris PeBenito e070dd2
type sshd_exec_t;
Chris PeBenito 17de1b7
corecmd_executable_file(sshd_exec_t)
Chris PeBenito 17de1b7
Chris PeBenito 6b19be3
ssh_server_template(sshd)
Chris PeBenito 0bfccda
init_daemon_domain(sshd_t, sshd_exec_t)
Chris PeBenito 6b19be3
Chris PeBenito 17de1b7
type sshd_key_t;
Chris PeBenito 17de1b7
files_type(sshd_key_t)
Chris PeBenito 17de1b7
Chris PeBenito 6b19be3
type sshd_tmp_t;
Chris PeBenito 6b19be3
files_tmp_file(sshd_tmp_t)
Chris PeBenito 6b19be3
files_poly_parent(sshd_tmp_t)
Chris PeBenito e070dd2
Chris PeBenito 6b19be3
ifdef(`enable_mcs',`
Chris PeBenito 3f67f72
	init_ranged_daemon_domain(sshd_t, sshd_exec_t, s0 - mcs_systemhigh)
Chris PeBenito 17de1b7
')
Chris PeBenito 17de1b7
Chris PeBenito 296273a
type ssh_t;
Chris PeBenito 296273a
type ssh_exec_t;
Chris PeBenito 296273a
typealias ssh_t alias { user_ssh_t staff_ssh_t sysadm_ssh_t };
Chris PeBenito 296273a
typealias ssh_t alias { auditadm_ssh_t secadm_ssh_t };
Chris PeBenito 296273a
application_domain(ssh_t, ssh_exec_t)
Chris PeBenito 296273a
ubac_constrained(ssh_t)
Chris PeBenito 296273a
Chris PeBenito 296273a
type ssh_agent_exec_t;
Chris PeBenito 296273a
corecmd_executable_file(ssh_agent_exec_t)
Chris PeBenito 296273a
Chris PeBenito 296273a
type ssh_agent_tmp_t;
Chris PeBenito 296273a
typealias ssh_agent_tmp_t alias { user_ssh_agent_tmp_t staff_ssh_agent_tmp_t sysadm_ssh_agent_tmp_t };
Chris PeBenito 296273a
typealias ssh_agent_tmp_t alias { auditadm_ssh_agent_tmp_t secadm_ssh_agent_tmp_t };
Chris PeBenito 296273a
files_tmp_file(ssh_agent_tmp_t)
Chris PeBenito 296273a
ubac_constrained(ssh_agent_tmp_t)
Chris PeBenito 296273a
Chris PeBenito 296273a
type ssh_keysign_t;
Chris PeBenito 296273a
type ssh_keysign_exec_t;
Chris PeBenito 296273a
typealias ssh_keysign_t alias { user_ssh_keysign_t staff_ssh_keysign_t sysadm_ssh_keysign_t };
Chris PeBenito 296273a
typealias ssh_keysign_t alias { auditadm_ssh_keysign_t secadm_ssh_keysign_t };
Chris PeBenito 296273a
application_domain(ssh_keysign_t, ssh_keysign_exec_t)
Chris PeBenito 296273a
ubac_constrained(ssh_keysign_t)
Chris PeBenito 296273a
Chris PeBenito 296273a
type ssh_tmpfs_t;
Chris PeBenito 296273a
typealias ssh_tmpfs_t alias { user_ssh_tmpfs_t staff_ssh_tmpfs_t sysadm_ssh_tmpfs_t };
Chris PeBenito 296273a
typealias ssh_tmpfs_t alias { auditadm_ssh_tmpfs_t secadm_ssh_tmpfs_t };
Chris PeBenito 296273a
files_tmpfs_file(ssh_tmpfs_t)
Chris PeBenito 296273a
ubac_constrained(ssh_tmpfs_t)
Chris PeBenito 296273a
Chris PeBenito 296273a
type home_ssh_t;
Chris PeBenito 296273a
typealias home_ssh_t alias { user_home_ssh_t staff_home_ssh_t sysadm_home_ssh_t };
Chris PeBenito 296273a
typealias home_ssh_t alias { auditadm_home_ssh_t secadm_home_ssh_t };
Chris PeBenito 296273a
files_type(home_ssh_t)
Chris PeBenito 296273a
userdom_user_home_content(home_ssh_t)
Chris PeBenito 296273a
Chris PeBenito 296273a
##############################
Chris PeBenito 296273a
#
Chris PeBenito 296273a
# SSH client local policy
Chris PeBenito 296273a
#
Chris PeBenito 296273a
Chris PeBenito 296273a
allow ssh_t self:capability { setuid setgid dac_override dac_read_search };
Chris PeBenito 296273a
allow ssh_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execstack execheap };
Chris PeBenito 296273a
allow ssh_t self:fd use;
Chris PeBenito 296273a
allow ssh_t self:fifo_file rw_fifo_file_perms;
Chris PeBenito 296273a
allow ssh_t self:unix_dgram_socket { create_socket_perms sendto };
Chris PeBenito 296273a
allow ssh_t self:unix_stream_socket { create_stream_socket_perms connectto };
Chris PeBenito 296273a
allow ssh_t self:shm create_shm_perms;
Chris PeBenito 296273a
allow ssh_t self:sem create_sem_perms;
Chris PeBenito 296273a
allow ssh_t self:msgq create_msgq_perms;
Chris PeBenito 296273a
allow ssh_t self:msg { send receive };
Chris PeBenito 296273a
allow ssh_t self:tcp_socket create_socket_perms;
Chris PeBenito 296273a
allow ssh_t self:netlink_route_socket r_netlink_socket_perms;
Chris PeBenito 296273a
Chris PeBenito 296273a
# Read the ssh key file.
Chris PeBenito 296273a
allow ssh_t sshd_key_t:file read_file_perms;
Chris PeBenito 296273a
Chris PeBenito 296273a
# Access the ssh temporary files.
Chris PeBenito 296273a
allow ssh_t sshd_tmp_t:dir manage_dir_perms;
Chris PeBenito 296273a
allow ssh_t sshd_tmp_t:file manage_file_perms;
Chris PeBenito 296273a
files_tmp_filetrans(ssh_t, sshd_tmp_t, { file dir })
Chris PeBenito 296273a
Chris PeBenito 296273a
manage_files_pattern(ssh_t, ssh_tmpfs_t, ssh_tmpfs_t)
Chris PeBenito 296273a
manage_lnk_files_pattern(ssh_t, ssh_tmpfs_t, ssh_tmpfs_t)
Chris PeBenito 296273a
manage_fifo_files_pattern(ssh_t, ssh_tmpfs_t, ssh_tmpfs_t)
Chris PeBenito 296273a
manage_sock_files_pattern(ssh_t, ssh_tmpfs_t, ssh_tmpfs_t)
Chris PeBenito 296273a
fs_tmpfs_filetrans(ssh_t, ssh_tmpfs_t,{ dir file lnk_file sock_file fifo_file })
Chris PeBenito 296273a
Chris PeBenito 3f67f72
manage_dirs_pattern(ssh_t, home_ssh_t, home_ssh_t)
Chris PeBenito 3f67f72
manage_sock_files_pattern(ssh_t, home_ssh_t, home_ssh_t)
Chris PeBenito 296273a
userdom_user_home_dir_filetrans(ssh_t, home_ssh_t, { dir sock_file })
Chris PeBenito 296273a
Chris PeBenito 296273a
# Allow the ssh program to communicate with ssh-agent.
Chris PeBenito 296273a
stream_connect_pattern(ssh_t, ssh_agent_tmp_t, ssh_agent_tmp_t, ssh_agent_type)
Chris PeBenito 296273a
Chris PeBenito 296273a
allow ssh_t sshd_t:unix_stream_socket connectto;
Chris PeBenito 296273a
Chris PeBenito 296273a
# ssh client can manage the keys and config
Chris PeBenito 3f67f72
manage_files_pattern(ssh_t, home_ssh_t, home_ssh_t)
Chris PeBenito 3f67f72
read_lnk_files_pattern(ssh_t, home_ssh_t, home_ssh_t)
Chris PeBenito 296273a
Chris PeBenito 296273a
# ssh servers can read the user keys and config
Chris PeBenito 296273a
allow ssh_server home_ssh_t:dir list_dir_perms;
Chris PeBenito 3f67f72
read_files_pattern(ssh_server, home_ssh_t, home_ssh_t)
Chris PeBenito 3f67f72
read_lnk_files_pattern(ssh_server, home_ssh_t, home_ssh_t)
Chris PeBenito 296273a
Chris PeBenito 296273a
kernel_read_kernel_sysctls(ssh_t)
Chris PeBenito 296273a
Chris PeBenito 296273a
corenet_all_recvfrom_unlabeled(ssh_t)
Chris PeBenito 296273a
corenet_all_recvfrom_netlabel(ssh_t)
Chris PeBenito 668b309
corenet_tcp_sendrecv_generic_if(ssh_t)
Chris PeBenito c126214
corenet_tcp_sendrecv_generic_node(ssh_t)
Chris PeBenito 296273a
corenet_tcp_sendrecv_all_ports(ssh_t)
Chris PeBenito 296273a
corenet_tcp_connect_ssh_port(ssh_t)
Chris PeBenito 296273a
corenet_sendrecv_ssh_client_packets(ssh_t)
Chris PeBenito 296273a
Chris PeBenito 296273a
dev_read_urand(ssh_t)
Chris PeBenito 296273a
Chris PeBenito 296273a
fs_getattr_all_fs(ssh_t)
Chris PeBenito 296273a
fs_search_auto_mountpoints(ssh_t)
Chris PeBenito 296273a
Chris PeBenito 296273a
# run helper programs - needed eg for x11-ssh-askpass
Chris PeBenito 296273a
corecmd_exec_shell(ssh_t)
Chris PeBenito 296273a
corecmd_exec_bin(ssh_t)
Chris PeBenito 296273a
Chris PeBenito 296273a
domain_use_interactive_fds(ssh_t)
Chris PeBenito 296273a
Chris PeBenito 296273a
files_list_home(ssh_t)
Chris PeBenito 296273a
files_read_usr_files(ssh_t)
Chris PeBenito 296273a
files_read_etc_runtime_files(ssh_t)
Chris PeBenito 296273a
files_read_etc_files(ssh_t)
Chris PeBenito 296273a
files_read_var_files(ssh_t)
Chris PeBenito 296273a
Chris PeBenito 296273a
logging_send_syslog_msg(ssh_t)
Chris PeBenito 296273a
logging_read_generic_logs(ssh_t)
Chris PeBenito 296273a
Chris PeBenito 296273a
miscfiles_read_localization(ssh_t)
Chris PeBenito 296273a
Chris PeBenito 296273a
seutil_read_config(ssh_t)
Chris PeBenito 296273a
Chris PeBenito 296273a
sysnet_read_config(ssh_t)
Chris PeBenito 296273a
sysnet_dns_name_resolve(ssh_t)
Chris PeBenito 296273a
Chris PeBenito 296273a
userdom_dontaudit_list_user_home_dirs(ssh_t)
Chris PeBenito 296273a
userdom_search_user_home_dirs(ssh_t)
Chris PeBenito 296273a
# Write to the user domain tty.
Chris PeBenito 296273a
userdom_use_user_terminals(ssh_t)
Chris PeBenito 296273a
# needs to read krb tgt
Chris PeBenito 296273a
userdom_read_user_tmp_files(ssh_t)
Chris PeBenito 296273a
Chris PeBenito 296273a
tunable_policy(`allow_ssh_keysign',`
Chris PeBenito 296273a
	domain_auto_trans(ssh_t, ssh_keysign_exec_t, ssh_keysign_t)
Chris PeBenito 296273a
	allow ssh_keysign_t ssh_t:fd use;
Chris PeBenito 296273a
	allow ssh_keysign_t ssh_t:process sigchld;
Chris PeBenito 296273a
	allow ssh_keysign_t ssh_t:fifo_file rw_file_perms;
Chris PeBenito 296273a
')
Chris PeBenito 296273a
Chris PeBenito 296273a
tunable_policy(`use_nfs_home_dirs',`
Chris PeBenito 296273a
	fs_manage_nfs_dirs(ssh_t)
Chris PeBenito 296273a
	fs_manage_nfs_files(ssh_t)
Chris PeBenito 296273a
')
Chris PeBenito 296273a
Chris PeBenito 296273a
tunable_policy(`use_samba_home_dirs',`
Chris PeBenito 296273a
	fs_manage_cifs_dirs(ssh_t)
Chris PeBenito 296273a
	fs_manage_cifs_files(ssh_t)
Chris PeBenito 296273a
')
Chris PeBenito 296273a
Chris PeBenito 296273a
# for port forwarding
Chris PeBenito 296273a
tunable_policy(`user_tcp_server',`
Chris PeBenito 296273a
	corenet_tcp_bind_ssh_port(ssh_t)
Chris PeBenito 296273a
')
Chris PeBenito 296273a
Chris PeBenito 296273a
optional_policy(`
Chris PeBenito 296273a
	kerberos_use(ssh_t)
Chris PeBenito 296273a
')
Chris PeBenito 296273a
Chris PeBenito 296273a
optional_policy(`
Chris PeBenito 296273a
	nis_use_ypbind(ssh_t)
Chris PeBenito 296273a
')
Chris PeBenito 296273a
Chris PeBenito 296273a
optional_policy(`
Chris PeBenito 296273a
	nscd_socket_use(ssh_t)
Chris PeBenito 296273a
')
Chris PeBenito 296273a
Chris PeBenito 296273a
optional_policy(`
Chris PeBenito 296273a
	xserver_user_x_domain_template(ssh, ssh_t, ssh_tmpfs_t)
Chris PeBenito 296273a
	xserver_domtrans_xauth(ssh_t)
Chris PeBenito 296273a
')
Chris PeBenito 296273a
Chris PeBenito 296273a
########################################
Chris PeBenito 296273a
#
Chris PeBenito 296273a
# ssh_keygen local policy
Chris PeBenito 296273a
#
Chris PeBenito 296273a
Chris PeBenito 296273a
# ssh_keygen_t is the type of the ssh-keygen program when run at install time
Chris PeBenito 296273a
# and by sysadm_t
Chris PeBenito 296273a
Chris PeBenito 296273a
dontaudit ssh_keygen_t self:capability sys_tty_config;
Chris PeBenito 296273a
allow ssh_keygen_t self:process { sigchld sigkill sigstop signull signal };
Chris PeBenito 296273a
Chris PeBenito 296273a
allow ssh_keygen_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 296273a
Chris PeBenito 296273a
allow ssh_keygen_t sshd_key_t:file manage_file_perms;
Chris PeBenito 296273a
files_etc_filetrans(ssh_keygen_t, sshd_key_t, file)
Chris PeBenito 296273a
Chris PeBenito 296273a
kernel_read_kernel_sysctls(ssh_keygen_t)
Chris PeBenito 296273a
Chris PeBenito 296273a
fs_search_auto_mountpoints(ssh_keygen_t)
Chris PeBenito 296273a
Chris PeBenito 296273a
dev_read_sysfs(ssh_keygen_t)
Chris PeBenito 296273a
dev_read_urand(ssh_keygen_t)
Chris PeBenito 296273a
Chris PeBenito 296273a
term_dontaudit_use_console(ssh_keygen_t)
Chris PeBenito 296273a
Chris PeBenito 296273a
domain_use_interactive_fds(ssh_keygen_t)
Chris PeBenito 296273a
Chris PeBenito 296273a
files_read_etc_files(ssh_keygen_t)
Chris PeBenito 296273a
Chris PeBenito 296273a
init_use_fds(ssh_keygen_t)
Chris PeBenito 296273a
init_use_script_ptys(ssh_keygen_t)
Chris PeBenito 296273a
Chris PeBenito 296273a
logging_send_syslog_msg(ssh_keygen_t)
Chris PeBenito 296273a
Chris PeBenito 296273a
userdom_dontaudit_use_unpriv_user_fds(ssh_keygen_t)
Chris PeBenito 296273a
Chris PeBenito 296273a
optional_policy(`
Chris PeBenito 296273a
	nscd_socket_use(ssh_keygen_t)
Chris PeBenito 296273a
')
Chris PeBenito 296273a
Chris PeBenito 296273a
optional_policy(`
Chris PeBenito 296273a
	seutil_sigchld_newrole(ssh_keygen_t)
Chris PeBenito 296273a
')
Chris PeBenito 296273a
Chris PeBenito 296273a
optional_policy(`
Chris PeBenito 296273a
	udev_read_db(ssh_keygen_t)
Chris PeBenito 296273a
')
Chris PeBenito 296273a
Chris PeBenito 296273a
##############################
Chris PeBenito 296273a
#
Chris PeBenito 296273a
# ssh_keysign_t local policy
Chris PeBenito 296273a
#
Chris PeBenito 296273a
Chris PeBenito 296273a
tunable_policy(`allow_ssh_keysign',`
Chris PeBenito 296273a
	allow ssh_keysign_t self:capability { setgid setuid };
Chris PeBenito 296273a
	allow ssh_keysign_t self:unix_stream_socket create_socket_perms;
Chris PeBenito 296273a
Chris PeBenito 296273a
	allow ssh_keysign_t sshd_key_t:file { getattr read };
Chris PeBenito 296273a
Chris PeBenito 296273a
	dev_read_urand(ssh_keysign_t)
Chris PeBenito 296273a
Chris PeBenito 296273a
	files_read_etc_files(ssh_keysign_t)
Chris PeBenito 296273a
')
Chris PeBenito 296273a
Chris PeBenito 296273a
optional_policy(`
Chris PeBenito 296273a
	tunable_policy(`allow_ssh_keysign',`
Chris PeBenito 296273a
		nscd_socket_use(ssh_keysign_t)
Chris PeBenito 296273a
	')
Chris PeBenito 296273a
')
Chris PeBenito 296273a
Chris PeBenito 17de1b7
#################################
Chris PeBenito 17de1b7
#
Chris PeBenito 17de1b7
# sshd local policy
Chris PeBenito 17de1b7
#
Chris PeBenito 17de1b7
# sshd_t is the domain for the sshd program.
Chris PeBenito 17de1b7
#
Chris PeBenito 17de1b7
Chris PeBenito 6b19be3
# so a tunnel can point to another ssh tunnel
Chris PeBenito 6b19be3
allow sshd_t self:netlink_route_socket r_netlink_socket_perms;
Chris PeBenito 6b19be3
allow sshd_t self:key { search link write };
Chris PeBenito 17de1b7
Chris PeBenito 0bfccda
manage_dirs_pattern(sshd_t, sshd_tmp_t, sshd_tmp_t)
Chris PeBenito 0bfccda
manage_files_pattern(sshd_t, sshd_tmp_t, sshd_tmp_t)
Chris PeBenito 0bfccda
manage_sock_files_pattern(sshd_t, sshd_tmp_t, sshd_tmp_t)
Chris PeBenito 6b19be3
files_tmp_filetrans(sshd_t, sshd_tmp_t, { dir file sock_file })
Chris PeBenito 17de1b7
Chris PeBenito 6b19be3
kernel_search_key(sshd_t)
Chris PeBenito 6b19be3
kernel_link_key(sshd_t)
Chris PeBenito 6b19be3
Chris PeBenito 296273a
term_use_all_user_ptys(sshd_t)
Chris PeBenito 296273a
term_setattr_all_user_ptys(sshd_t)
Chris PeBenito 296273a
term_relabelto_all_user_ptys(sshd_t)
Chris PeBenito 296273a
Chris PeBenito 6b19be3
# for X forwarding
Chris PeBenito 6b19be3
corenet_tcp_bind_xserver_port(sshd_t)
Chris PeBenito 6b19be3
corenet_sendrecv_xserver_server_packets(sshd_t)
Chris PeBenito 6b19be3
Chris PeBenito 6b19be3
tunable_policy(`ssh_sysadm_login',`
Chris PeBenito 6b19be3
	# Relabel and access ptys created by sshd
Chris PeBenito 6b19be3
	# ioctl is necessary for logout() processing for utmp entry and for w to
Chris PeBenito 6b19be3
	# display the tty.
Chris PeBenito 6b19be3
	# some versions of sshd on the new SE Linux require setattr
Chris PeBenito 6b19be3
	userdom_spec_domtrans_all_users(sshd_t)
Chris PeBenito 6b19be3
	userdom_signal_all_users(sshd_t)
Chris PeBenito 6b19be3
',`
Chris PeBenito 6b19be3
	userdom_spec_domtrans_unpriv_users(sshd_t)
Chris PeBenito 6b19be3
	userdom_signal_unpriv_users(sshd_t)
Chris PeBenito 6b19be3
')
Chris PeBenito 6b19be3
Chris PeBenito 6b19be3
optional_policy(`
Chris PeBenito 6b19be3
	daemontools_service_domain(sshd_t, sshd_exec_t)
Chris PeBenito 6b19be3
')
Chris PeBenito 6b19be3
Chris PeBenito 6b19be3
optional_policy(`
Chris PeBenito 6b19be3
	inetd_tcp_service_domain(sshd_t, sshd_exec_t)
Chris PeBenito 6b19be3
')
Chris PeBenito 6b19be3
Chris PeBenito 6b19be3
optional_policy(`
Chris PeBenito 6b19be3
	rpm_use_script_fds(sshd_t)
Chris PeBenito 6b19be3
')
Chris PeBenito 6b19be3
Chris PeBenito 6b19be3
optional_policy(`
Chris PeBenito 296273a
	rssh_spec_domtrans(sshd_t)
Chris PeBenito 6b19be3
	# For reading /home/user/.ssh
Chris PeBenito 296273a
	rssh_read_ro_content(sshd_t)
Chris PeBenito 6b19be3
')
Chris PeBenito 6b19be3
Chris PeBenito 350b6ab
optional_policy(`
Chris PeBenito 350b6ab
	unconfined_domain(sshd_t)
Chris PeBenito 350b6ab
	unconfined_shell_domtrans(sshd_t)
Chris PeBenito 350b6ab
')
Chris PeBenito 350b6ab
Chris PeBenito 6b19be3
ifdef(`TODO',`
Chris PeBenito 6b19be3
tunable_policy(`ssh_sysadm_login',`
Chris PeBenito 6b19be3
	# Relabel and access ptys created by sshd
Chris PeBenito 6b19be3
	# ioctl is necessary for logout() processing for utmp entry and for w to
Chris PeBenito 6b19be3
	# display the tty.
Chris PeBenito 6b19be3
	# some versions of sshd on the new SE Linux require setattr
Chris PeBenito 6b19be3
	allow sshd_t ptyfile:chr_file relabelto;
Chris PeBenito 17de1b7
Chris PeBenito 17de1b7
	optional_policy(`
Chris PeBenito 6b19be3
		domain_trans(sshd_t, xauth_exec_t, userdomain)
Chris PeBenito 17de1b7
	')
Chris PeBenito 6b19be3
',`
Chris PeBenito 6b19be3
	optional_policy(`
Chris PeBenito 6b19be3
		domain_trans(sshd_t, xauth_exec_t, unpriv_userdomain)
Chris PeBenito 17de1b7
	')
Chris PeBenito 6b19be3
	# Relabel and access ptys created by sshd
Chris PeBenito 6b19be3
	# ioctl is necessary for logout() processing for utmp entry and for w to
Chris PeBenito 6b19be3
	# display the tty.
Chris PeBenito 6b19be3
	# some versions of sshd on the new SE Linux require setattr
Chris PeBenito 6b19be3
	allow sshd_t userpty_type:chr_file { relabelto read write getattr ioctl setattr };
Chris PeBenito 17de1b7
')
Chris PeBenito 6b19be3
') dnl endif TODO
Chris PeBenito 17de1b7
Chris PeBenito 17de1b7
########################################
Chris PeBenito 17de1b7
#
Chris PeBenito 17de1b7
# ssh_keygen local policy
Chris PeBenito 17de1b7
#
Chris PeBenito 17de1b7
Chris PeBenito 75beb95
# ssh_keygen_t is the type of the ssh-keygen program when run at install time
Chris PeBenito 75beb95
# and by sysadm_t
Chris PeBenito 17de1b7
Chris PeBenito 75beb95
dontaudit ssh_keygen_t self:capability sys_tty_config;
Chris PeBenito 75beb95
allow ssh_keygen_t self:process { sigchld sigkill sigstop signull signal };
Chris PeBenito 17de1b7
Chris PeBenito 75beb95
allow ssh_keygen_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 17de1b7
Chris PeBenito c0868a7
allow ssh_keygen_t sshd_key_t:file manage_file_perms;
Chris PeBenito 0bfccda
files_etc_filetrans(ssh_keygen_t, sshd_key_t, file)
Chris PeBenito 17de1b7
Chris PeBenito 75beb95
kernel_read_kernel_sysctls(ssh_keygen_t)
Chris PeBenito 17de1b7
Chris PeBenito 75beb95
fs_search_auto_mountpoints(ssh_keygen_t)
Chris PeBenito 17de1b7
Chris PeBenito 75beb95
dev_read_sysfs(ssh_keygen_t)
Chris PeBenito 75beb95
dev_read_urand(ssh_keygen_t)
Chris PeBenito 17de1b7
Chris PeBenito 75beb95
term_dontaudit_use_console(ssh_keygen_t)
Chris PeBenito 17de1b7
Chris PeBenito 75beb95
domain_use_interactive_fds(ssh_keygen_t)
Chris PeBenito 17de1b7
Chris PeBenito 75beb95
files_read_etc_files(ssh_keygen_t)
Chris PeBenito 17de1b7
Chris PeBenito 75beb95
init_use_fds(ssh_keygen_t)
Chris PeBenito 75beb95
init_use_script_ptys(ssh_keygen_t)
Chris PeBenito 17de1b7
Chris PeBenito 75beb95
logging_send_syslog_msg(ssh_keygen_t)
Chris PeBenito 17de1b7
Chris PeBenito 75beb95
userdom_dontaudit_use_unpriv_user_fds(ssh_keygen_t)
Chris PeBenito 17de1b7
Chris PeBenito 75beb95
optional_policy(`
Chris PeBenito 75beb95
	nscd_socket_use(ssh_keygen_t)
Chris PeBenito 75beb95
')
Chris PeBenito 17de1b7
Chris PeBenito 75beb95
optional_policy(`
Chris PeBenito 75beb95
	seutil_sigchld_newrole(ssh_keygen_t)
Chris PeBenito 75beb95
')
Chris PeBenito 75beb95
Chris PeBenito 75beb95
optional_policy(`
Chris PeBenito 75beb95
	udev_read_db(ssh_keygen_t)
Chris PeBenito 17de1b7
')