Changeset 2679

Show
Ignore:
Timestamp:
05/12/08 09:08:02 (7 months ago)
Author:
pebenito
Message:

rbacsep: initial collapse of user terminals.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/rbacsep/policy/modules/system/userdomain.if

    r2675 r2679  
    2626        gen_require(` 
    2727                attribute userdomain; 
     28                type user_devpts_t, user_tty_device_t; 
    2829                class context contains; 
    2930        ') 
     
    3940        allow system_r $1_r; 
    4041 
    41         type $1_devpts_t; 
    42         term_user_pty($1_t,$1_devpts_t) 
    43         files_type($1_devpts_t) 
    44  
    45         type $1_tty_device_t;  
    46         term_user_tty($1_t,$1_tty_device_t) 
     42        term_user_pty($1_t, user_devpts_t) 
     43        role $1_r types user_devpts_t; 
     44 
     45        term_user_tty($1_t, user_tty_device_t) 
     46        role $1_r types user_tty_device_t; 
    4747 
    4848        allow $1_t self:process { signal_perms getsched setsched share getpgid setpgid setcap getsession getattr }; 
     
    5858        dontaudit $1_t self:socket create; 
    5959 
    60         allow $1_t $1_devpts_t:chr_file { setattr ioctl read getattr lock write append }; 
    61         term_create_pty($1_t,$1_devpts_t) 
    62  
    63         allow $1_t $1_tty_device_t:chr_file { setattr rw_chr_file_perms }; 
     60        allow $1_t user_devpts_t:chr_file { setattr ioctl read getattr lock write append }; 
     61        # avoid annoying messages on terminal hangup on role change 
     62        dontaudit $1_t user_devpts_t:chr_file ioctl; 
     63 
     64        allow $1_t user_tty_device_t:chr_file { setattr rw_chr_file_perms }; 
     65        # avoid annoying messages on terminal hangup on role change 
     66        dontaudit $1_t user_tty_device_t:chr_file ioctl; 
    6467 
    6568        kernel_read_kernel_sysctls($1_t) 
     
    609612template(`userdom_change_password_template',` 
    610613        gen_require(` 
    611                 type $1_t, $1_devpts_t, $1_tty_device_t; 
     614                type $1_t, user_devpts_t, user_tty_device_t; 
    612615                role $1_r; 
    613616        ') 
    614617 
    615618        optional_policy(` 
    616                 usermanage_run_chfn($1_t,$1_r,{ $1_devpts_t $1_tty_device_t }) 
    617                 usermanage_run_passwd($1_t,$1_r,{ $1_devpts_t $1_tty_device_t }) 
     619                usermanage_run_chfn($1_t,$1_r,{ user_devpts_t user_tty_device_t }) 
     620                usermanage_run_passwd($1_t,$1_r,{ user_devpts_t user_tty_device_t }) 
    618621        ') 
    619622') 
     
    621624####################################### 
    622625## <summary> 
    623 ##      The template for allowing the user to change roles. 
     626##      The template for allowing the user to change roles.  (Deprecated) 
    624627## </summary> 
    625628## <param name="src_role_prefix"> 
     
    637640# 
    638641template(`userdom_role_change_template',` 
     642        refpolicywarn(`$0($*) has been deprecated, use a regular role allow statement instead.') 
     643 
    639644        gen_require(` 
    640645                role $1_r, $2_r; 
    641                 type $1_t, $2_t; 
    642                 type $1_devpts_t, $2_devpts_t; 
    643                 type $1_tty_device_t, $2_tty_device_t; 
    644646        ') 
    645647 
    646648        allow $1_r $2_r; 
    647         type_change $2_t $1_devpts_t:chr_file $2_devpts_t; 
    648         type_change $2_t $1_tty_device_t:chr_file $2_tty_device_t; 
    649         # avoid annoying messages on terminal hangup 
    650         dontaudit $1_t { $2_devpts_t $2_tty_device_t }:chr_file ioctl; 
    651649') 
    652650 
     
    738736        auth_read_login_records($1_t) 
    739737        auth_search_pam_console_data($1_t) 
    740         auth_run_pam($1_t,$1_r,{ $1_tty_device_t $1_devpts_t }) 
    741         auth_run_utempter($1_t,$1_r,{ $1_tty_device_t $1_devpts_t }) 
     738        auth_run_pam($1_t,$1_r,{ user_tty_device_t user_devpts_t }) 
     739        auth_run_utempter($1_t,$1_r,{ user_tty_device_t user_devpts_t }) 
    742740 
    743741        init_read_utmp($1_t) 
     
    745743        seutil_read_file_contexts($1_t) 
    746744        seutil_read_default_contexts($1_t) 
    747         seutil_run_newrole($1_t,$1_r,{ $1_devpts_t $1_tty_device_t }) 
     745        seutil_run_newrole($1_t,$1_r,{ user_devpts_t user_tty_device_t }) 
    748746        seutil_exec_checkpolicy($1_t) 
    749747        seutil_exec_setfiles($1_t) 
     
    873871 
    874872        optional_policy(` 
    875                 usernetctl_run($1_t,$1_r,{ $1_devpts_t $1_tty_device_t }) 
     873                usernetctl_run($1_t,$1_r,{ user_devpts_t user_tty_device_t }) 
    876874        ') 
    877875') 
     
    10201018        domain_interactive_fd($1_t) 
    10211019 
    1022         typeattribute $1_devpts_t user_ptynode; 
    10231020        typeattribute $1_home_dir_t user_home_dir_type; 
    10241021        typeattribute $1_home_t user_home_type; 
    10251022        typeattribute $1_tmp_t user_tmpfile; 
    1026         typeattribute $1_tty_device_t user_ttynode; 
    10271023 
    10281024        ############################## 
     
    10401036 
    10411037        optional_policy(` 
    1042                 loadkeys_run($1_t,$1_r,$1_tty_device_t) 
     1038                loadkeys_run($1_t,$1_r, user_tty_device_t) 
    10431039        ') 
    10441040') 
     
    11981194 
    11991195        optional_policy(` 
    1200                 netutils_run_ping_cond($1_t,$1_r,{ $1_tty_device_t $1_devpts_t }) 
    1201                 netutils_run_traceroute_cond($1_t,$1_r,{ $1_tty_device_t $1_devpts_t }) 
     1196                netutils_run_ping_cond($1_t,$1_r,{ user_tty_device_t user_devpts_t }) 
     1197                netutils_run_traceroute_cond($1_t,$1_r,{ user_tty_device_t user_devpts_t }) 
    12021198        ') 
    12031199 
    12041200        # Run pppd in pppd_t by default for user 
    12051201        optional_policy(` 
    1206                 ppp_run_cond($1_t,$1_r,{ $1_tty_device_t $1_devpts_t }) 
     1202                ppp_run_cond($1_t,$1_r,{ user_tty_device_t user_devpts_t }) 
    12071203        ') 
    12081204 
     
    12631259                domain_system_change_exemption($1_t) 
    12641260        ') 
    1265          
    1266         typeattribute $1_devpts_t admin_terminal; 
    1267  
    1268         typeattribute $1_tty_device_t admin_terminal; 
    12691261 
    12701262        ############################## 
  • branches/rbacsep/policy/modules/system/userdomain.te

    r2675 r2679  
    8585attribute untrusted_content_type; 
    8686attribute untrusted_content_tmp_type; 
     87 
     88type user_devpts_t alias { staff_devpts_t sysadm_devpts_t secadm_devpts_t auditadm_devpts_t unconfined_devpts_t }; 
     89dev_node(user_devpts_t) 
     90files_type(user_devpts_t) 
     91 
     92type user_tty_device_t alias { staff_tty_device_t sysadm_tty_device_t secadm_tty_device_t auditadm_tty_device_t unconfined_tty_device_t }; 
     93dev_node(user_tty_device_t)