Changeset 2634

Show
Ignore:
Timestamp:
03/11/08 14:55:00 (9 months ago)
Author:
pebenito
Message:

xselinux: update to trunk 2633.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/xselinux/Changelog

    r2613 r2634  
     1- Revise upstart support in init module to use a tunable, as upstart is now 
     2  used in Fedora too. 
     3- Add iferror.m4 rather generate it out of the Makefiles. 
     4- Definitions for open permisson on file and similar objects from Eric 
     5  Paris. 
     6- Apt updates for ptys and logs, from Martin Orr. 
     7- RPC update from Vaclav Ovsik. 
     8- Exim updates on Debian from Devin Carrawy. 
     9- Pam and samba updates from Stefan Schulze Frielinghaus. 
     10- Backup update on Debian from Vaclav Ovsik. 
     11- Cracklib update on Debian from Vaclav Ovsik. 
    112- Label /proc/kallsyms with system_map_t. 
    213- 64-bit capabilities from Stephen Smalley. 
  • branches/xselinux/Makefile

    r2614 r2634  
    102102comment_move_decl := $(SED) -r -f $(support)/comment_move_decl.sed 
    103103gennetfilter := $(PYTHON) -E $(support)/gennetfilter.py 
     104m4iferror := $(support)/iferror.m4 
    104105# use our own genhomedircon to make sure we have a known usable one, 
    105106# so policycoreutils updates are not required (RHEL4) 
  • branches/xselinux/Rules.modular

    r2573 r2634  
    137137        $(verbose) $(M4) $(M4PARAM) $^ > $@ 
    138138 
    139 $(tmpdir)/all_interfaces.conf: $(m4support) $(all_interfaces) 
    140         @test -d $(tmpdir) || mkdir -p $(tmpdir) 
    141         @echo "ifdef(\`__if_error',\`m4exit(1)')" > $(tmpdir)/iferror.m4 
     139$(tmpdir)/all_interfaces.conf: $(m4support) $(all_interfaces) $(m4iferror) 
     140        @test -d $(tmpdir) || mkdir -p $(tmpdir) 
    142141        @echo "divert(-1)" > $@ 
    143         $(verbose) $(M4) $^ $(tmpdir)/iferror.m4 >> $(tmpdir)/$(@F).tmp 
     142        $(verbose) $(M4) $^ >> $(tmpdir)/$(@F).tmp 
    144143        $(verbose) $(SED) -e s/dollarsstar/\$$\*/g $(tmpdir)/$(@F).tmp >> $@ 
    145144        @echo "divert" >> $@ 
  • branches/xselinux/Rules.monolithic

    r2548 r2634  
    125125        $(verbose) $(M4) $(M4PARAM) $^ > $@ 
    126126 
    127 $(tmpdir)/all_interfaces.conf: $(m4support) $(all_interfaces) 
    128         @test -d $(tmpdir) || mkdir -p $(tmpdir) 
    129         @echo "ifdef(\`__if_error',\`m4exit(1)')" > $(tmpdir)/iferror.m4 
     127$(tmpdir)/all_interfaces.conf: $(m4support) $(all_interfaces) $(m4iferror) 
     128        @test -d $(tmpdir) || mkdir -p $(tmpdir) 
    130129        @echo "divert(-1)" > $@ 
    131         $(verbose) $(M4) $^ $(tmpdir)/iferror.m4 >> $(tmpdir)/$(@F).tmp 
     130        $(verbose) $(M4) $^ >> $(tmpdir)/$(@F).tmp 
    132131        $(verbose) $(SED) -e s/dollarsstar/\$$\*/g $(tmpdir)/$(@F).tmp >> $@ 
    133132        @echo "divert" >> $@ 
  • branches/xselinux/policy/flask/access_vectors

    r2620 r2634  
    126126        search 
    127127        rmdir 
     128        open 
    128129} 
    129130 
     
    134135        entrypoint 
    135136        execmod 
     137        open 
    136138} 
    137139 
     
    145147        entrypoint 
    146148        execmod 
     149        open 
    147150} 
    148151 
    149152class blk_file 
    150153inherits file 
     154{ 
     155        open 
     156} 
    151157 
    152158class sock_file 
     
    155161class fifo_file 
    156162inherits file 
     163{ 
     164        open 
     165} 
    157166 
    158167class fd 
  • branches/xselinux/policy/modules/admin/apt.fc

    r1589 r2634  
    1212/var/lib/apt(/.*)?                      gen_context(system_u:object_r:apt_var_lib_t,s0) 
    1313/var/lib/aptitude(/.*)?         gen_context(system_u:object_r:apt_var_lib_t,s0) 
     14 
     15# dpkg terminal log 
     16/var/log/apt(/.*)?                      gen_context(system_u:object_r:apt_var_log_t,s0) 
  • branches/xselinux/policy/modules/admin/apt.if

    r2169 r2634  
    112112######################################## 
    113113## <summary> 
     114##      Read from and write to apt ptys. 
     115## </summary> 
     116## <param name="domain"> 
     117##      <summary> 
     118##      Domain allowed access. 
     119##      </summary> 
     120## </param> 
     121# 
     122interface(`apt_use_ptys',` 
     123        gen_require(` 
     124                type apt_devpts_t; 
     125        ') 
     126 
     127        allow $1 apt_devpts_t:chr_file rw_term_perms; 
     128') 
     129 
     130######################################## 
     131## <summary> 
    114132##      Read the apt package database. 
    115133## </summary> 
  • branches/xselinux/policy/modules/admin/apt.te

    r2573 r2634  
    11 
    2 policy_module(apt,1.3.0
     2policy_module(apt,1.3.1
    33 
    44######################################## 
     
    1212domain_system_change_exemption(apt_t) 
    1313role system_r types apt_t; 
     14 
     15# pseudo terminal for running dpkg 
     16type apt_devpts_t; 
     17term_pty(apt_devpts_t) 
    1418 
    1519type apt_tmp_t; 
     
    2630type apt_var_cache_t alias var_cache_apt_t; 
    2731files_type(apt_var_cache_t) 
     32 
     33type apt_var_log_t; 
     34logging_log_file(apt_var_log_t) 
    2835 
    2936######################################## 
     
    98105fs_getattr_all_fs(apt_t) 
    99106 
     107term_create_pty(apt_t, apt_devpts_t) 
    100108term_list_ptys(apt_t) 
    101109term_use_all_terms(apt_t) 
  • branches/xselinux/policy/modules/admin/backup.fc

    r1797 r2634  
    55 
    66#/usr/local/bin/backup-script   --      gen_context(system_u:object_r:backup_exec_t,s0) 
     7 
     8ifdef(`distro_debian',` 
     9/etc/cron.daily/aptitude        --      gen_context(system_u:object_r:backup_exec_t,s0) 
     10/etc/cron.daily/standard        --      gen_context(system_u:object_r:backup_exec_t,s0) 
     11') 
     12 
    713/var/backups(/.*)?                      gen_context(system_u:object_r:backup_store_t,s0) 
  • branches/xselinux/policy/modules/admin/backup.te

    r2360 r2634  
    11 
    2 policy_module(backup,1.2.0
     2policy_module(backup,1.2.1
    33 
    44######################################## 
     
    2828 
    2929allow backup_t backup_store_t:file setattr; 
    30 create_files_pattern(backup_t,backup_store_t,backup_store_t) 
     30manage_files_pattern(backup_t,backup_store_t,backup_store_t) 
    3131rw_files_pattern(backup_t,backup_store_t,backup_store_t) 
    3232read_lnk_files_pattern(backup_t,backup_store_t,backup_store_t) 
     
    3636 
    3737corecmd_exec_bin(backup_t) 
     38corecmd_exec_shell(backup_t) 
    3839 
    3940corenet_all_recvfrom_unlabeled(backup_t) 
  • branches/xselinux/policy/modules/admin/dpkg.te

    r2573 r2634  
    11 
    2 policy_module(dpkg,1.4.0
     2policy_module(dpkg,1.4.1
    33 
    44######################################## 
     
    151151 
    152152init_domtrans_script(dpkg_t) 
     153init_use_script_ptys(dpkg_t) 
    153154 
    154155libs_use_ld_so(dpkg_t) 
     
    172173# since the scripts aren't labeled correctly yet... 
    173174allow dpkg_t dpkg_var_lib_t:file execute; 
     175 
     176optional_policy(` 
     177        apt_use_ptys(dpkg_t) 
     178') 
    174179 
    175180# TODO: allow? 
     
    291296 
    292297init_domtrans_script(dpkg_script_t) 
     298init_use_script_fds(dpkg_script_t) 
    293299 
    294300libs_use_ld_so(dpkg_script_t) 
     
    315321 
    316322optional_policy(` 
     323        apt_rw_pipes(dpkg_script_t) 
     324        apt_use_fds(dpkg_script_t) 
     325') 
     326 
     327optional_policy(` 
    317328        bootloader_domtrans(dpkg_script_t) 
    318329') 
  • branches/xselinux/policy/modules/admin/logrotate.fc

    r1993 r2634  
    44 
    55ifdef(`distro_debian', ` 
    6 /usr/bin/savelog        --      gen_context(system_u:object_r:logrotate_exec_t,s0) 
    76/var/lib/logrotate(/.*)?        gen_context(system_u:object_r:logrotate_var_lib_t,s0) 
    87', ` 
  • branches/xselinux/policy/modules/admin/logrotate.te

    r2573 r2634  
    11 
    2 policy_module(logrotate,1.7.0
     2policy_module(logrotate,1.7.1
    33 
    44######################################## 
  • branches/xselinux/policy/modules/admin/usermanage.te

    r2573 r2634  
    11 
    2 policy_module(usermanage,1.9.0
     2policy_module(usermanage,1.9.1
    33 
    44######################################## 
     
    162162userdom_dontaudit_search_sysadm_home_dirs(crack_t) 
    163163 
     164ifdef(`distro_debian',` 
     165        # the package cracklib-runtime on Debian contains a daily maintenance 
     166        # script /etc/cron.daily/cracklib-runtime, that calls 
     167        # update-cracklib and that calls crack_mkdict, which is a shell script. 
     168        corecmd_exec_shell(crack_t) 
     169') 
     170 
    164171optional_policy(` 
    165172        cron_system_entry(crack_t,crack_exec_t) 
  • branches/xselinux/policy/modules/apps/loadkeys.te

    r2573 r2634  
    11 
    2 policy_module(loadkeys,1.3.0
     2policy_module(loadkeys,1.3.1
    33 
    44######################################## 
     
    3333term_use_unallocated_ttys(loadkeys_t) 
    3434 
     35init_dontaudit_use_fds(loadkeys_t) 
    3536init_dontaudit_use_script_ptys(loadkeys_t) 
    3637 
  • branches/xselinux/policy/modules/kernel/storage.if

    r2548 r2634  
    168168 
    169169        dontaudit $1 fixed_disk_device_t:blk_file write_blk_file_perms; 
     170') 
     171 
     172######################################## 
     173## <summary> 
     174##      Allow the caller to directly read and write to a fixed disk. 
     175##      This is extremly dangerous as it can bypass the 
     176##      SELinux protections for filesystem objects, and 
     177##      should only be used by trusted domains. 
     178## </summary> 
     179## <param name="domain"> 
     180##      <summary> 
     181##      Domain allowed access. 
     182##      </summary> 
     183## </param> 
     184# 
     185interface(`storage_raw_rw_fixed_disk',` 
     186        storage_raw_read_fixed_disk($1) 
     187        storage_raw_write_fixed_disk($1) 
    170188') 
    171189 
  • branches/xselinux/policy/modules/kernel/storage.te

    r2573 r2634  
    11 
    2 policy_module(storage,1.5.0
     2policy_module(storage,1.5.1
    33 
    44######################################## 
  • branches/xselinux/policy/modules/services/dovecot.fc

    r1933 r2634  
    2828# 
    2929/var/run/dovecot(-login)?(/.*)?         gen_context(system_u:object_r:dovecot_var_run_t,s0) 
     30# this is a hard link to /var/lib/dovecot/ssl-parameters.dat 
     31/var/run/dovecot/login/ssl-parameters.dat       gen_context(system_u:object_r:dovecot_var_lib_t,s0) 
    3032 
    3133/var/lib/dovecot(/.*)?                  gen_context(system_u:object_r:dovecot_var_lib_t,s0) 
  • branches/xselinux/policy/modules/services/dovecot.if

    r2169 r2634  
    1919        manage_lnk_files_pattern($1,dovecot_spool_t,dovecot_spool_t) 
    2020') 
     21 
     22######################################## 
     23## <summary> 
     24##      Do not audit attempts to delete dovecot lib files. 
     25## </summary> 
     26## <param name="domain"> 
     27##      <summary> 
     28##      Domain to not audit. 
     29##      </summary> 
     30## </param> 
     31# 
     32interface(`dovecot_dontaudit_unlink_lib_files',` 
     33        gen_require(` 
     34                type dovecot_var_lib_t; 
     35        ') 
     36 
     37        dontaudit $1 dovecot_var_lib_t:file unlink; 
     38') 
  • branches/xselinux/policy/modules/services/dovecot.te

    r2573 r2634  
    11 
    2 policy_module(dovecot,1.7.0
     2policy_module(dovecot,1.7.1
    33 
    44######################################## 
  • branches/xselinux/policy/modules/services/exim.fc

    r2548 r2634  
    1 /usr/sbin/exim          --      gen_context(system_u:object_r:exim_exec_t,s0) 
    2 /var/log/exim(/.*)?             gen_context(system_u:object_r:exim_log_t,s0) 
    3 /var/run/exim.pid       --      gen_context(system_u:object_r:exim_var_run_t,s0) 
    4 /var/spool/exim(/.*)?           gen_context(system_u:object_r:exim_spool_t,s0) 
     1/usr/sbin/exim[0-9]?            --      gen_context(system_u:object_r:exim_exec_t,s0) 
     2/var/log/exim[0-9]?(/.*)?               gen_context(system_u:object_r:exim_log_t,s0) 
     3/var/run/exim[0-9]?\.pid        --      gen_context(system_u:object_r:exim_var_run_t,s0) 
     4/var/spool/exim[0-9]?(/.*)?             gen_context(system_u:object_r:exim_spool_t,s0) 
     5 
     6ifdef(`distro_debian',` 
     7/var/run/exim[0-9]?(/.*)?               gen_context(system_u:object_r:exim_var_run_t,s0) 
     8') 
  • branches/xselinux/policy/modules/services/exim.te

    r2548 r2634  
    11 
    2 policy_module(exim,1.0.0
     2policy_module(exim,1.0.1
    33 
    44######################################## 
     
    4343# 
    4444 
    45 allow exim_t self:capability { dac_override dac_read_search setuid setgid }; 
     45allow exim_t self:capability { dac_override dac_read_search setuid setgid fowner chown }; 
    4646allow exim_t self:fifo_file rw_fifo_file_perms; 
    4747allow exim_t self:unix_stream_socket create_stream_socket_perms; 
     
    6868kernel_read_kernel_sysctls(exim_t) 
    6969 
     70kernel_dontaudit_read_system_state(exim_t) 
     71 
    7072corecmd_search_bin(exim_t) 
    7173 
     
    7880corenet_tcp_bind_amavisd_send_port(exim_t) 
    7981corenet_tcp_connect_auth_port(exim_t) 
     82corenet_tcp_connect_smtp_port(exim_t) 
     83corenet_tcp_connect_ldap_port(exim_t) 
    8084corenet_tcp_connect_inetd_child_port(exim_t) 
     85 
     86dev_read_rand(exim_t) 
     87dev_read_urand(exim_t) 
    8188 
    8289# Init script handling 
  • branches/xselinux/policy/modules/services/rpc.fc

    r2181 r2634  
    88# 
    99/sbin/rpc\..*           --      gen_context(system_u:object_r:rpcd_exec_t,s0) 
     10/sbin/sm-notify         --      gen_context(system_u:object_r:rpcd_exec_t,s0) 
    1011 
    1112# 
  • branches/xselinux/policy/modules/services/rpc.te

    r2573 r2634  
    11 
    2 policy_module(rpc,1.7.0
     2policy_module(rpc,1.7.1
    33 
    44######################################## 
     
    6161files_pid_filetrans(rpcd_t,rpcd_var_run_t,file) 
    6262 
     63# rpc.statd executes sm-notify 
     64can_exec(rpcd_t, rpcd_exec_t) 
     65corecmd_search_bin(rpcd_t) 
     66 
    6367kernel_read_system_state(rpcd_t)  
    6468kernel_search_network_state(rpcd_t)  
    6569# for rpc.rquotad 
    6670kernel_read_sysctl(rpcd_t)   
     71kernel_rw_fs_sysctls(rpcd_t) 
    6772 
    6873fs_list_rpc(rpcd_t) 
  • branches/xselinux/policy/modules/services/samba.te

    r2573 r2634  
    11 
    2 policy_module(samba,1.7.0
     2policy_module(samba,1.7.1
    33 
    44################################# 
     
    223223 
    224224create_dirs_pattern(smbd_t,samba_log_t,samba_log_t) 
    225 create_files_pattern(smbd_t,samba_log_t,samba_log_t) 
     225manage_files_pattern(smbd_t,samba_log_t,samba_log_t) 
    226226allow smbd_t samba_log_t:dir setattr; 
    227227dontaudit smbd_t samba_log_t:dir remove_name; 
  • branches/xselinux/policy/modules/system/authlogin.fc

    r2573 r2634  
    4242/var/run/console(/.*)?          gen_context(system_u:object_r:pam_var_console_t,s0) 
    4343 
     44/var/run/pam_mount(/.*)?        gen_context(system_u:object_r:pam_var_run_t,s0) 
    4445/var/run/sudo(/.*)?             gen_context(system_u:object_r:pam_var_run_t,s0) 
  • branches/xselinux/policy/modules/system/authlogin.te

    r2613 r2634  
    11 
    2 policy_module(authlogin,1.9.1
     2policy_module(authlogin,1.9.2
    33 
    44######################################## 
  • branches/xselinux/policy/modules/system/init.te

    r2613 r2634  
    11 
    2 policy_module(init,1.9.0
     2policy_module(init,1.9.2
    33 
    44gen_require(` 
     
    1010# Declarations 
    1111# 
     12 
     13## <desc> 
     14## <p> 
     15## Enable support for upstart as the init program. 
     16## </p> 
     17## </desc> 
     18gen_tunable(init_upstart,false) 
    1219 
    1320# used for direct running of init scripts 
     
    5057domain_entry_file(initrc_t,initrc_exec_t) 
    5158role system_r types initrc_t; 
     59# should be part of the true block 
     60# of the below init_upstart tunable 
     61# but this has a typeattribute in it 
     62corecmd_shell_entry_type(initrc_t) 
    5263 
    5364type initrc_devpts_t; 
     
    164175') 
    165176 
    166 ifndef(`distro_ubuntu',` 
     177tunable_policy(`init_upstart',` 
     178        corecmd_shell_domtrans(init_t,initrc_t) 
     179',` 
    167180        # Run the shell in the sysadm role for single-user mode. 
    168181        # causes problems with upstart 
     
    560573 
    561574optional_policy(` 
     575        # /var/run/dovecot/login/ssl-parameters.dat is a hard link to 
     576        # /var/lib/dovecot/ssl-parameters.dat and init tries to clean up 
     577        # the directory. But we do not want to allow this. 
     578        # The master process of dovecot will manage this file. 
     579        dovecot_dontaudit_unlink_lib_files(initrc_t) 
     580') 
     581 
     582optional_policy(` 
    562583        ftp_read_config(initrc_t) 
    563584') 
  • branches/xselinux/policy/modules/system/libraries.te

    r2613 r2634  
    11 
    2 policy_module(libraries,2.0.0
     2policy_module(libraries,2.0.1
    33 
    44######################################## 
     
    9999 
    100100optional_policy(` 
     101        apt_rw_pipes(ldconfig_t) 
     102        apt_use_fds(ldconfig_t) 
     103        apt_use_ptys(ldconfig_t) 
     104') 
     105 
     106optional_policy(` 
    101107        # When you install a kernel the postinstall builds a initrd image in tmp  
    102108        # and executes ldconfig on it.  If you dont allow this kernel installs  
  • branches/xselinux/policy/modules/system/logging.fc

    r2573 r2634  
    1616/usr/sbin/klogd         --      gen_context(system_u:object_r:klogd_exec_t,s0) 
    1717/usr/sbin/metalog       --      gen_context(system_u:object_r:syslogd_exec_t,s0) 
     18/usr/sbin/rklogd        --      gen_context(system_u:object_r:klogd_exec_t,s0) 
     19/usr/sbin/rsyslogd      --      gen_context(system_u:object_r:syslogd_exec_t,s0) 
     20/usr/sbin/syslog-ng     --      gen_context(system_u:object_r:syslogd_exec_t,s0) 
    1821/usr/sbin/syslogd       --      gen_context(system_u:object_r:syslogd_exec_t,s0) 
    19 ifdef(`distro_gentoo', ` 
    20 /usr/sbin/syslog-ng     --      gen_context(system_u:object_r:syslogd_exec_t,s0) 
    21 ') 
    2222 
    2323ifdef(`distro_suse', ` 
  • branches/xselinux/policy/modules/system/logging.te

    r2613 r2634  
    11 
    2 policy_module(logging,1.9.0
     2policy_module(logging,1.9.1
    33 
    44########################################