Changeset 229
- Timestamp:
- 08/01/08 16:03:27
(4 months ago)
- Author:
- jtang
- Message:
Preliminary ovaldi SELinux policy.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r206 |
r229 |
|
| 1791 | 1791 | netlabel = module |
|---|
| 1792 | 1792 | |
|---|
| | 1793 | # Layer: apps |
|---|
| | 1794 | # Module: ovaldi |
|---|
| | 1795 | # |
|---|
| | 1796 | # OVAL interpreter |
|---|
| | 1797 | # |
|---|
| | 1798 | ovaldi = module |
|---|
| | 1799 | |
|---|
| 1793 | 1800 | # Layer: system |
|---|
| 1794 | 1801 | # Module: pcmcia |
|---|
| r153 |
r229 |
|
| 1 | | /usr/bin/updatedb -- gen_context(system_u:object_r:locate_exec_t, s0) |
|---|
| 2 | | /var/lib/[sm]locate(/.*)? gen_context(system_u:object_r:locate_var_lib_t,s0) |
|---|
| | 1 | /usr/sbin/ovaldi -- gen_context(system_u:object_r:ovaldi_exec_t, s0) |
|---|
| | 2 | /usr/sbin/ovaldi.sh -- gen_context(system_u:object_r:ovaldi_exec_t, s0) |
|---|
| | 3 | /var/log/ovaldi(/.*)? gen_context(system_u:object_r:ovaldi_log_t,s0) |
|---|
| r153 |
r229 |
|
| 1 | | ## <summary>Update database for mlocate</summary> |
|---|
| 2 | | |
|---|
| 3 | | ######################################## |
|---|
| 4 | | ## <summary> |
|---|
| 5 | | ## Create the locate log with append mode. |
|---|
| 6 | | ## </summary> |
|---|
| 7 | | ## <param name="domain"> |
|---|
| 8 | | ## <summary> |
|---|
| 9 | | ## Domain allowed access. |
|---|
| 10 | | ## </summary> |
|---|
| 11 | | ## </param> |
|---|
| 12 | | # |
|---|
| 13 | | interface(`slocate_create_append_log',` |
|---|
| 14 | | gen_require(` |
|---|
| 15 | | type locate_log_t; |
|---|
| 16 | | ') |
|---|
| 17 | | |
|---|
| 18 | | logging_search_logs($1) |
|---|
| 19 | | create_files_pattern($1,locate_log_t,locate_log_t) |
|---|
| 20 | | append_files_pattern($1,locate_log_t,locate_log_t) |
|---|
| 21 | | ') |
|---|
| 22 | | |
|---|
| 23 | | ######################################## |
|---|
| 24 | | ## <summary> |
|---|
| 25 | | ## Read locate lib files. |
|---|
| 26 | | ## </summary> |
|---|
| 27 | | ## <param name="domain"> |
|---|
| 28 | | ## <summary> |
|---|
| 29 | | ## Domain allowed access. |
|---|
| 30 | | ## </summary> |
|---|
| 31 | | ## </param> |
|---|
| 32 | | # |
|---|
| 33 | | interface(`locate_read_lib_files',` |
|---|
| 34 | | gen_require(` |
|---|
| 35 | | type locate_var_lib_t; |
|---|
| 36 | | ') |
|---|
| 37 | | |
|---|
| 38 | | read_files_pattern($1,locate_var_lib_t,locate_var_lib_t) |
|---|
| 39 | | allow $1 locate_var_lib_t:dir list_dir_perms; |
|---|
| 40 | | files_search_var_lib($1) |
|---|
| 41 | | ') |
|---|
| | 1 | ## <summary>OVAL Interpreter</summary> |
|---|
| r203 |
r229 |
|
| 1 | | |
|---|
| 2 | | policy_module(slocate,1.7.0) |
|---|
| | 1 | policy_module(ovaldi,1.0) |
|---|
| 3 | 2 | |
|---|
| 4 | 3 | ################################# |
|---|
| … | … | |
| 7 | 6 | # |
|---|
| 8 | 7 | |
|---|
| 9 | | type locate_t; |
|---|
| 10 | | type locate_exec_t; |
|---|
| 11 | | init_system_domain(locate_t,locate_exec_t) |
|---|
| | 8 | type ovaldi_t; |
|---|
| | 9 | type ovaldi_exec_t; |
|---|
| | 10 | init_system_domain(ovaldi_t,ovaldi_exec_t) |
|---|
| | 11 | role sysadm_r types ovaldi_t; |
|---|
| 12 | 12 | |
|---|
| 13 | | type locate_log_t; |
|---|
| 14 | | logging_log_file(locate_log_t) |
|---|
| 15 | | |
|---|
| 16 | | type locate_var_lib_t; |
|---|
| 17 | | files_type(locate_var_lib_t) |
|---|
| | 13 | type ovaldi_log_t; |
|---|
| | 14 | logging_log_file(ovaldi_log_t) |
|---|
| 18 | 15 | |
|---|
| 19 | 16 | ######################################## |
|---|
| … | … | |
| 22 | 19 | # |
|---|
| 23 | 20 | |
|---|
| 24 | | allow locate_t self:capability { chown dac_read_search dac_override fowner fsetid }; |
|---|
| 25 | | allow locate_t self:process { execmem execheap execstack }; |
|---|
| 26 | | allow locate_t self:fifo_file rw_fifo_file_perms; |
|---|
| 27 | | allow locate_t self:unix_stream_socket create_socket_perms; |
|---|
| | 21 | allow ovaldi_t self:capability { dac_read_search dac_override fowner fsetid }; |
|---|
| 28 | 22 | |
|---|
| 29 | | manage_dirs_pattern(locate_t,locate_var_lib_t,locate_var_lib_t) |
|---|
| 30 | | manage_files_pattern(locate_t,locate_var_lib_t,locate_var_lib_t) |
|---|
| | 23 | corecmd_exec_bin(ovaldi_t) |
|---|
| | 24 | corecmd_exec_shell(ovaldi_t) |
|---|
| 31 | 25 | |
|---|
| 32 | | kernel_read_system_state(locate_t) |
|---|
| 33 | | kernel_dontaudit_search_sysctl(locate_t) |
|---|
| | 26 | files_list_all(ovaldi_t) |
|---|
| | 27 | files_getattr_all_files(ovaldi_t) |
|---|
| 34 | 28 | |
|---|
| 35 | | corecmd_exec_bin(locate_t) |
|---|
| | 29 | fs_getattr_all_fs(ovaldi_t) |
|---|
| | 30 | fs_getattr_all_files(ovaldi_t) |
|---|
| | 31 | fs_list_all(ovaldi_t) |
|---|
| 36 | 32 | |
|---|
| 37 | | dev_getattr_all_blk_files(locate_t) |
|---|
| 38 | | dev_getattr_all_chr_files(locate_t) |
|---|
| | 33 | libs_use_shared_libs(ovaldi_t) |
|---|
| | 34 | libs_use_ld_so(ovaldi_t) |
|---|
| 39 | 35 | |
|---|
| 40 | | files_list_all(locate_t) |
|---|
| 41 | | files_getattr_all_files(locate_t) |
|---|
| 42 | | files_getattr_all_pipes(locate_t) |
|---|
| 43 | | files_getattr_all_sockets(locate_t) |
|---|
| 44 | | files_read_etc_runtime_files(locate_t) |
|---|
| 45 | | files_read_etc_files(locate_t) |
|---|
| 46 | | |
|---|
| 47 | | fs_getattr_all_fs(locate_t) |
|---|
| 48 | | fs_getattr_all_files(locate_t) |
|---|
| 49 | | fs_list_all(locate_t) |
|---|
| 50 | | |
|---|
| 51 | | # getpwnam |
|---|
| 52 | | auth_use_nsswitch(locate_t) |
|---|
| 53 | | |
|---|
| 54 | | libs_use_shared_libs(locate_t) |
|---|
| 55 | | libs_use_ld_so(locate_t) |
|---|
| 56 | | |
|---|
| 57 | | miscfiles_read_localization(locate_t) |
|---|
| 58 | | |
|---|
| 59 | | ifdef(`enable_mls',` |
|---|
| 60 | | # On MLS machines will not be allowed to getattr Anything but SystemLow |
|---|
| 61 | | files_dontaudit_getattr_all_dirs(locate_t) |
|---|
| 62 | | ') |
|---|
| 63 | | |
|---|
| 64 | | optional_policy(` |
|---|
| 65 | | cron_system_entry(locate_t, locate_exec_t) |
|---|
| 66 | | ') |
|---|
| | 36 | miscfiles_read_localization(ovaldi_t) |
|---|
Download in other formats:
* Generating other formats may take time.