remove commercial notice
[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
37 # Allows everything, but no changes to searchguard configuration index
38 sg_all_access:
39   readonly: true
40   cluster:
41     - UNLIMITED
42   indices:
43     '*':
44       '*':
45         - UNLIMITED
46   tenants:
47     admin_tenant: RW
48
49 # Read all, but no write permissions
50 sg_readall:
51   readonly: true
52   cluster:
53     - CLUSTER_COMPOSITE_OPS_RO
54   indices:
55     '*':
56       '*':
57         - READ
58
59 # Read all and monitor, but no write permissions 
60 sg_readall_and_monitor:
61   cluster:
62     - CLUSTER_MONITOR
63     - CLUSTER_COMPOSITE_OPS_RO
64   indices:
65     '*':
66       '*':
67         - READ
68
69 # For users which use kibana, access to indices must be granted separately
70 sg_kibana_user:
71   readonly: true
72   cluster:
73     - INDICES_MONITOR
74     - CLUSTER_COMPOSITE_OPS
75   indices:
76     '?kibana':
77       '*':
78         - MANAGE
79         - INDEX
80         - READ
81         - DELETE
82     '?kibana-6':
83       '*':
84         - MANAGE
85         - INDEX
86         - READ
87         - DELETE
88     '?kibana_*':
89       '*':
90         - MANAGE
91         - INDEX
92         - READ
93         - DELETE
94     '?tasks':
95       '*':
96         - INDICES_ALL
97     '?management-beats':
98       '*':
99         - INDICES_ALL        
100     '*':
101       '*':
102         - indices:data/read/field_caps*
103         - indices:data/read/xpack/rollup*
104         - indices:admin/mappings/get*
105         - indices:admin/get
106
107 # For the kibana server
108 sg_kibana_server:
109   readonly: true
110   cluster:
111       - CLUSTER_MONITOR
112       - CLUSTER_COMPOSITE_OPS
113       - cluster:admin/xpack/monitoring*
114       - indices:admin/template*
115       - indices:data/read/scroll*
116   indices:
117     '?kibana':
118       '*':
119         - INDICES_ALL
120     '?kibana-6':
121       '*':
122         - INDICES_ALL
123     '?kibana_*':
124       '*':
125         - INDICES_ALL
126     '?reporting*':
127       '*':
128         - INDICES_ALL
129     '?monitoring*':
130       '*':
131         - INDICES_ALL
132     '?tasks':
133       '*':
134         - INDICES_ALL
135     '?management-beats*':
136       '*':
137         - INDICES_ALL
138     '*':
139       '*':
140         - "indices:admin/aliases*"
141
142 # For logstash and beats
143 sg_logstash:  
144   cluster:
145     - ES_INPUT
146     - CLUSTER_MONITOR
147     - CLUSTER_COMPOSITE_OPS
148     - indices:admin/template/get
149     - indices:admin/template/put
150   indices:
151     'logstash-*':
152       '*':
153         - INDEX_OWNER
154     '*beat*':
155       '*':
156         - INDEX_OWNER
157     'dmaap*':
158       '*':
159         - INDEX_OWNER
160     'events*':
161       '*':
162         - INDEX_OWNER
163     'errors*':
164       '*':
165         - INDEX_OWNER
166
167 # Allows adding and modifying repositories and creating and restoring snapshots
168 sg_manage_snapshots:
169   cluster:
170     - MANAGE_SNAPSHOTS
171   indices:
172     '*':
173       '*':
174         - "indices:data/write/index"
175         - "indices:admin/create"
176
177 # Allows each user to access own named index
178 sg_own_index:
179   cluster:
180     - CLUSTER_COMPOSITE_OPS
181   indices:
182     '${user_name}':
183       '*':
184         - INDICES_ALL
185
186 ### X-Pack COMPATIBILITY
187 sg_xp_monitoring:
188   readonly: true
189   cluster:
190     - cluster:monitor/xpack/info
191     - cluster:monitor/main
192     - cluster:admin/xpack/monitoring/bulk
193   indices:
194     '?monitor*':
195       '*':
196         - INDICES_ALL
197
198 sg_xp_alerting:
199   readonly: true
200   cluster:
201     - indices:data/read/scroll
202     - cluster:admin/xpack/watcher*
203     - cluster:monitor/xpack/watcher*
204   indices:
205     '?watches*':
206       '*':
207         - INDICES_ALL
208     '?watcher-history-*':
209       '*':
210         - INDICES_ALL
211     '?triggered_watches':
212       '*':
213         - INDICES_ALL
214     '*':
215       '*':
216         - READ
217         - indices:admin/aliases/get
218
219 sg_xp_machine_learning:
220   readonly: true
221   cluster:
222     - cluster:admin/persistent*
223     - cluster:internal/xpack/ml*
224     - indices:data/read/scroll*
225     - cluster:admin/xpack/ml*
226     - cluster:monitor/xpack/ml*
227   indices:
228     '*':
229       '*':
230         - READ
231         - indices:admin/get*
232     '?ml-*':
233       '*':
234         - "*"
235
236
237 ### LEGACY ROLES, FOR COMPATIBILITY ONLY
238 ### WILL BE REMOVED IN SG7, DO NOT USE ANYMORE
239
240 sg_readonly_and_monitor:
241   cluster:
242     - CLUSTER_MONITOR
243     - CLUSTER_COMPOSITE_OPS_RO
244   indices:
245     '*':
246       '*':
247         - READ
248
249 # Make xpack monitoring work
250 sg_monitor:
251   cluster:
252     - cluster:admin/xpack/monitoring/*
253     - cluster:admin/ingest/pipeline/put       
254     - cluster:admin/ingest/pipeline/get
255     - indices:admin/template/get
256     - indices:admin/template/put
257     - CLUSTER_MONITOR
258     - CLUSTER_COMPOSITE_OPS
259   indices:
260     '?monitor*':
261       '*':
262         - INDICES_ALL
263     '?marvel*':
264       '*':
265         - INDICES_ALL
266     '?kibana*':
267       '*':
268         - READ
269     '*':
270       '*':
271         - indices:data/read/field_caps
272
273 # Make xpack alerting work
274 sg_alerting:
275   cluster:
276     - indices:data/read/scroll
277     - cluster:admin/xpack/watcher/watch/put
278     - cluster:admin/xpack/watcher*
279     - CLUSTER_MONITOR
280     - CLUSTER_COMPOSITE_OPS
281   indices:
282     '?kibana*':
283       '*':
284         - READ
285     '?watches*':
286       '*':
287         - INDICES_ALL
288     '?watcher-history-*':
289       '*':
290         - INDICES_ALL
291     '?triggered_watches':
292       '*':
293         - INDICES_ALL
294     '*':
295       '*':
296         - READ