policy_module(ddcprobe, 1.3.0)

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

attribute_role ddcprobe_roles;
roleattribute system_r ddcprobe_roles;

type ddcprobe_t;
type ddcprobe_exec_t;
application_domain(ddcprobe_t, ddcprobe_exec_t)
role ddcprobe_roles types ddcprobe_t;

########################################
#
# Local policy
#

allow ddcprobe_t self:capability { sys_rawio sys_admin };
allow ddcprobe_t self:process execmem;

kernel_read_system_state(ddcprobe_t)
kernel_read_kernel_sysctls(ddcprobe_t)
kernel_change_ring_buffer_level(ddcprobe_t)

files_search_kernel_modules(ddcprobe_t)

corecmd_list_bin(ddcprobe_t)
corecmd_exec_bin(ddcprobe_t)

dev_read_urand(ddcprobe_t)
dev_read_raw_memory(ddcprobe_t)
dev_wx_raw_memory(ddcprobe_t)

files_read_etc_runtime_files(ddcprobe_t)

term_use_all_ttys(ddcprobe_t)
term_use_all_ptys(ddcprobe_t)

libs_read_lib_files(ddcprobe_t)

miscfiles_read_localization(ddcprobe_t)

modutils_read_module_deps(ddcprobe_t)

userdom_use_user_terminals(ddcprobe_t)
userdom_use_all_users_fds(ddcprobe_t)

optional_policy(`
	kudzu_getattr_exec_files(ddcprobe_t)
')
