1a3a80ce5a425209ba5f73f156a75767d68ce0c3
[clamp.git] / src / main / docker / elasticsearch / config / sg / sg_roles.yml
1 #<sg_role_name>:
2 #  cluster:
3 #    - '<permission>'
4 #  indices:
5 #    '<indexname or alias>':
6 #      '<type>':  
7 #        - '<permission>'
8 #      _dls_: '<dls query>'
9 #      _fls_:
10 #        - '<field>'
11 #        - '<field>'
12
13 # When a user make a request to Elasticsearch then the following roles will be evaluated to see if the user has
14 # permissions for the request. A request is always associated with an action and is executed against and index (or alias)
15 # and a type. If a request is executed against all indices (or all types) then the asterix ('*') is needed.
16 # Every role a user has will be examined if it allows the action against an index (or type). At least one role must match
17 # for the request to be successful. If no role match then the request will be denied. Currently a match must happen within
18 # one single role - that means that permissions can not span multiple roles. 
19
20 # For <permission>, <indexname or alias> and <type> simple wildcards and regular expressions are possible. 
21 # A asterix (*) will match any character sequence (or an empty sequence)
22 # A question mark (?) will match any single character (but NOT empty character)
23 # Example: '*my*index' will match 'my_first_index' as well as 'myindex' but not 'myindex1'
24 # Example: '?kibana' will match '.kibana' but not 'kibana'
25
26 # To use a full blown regex you have to pre- and apend a '/' to use regex instead of simple wildcards
27 # '/<java regex>/'
28 # Example: '/\S*/' will match any non whitespace characters
29
30 # Important: 
31 # Index, alias or type names can not contain dots (.) in the <indexname or alias> or <type> expression.
32 # Reason is that we currently parse the config file into a elasticsearch settings object which cannot cope with dots in keys.
33 # Workaround: Just configure something like '?kibana' instead of '.kibana' or 'my?index' instead of 'my.index'
34 # This limitation will likely removed with Search Guard 6
35 #
36 # Some SearchGuard functionality is licensed under Apache-2.0, while other functionality is non-free;
37 # see https://github.com/floragunncom/search-guard. The functionality enabled in this configuration
38 # file only include those that are licensed under Apache-2.0. Please use care and review SearchGuard's
39 # license details before enabling any additional features here.
40
41 # Allows everything, but no changes to searchguard configuration index
42 sg_all_access:
43   readonly: true
44   cluster:
45     - UNLIMITED
46   indices:
47     '*':
48       '*':
49         - UNLIMITED
50   tenants:
51     admin_tenant: RW
52
53 # Read all, but no write permissions
54 sg_readall:
55   readonly: true
56   cluster:
57     - CLUSTER_COMPOSITE_OPS_RO
58   indices:
59     '*':
60       '*':
61         - READ
62
63 # Read all and monitor, but no write permissions 
64 sg_readall_and_monitor:
65   cluster:
66     - CLUSTER_MONITOR
67     - CLUSTER_COMPOSITE_OPS_RO
68   indices:
69     '*':
70       '*':
71         - READ
72
73 # For users which use kibana, access to indices must be granted separately
74 sg_kibana_user:
75   readonly: true
76   cluster:
77     - INDICES_MONITOR
78     - CLUSTER_COMPOSITE_OPS
79   indices:
80     '?kibana':
81       '*':
82         - MANAGE
83         - INDEX
84         - READ
85         - DELETE
86     '?kibana-6':
87       '*':
88         - MANAGE
89         - INDEX
90         - READ
91         - DELETE
92     '?kibana_*':
93       '*':
94         - MANAGE
95         - INDEX
96         - READ
97         - DELETE
98     '?tasks':
99       '*':
100         - INDICES_ALL
101     '?management-beats':
102       '*':
103         - INDICES_ALL        
104     '*':
105       '*':
106         - indices:data/read/field_caps*
107         - indices:data/read/xpack/rollup*
108         - indices:admin/mappings/get*
109         - indices:admin/get
110
111 # For the kibana server
112 sg_kibana_server:
113   readonly: true
114   cluster:
115       - CLUSTER_MONITOR
116       - CLUSTER_COMPOSITE_OPS
117       - cluster:admin/xpack/monitoring*
118       - indices:admin/template*
119       - indices:data/read/scroll*
120   indices:
121     '?kibana':
122       '*':
123         - INDICES_ALL
124     '?kibana-6':
125       '*':
126         - INDICES_ALL
127     '?kibana_*':
128       '*':
129         - INDICES_ALL
130     '?reporting*':
131       '*':
132         - INDICES_ALL
133     '?monitoring*':
134       '*':
135         - INDICES_ALL
136     '?tasks':
137       '*':
138         - INDICES_ALL
139     '?management-beats*':
140       '*':
141         - INDICES_ALL
142     '*':
143       '*':
144         - "indices:admin/aliases*"
145
146 # For logstash and beats
147 sg_logstash:  
148   cluster:
149     - ES_INPUT
150     - CLUSTER_MONITOR
151     - CLUSTER_COMPOSITE_OPS
152     - indices:admin/template/get
153     - indices:admin/template/put
154   indices:
155     'logstash-*':
156       '*':
157         - INDEX_OWNER
158     '*beat*':
159       '*':
160         - INDEX_OWNER
161     'dmaap*':
162       '*':
163         - INDEX_OWNER
164     'events*':
165       '*':
166         - INDEX_OWNER
167     'errors*':
168       '*':
169         - INDEX_OWNER
170
171 # Allows adding and modifying repositories and creating and restoring snapshots
172 sg_manage_snapshots:
173   cluster:
174     - MANAGE_SNAPSHOTS
175   indices:
176     '*':
177       '*':
178         - "indices:data/write/index"
179         - "indices:admin/create"
180
181 # Allows each user to access own named index
182 sg_own_index:
183   cluster:
184     - CLUSTER_COMPOSITE_OPS
185   indices:
186     '${user_name}':
187       '*':
188         - INDICES_ALL
189
190 ### X-Pack COMPATIBILITY
191 sg_xp_monitoring:
192   readonly: true
193   cluster:
194     - cluster:monitor/xpack/info
195     - cluster:monitor/main
196     - cluster:admin/xpack/monitoring/bulk
197   indices:
198     '?monitor*':
199       '*':
200         - INDICES_ALL
201
202 sg_xp_alerting:
203   readonly: true
204   cluster:
205     - indices:data/read/scroll
206     - cluster:admin/xpack/watcher*
207     - cluster:monitor/xpack/watcher*
208   indices:
209     '?watches*':
210       '*':
211         - INDICES_ALL
212     '?watcher-history-*':
213       '*':
214         - INDICES_ALL
215     '?triggered_watches':
216       '*':
217         - INDICES_ALL
218     '*':
219       '*':
220         - READ
221         - indices:admin/aliases/get
222
223 sg_xp_machine_learning:
224   readonly: true
225   cluster:
226     - cluster:admin/persistent*
227     - cluster:internal/xpack/ml*
228     - indices:data/read/scroll*
229     - cluster:admin/xpack/ml*
230     - cluster:monitor/xpack/ml*
231   indices:
232     '*':
233       '*':
234         - READ
235         - indices:admin/get*
236     '?ml-*':
237       '*':
238         - "*"
239
240
241 ### LEGACY ROLES, FOR COMPATIBILITY ONLY
242 ### WILL BE REMOVED IN SG7, DO NOT USE ANYMORE
243
244 sg_readonly_and_monitor:
245   cluster:
246     - CLUSTER_MONITOR
247     - CLUSTER_COMPOSITE_OPS_RO
248   indices:
249     '*':
250       '*':
251         - READ
252
253 # Make xpack monitoring work
254 sg_monitor:
255   cluster:
256     - cluster:admin/xpack/monitoring/*
257     - cluster:admin/ingest/pipeline/put       
258     - cluster:admin/ingest/pipeline/get
259     - indices:admin/template/get
260     - indices:admin/template/put
261     - CLUSTER_MONITOR
262     - CLUSTER_COMPOSITE_OPS
263   indices:
264     '?monitor*':
265       '*':
266         - INDICES_ALL
267     '?marvel*':
268       '*':
269         - INDICES_ALL
270     '?kibana*':
271       '*':
272         - READ
273     '*':
274       '*':
275         - indices:data/read/field_caps
276
277 # Make xpack alerting work
278 sg_alerting:
279   cluster:
280     - indices:data/read/scroll
281     - cluster:admin/xpack/watcher/watch/put
282     - cluster:admin/xpack/watcher*
283     - CLUSTER_MONITOR
284     - CLUSTER_COMPOSITE_OPS
285   indices:
286     '?kibana*':
287       '*':
288         - READ
289     '?watches*':
290       '*':
291         - INDICES_ALL
292     '?watcher-history-*':
293       '*':
294         - INDICES_ALL
295     '?triggered_watches':
296       '*':
297         - INDICES_ALL
298     '*':
299       '*':
300         - READ