aboutsummaryrefslogtreecommitdiff
blob: 6d9fc5c343480d4b06053e4cd4aa19bbfee8742a (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
64
65
66
67
68
69
70
71
72
73
74
75
76
policy_module(chkrootkit, 1.1.0)

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

attribute_role chkrootkit_roles;

type chkrootkit_t;
type chkrootkit_exec_t;
application_domain(chkrootkit_t, chkrootkit_exec_t)
role chkrootkit_roles types chkrootkit_t;

type chkrootkit_log_t;
logging_log_file(chkrootkit_log_t)

########################################
#
# Application local policy
#

allow chkrootkit_t self:capability { dac_read_search setuid sys_ptrace };
allow chkrootkit_t self:fifo_file rw_fifo_file_perms;
allow chkrootkit_t self:udp_socket { create ioctl };

kernel_read_all_sysctls(chkrootkit_t)
kernel_getattr_proc(chkrootkit_t)
kernel_read_network_state(chkrootkit_t)
kernel_getattr_message_if(chkrootkit_t)

corecmd_exec_bin(chkrootkit_t)
corecmd_exec_shell(chkrootkit_t)

dev_getattr_fs(chkrootkit_t)
dev_read_rand(chkrootkit_t)
dev_read_urand(chkrootkit_t)
dev_getattr_all_chr_files(chkrootkit_t)

domain_read_all_domains_state(chkrootkit_t)
domain_use_interactive_fds(chkrootkit_t)
domain_getattr_all_sockets(chkrootkit_t)
domain_getattr_all_pipes(chkrootkit_t)

files_read_non_auth_files(chkrootkit_t)
files_read_all_symlinks(chkrootkit_t)
files_read_all_chr_files(chkrootkit_t)
files_getattr_all_pipes(chkrootkit_t)

fs_getattr_xattr_fs(chkrootkit_t)

init_signal(chkrootkit_t)

logging_send_syslog_msg(chkrootkit_t)

miscfiles_read_localization(chkrootkit_t)

term_getattr_unallocated_ttys(chkrootkit_t)

userdom_use_inherited_user_terminals(chkrootkit_t)

usermanage_check_exec_passwd(chkrootkit_t)

ifdef(`init_systemd',`
	# start as systemd timer
	init_system_domain(chkrootkit_t, chkrootkit_exec_t)
')

optional_policy(`
	cron_system_entry(chkrootkit_t, chkrootkit_exec_t)
	cron_exec_crontab(chkrootkit_t)
')

optional_policy(`
	ssh_exec(chkrootkit_t)
')