summaryrefslogtreecommitdiff
path: root/policy/modules/services/ldap.if
blob: 03b9d8378bf03196c4971aff8e77ec6c6a7a5ec2 (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
77
78
79
80
## <summary>OpenLDAP directory server</summary>

########################################
## <summary>
##	Read the contents of the OpenLDAP
##	database directories.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`ldap_list_db',`
	gen_require(`
		type slapd_db_t;
	')

	allow $1 slapd_db_t:dir r_dir_perms;
')

########################################
## <summary>
##	Read the OpenLDAP configuration files.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`ldap_read_config',`
	gen_require(`
		type slapd_etc_t;
	')

	files_search_etc($1)
	allow $1 slapd_etc_t:file { getattr read };
')

########################################
## <summary>
##	Use LDAP over TCP connection.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`ldap_use',`
	gen_require(`
		type slapd_t;
	')

	allow $1 slapd_t:tcp_socket { connectto recvfrom };
	allow slapd_t $1:tcp_socket { acceptfrom recvfrom };
	kernel_tcp_recvfrom($1)
')


########################################
## <summary>
##	Connect to slapd over an unix stream socket.
## </summary>
## <param name="domain">
##	<summary>
##	Domain allowed access.
##	</summary>
## </param>
#
interface(`ldap_stream_connect',`
	gen_require(`
		type slapd_t, slapd_var_run_t;
	')

	files_search_pids($1)
	allow $1 slapd_var_run_t:sock_file write;
	allow $1 slapd_t:unix_stream_socket connectto;
')