]> git.ipfire.org Git - people/stevee/selinux-policy.git/blame - policy/modules/services/dnsmasq.te
Add nut from Stefan Schulze Frielinghaus and Miroslav Grepl.
[people/stevee/selinux-policy.git] / policy / modules / services / dnsmasq.te
CommitLineData
9e725d8a 1
9570b288 2policy_module(dnsmasq, 1.8.0)
9e725d8a
CP
3
4########################################
5#
6# Declarations
7#
8
9type dnsmasq_t;
10type dnsmasq_exec_t;
0bfccda4 11init_daemon_domain(dnsmasq_t, dnsmasq_exec_t)
9e725d8a 12
01e9e7db
CP
13type dnsmasq_initrc_exec_t;
14init_script_file(dnsmasq_initrc_exec_t)
15
9e725d8a
CP
16type dnsmasq_lease_t;
17files_type(dnsmasq_lease_t)
18
19type dnsmasq_var_run_t;
20files_pid_file(dnsmasq_var_run_t)
21
22########################################
23#
24# Local policy
25#
26
ed38ca9f 27allow dnsmasq_t self:capability { net_admin setgid setuid net_bind_service net_raw };
9e725d8a 28dontaudit dnsmasq_t self:capability sys_tty_config;
01e9e7db 29allow dnsmasq_t self:process { getcap setcap signal_perms };
0b36a214 30allow dnsmasq_t self:fifo_file rw_fifo_file_perms;
ed38ca9f 31allow dnsmasq_t self:netlink_route_socket { bind create nlmsg_read read write };
9e725d8a
CP
32allow dnsmasq_t self:tcp_socket create_stream_socket_perms;
33allow dnsmasq_t self:udp_socket create_socket_perms;
34allow dnsmasq_t self:packet_socket create_socket_perms;
35allow dnsmasq_t self:rawip_socket create_socket_perms;
36
37# dhcp leases
01e9e7db 38manage_files_pattern(dnsmasq_t, dnsmasq_lease_t, dnsmasq_lease_t)
3f67f722 39files_var_lib_filetrans(dnsmasq_t, dnsmasq_lease_t, file)
9e725d8a 40
0bfccda4
CP
41manage_files_pattern(dnsmasq_t, dnsmasq_var_run_t, dnsmasq_var_run_t)
42files_pid_filetrans(dnsmasq_t, dnsmasq_var_run_t, file)
9e725d8a
CP
43
44kernel_read_kernel_sysctls(dnsmasq_t)
8f17f7c2 45kernel_read_system_state(dnsmasq_t)
9e725d8a 46
19006686
CP
47corenet_all_recvfrom_unlabeled(dnsmasq_t)
48corenet_all_recvfrom_netlabel(dnsmasq_t)
9e725d8a
CP
49corenet_tcp_sendrecv_generic_if(dnsmasq_t)
50corenet_udp_sendrecv_generic_if(dnsmasq_t)
51corenet_raw_sendrecv_generic_if(dnsmasq_t)
c1262146
CP
52corenet_tcp_sendrecv_generic_node(dnsmasq_t)
53corenet_udp_sendrecv_generic_node(dnsmasq_t)
54corenet_raw_sendrecv_generic_node(dnsmasq_t)
9e725d8a
CP
55corenet_tcp_sendrecv_all_ports(dnsmasq_t)
56corenet_udp_sendrecv_all_ports(dnsmasq_t)
c1262146
CP
57corenet_tcp_bind_generic_node(dnsmasq_t)
58corenet_udp_bind_generic_node(dnsmasq_t)
9e725d8a 59corenet_tcp_bind_dns_port(dnsmasq_t)
01e9e7db 60corenet_udp_bind_all_ports(dnsmasq_t)
141cffdd
CP
61corenet_sendrecv_dns_server_packets(dnsmasq_t)
62corenet_sendrecv_dhcpd_server_packets(dnsmasq_t)
9e725d8a
CP
63
64dev_read_sysfs(dnsmasq_t)
65dev_read_urand(dnsmasq_t)
66
67domain_use_interactive_fds(dnsmasq_t)
68
69# allow access to dnsmasq.conf
70files_read_etc_files(dnsmasq_t)
8f800d48 71files_read_etc_runtime_files(dnsmasq_t)
9e725d8a
CP
72
73fs_getattr_all_fs(dnsmasq_t)
74fs_search_auto_mountpoints(dnsmasq_t)
75
8f800d48
CP
76auth_use_nsswitch(dnsmasq_t)
77
9e725d8a
CP
78logging_send_syslog_msg(dnsmasq_t)
79
80miscfiles_read_localization(dnsmasq_t)
81
9e725d8a 82userdom_dontaudit_use_unpriv_user_fds(dnsmasq_t)
296273a7 83userdom_dontaudit_search_user_home_dirs(dnsmasq_t)
9e725d8a 84
9e725d8a
CP
85optional_policy(`
86 seutil_sigchld_newrole(dnsmasq_t)
87')
88
8f17f7c2
CP
89optional_policy(`
90 tftp_read_content(dnsmasq_t)
91')
92
9e725d8a
CP
93optional_policy(`
94 udev_read_db(dnsmasq_t)
95')
01e9e7db
CP
96
97optional_policy(`
98 virt_manage_lib_files(dnsmasq_t)
8f800d48 99 virt_read_pid_files(dnsmasq_t)
01e9e7db 100')