aboutsummaryrefslogtreecommitdiff
blob: ee4ec4e298723f44c56f36c9367cf4ce6a31f322 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
policy_module(dphysswapfile, 1.2.0)

########################################
#
# Declarations
#

type dphysswapfile_t;
type dphysswapfile_exec_t;
init_system_domain(dphysswapfile_t, dphysswapfile_exec_t)

type dphysswapfile_conf_t;
files_config_file(dphysswapfile_conf_t)

type dphysswapfile_initrc_exec_t;
init_script_file(dphysswapfile_initrc_exec_t)

type dphysswapfile_swap_t;
files_type(dphysswapfile_swap_t)

type dphysswapfile_unit_t;
init_unit_file(dphysswapfile_unit_t)

########################################
#
# Policy
#

# sys_admin : swapon
allow dphysswapfile_t self:capability sys_admin;
allow dphysswapfile_t self:fifo_file rw_fifo_file_perms;
allow dphysswapfile_t self:unix_stream_socket { create connect };

allow dphysswapfile_t dphysswapfile_conf_t:file read_file_perms;

allow dphysswapfile_t dphysswapfile_exec_t:file execute_no_trans;

allow dphysswapfile_t dphysswapfile_swap_t:file { manage_file_perms relabelfrom };

kernel_read_system_state(dphysswapfile_t)

corecmd_exec_bin(dphysswapfile_t)
corecmd_exec_shell(dphysswapfile_t)

dev_read_rand(dphysswapfile_t)
dev_read_urand(dphysswapfile_t)

# ignore ls -l /var/swap noise
files_dontaudit_getattr_pid_dirs(dphysswapfile_t)
files_read_etc_files(dphysswapfile_t)
files_search_var(dphysswapfile_t)
files_var_filetrans(dphysswapfile_t, dphysswapfile_swap_t, file)

fstools_exec(dphysswapfile_t)
# swapfile_t is hardcoded in mkswap
fstools_manage_swap_files(dphysswapfile_t)
fstools_relabelto_swap_files(dphysswapfile_t)

miscfiles_read_localization(dphysswapfile_t)

storage_getattr_removable_dev(dphysswapfile_t)

userdom_dontaudit_search_user_home_dirs(dphysswapfile_t)