forked from OwlCyberDefense/refpolicy-contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdjbdns.if
78 lines (67 loc) · 1.53 KB
/
djbdns.if
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
77
78
## <summary>Small and secure DNS daemon.</summary>
#######################################
## <summary>
## The template to define a djbdns domain.
## </summary>
## <param name="domain_prefix">
## <summary>
## Domain prefix to be used.
## </summary>
## </param>
#
template(`djbdns_daemontools_domain_template',`
gen_require(`
attribute djbdns_domain;
')
########################################
#
# Declarations
#
type djbdns_$1_t, djbdns_domain;
type djbdns_$1_exec_t;
domain_type(djbdns_$1_t)
domain_entry_file(djbdns_$1_t, djbdns_$1_exec_t)
role system_r types djbdns_$1_t;
type djbdns_$1_conf_t;
files_config_file(djbdns_$1_conf_t)
########################################
#
# Local policy
#
daemontools_service_domain(djbdns_$1_t, djbdns_$1_exec_t)
daemontools_read_svc(djbdns_$1_t)
allow djbdns_$1_t djbdns_$1_conf_t:dir list_dir_perms;
allow djbdns_$1_t djbdns_$1_conf_t:file read_file_perms;
')
#####################################
## <summary>
## Search djbdns-tinydns key ring.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`djbdns_search_tinydns_keys',`
gen_require(`
type djbdns_tinydns_t;
')
allow $1 djbdns_tinydns_t:key search;
')
#####################################
## <summary>
## Link djbdns-tinydns key ring.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`djbdns_link_tinydns_keys',`
gen_require(`
type djbdns_tinydn_t;
')
allow $1 djbdns_tinydn_t:key link;
')