Dual license config file
[sdnc/oam.git] / installation / sdnc / src / main / resources / aaa-app-config.xml
1 <?xml version="1.0" ?>
2 <!--
3      Copyright (c) 2017 Inocybe Technologies and others.  All rights reserved.
4
5      This program and the accompanying materials are made available under the
6      terms of the Eclipse Public License v1.0 which accompanies this distribution,
7      and is available at http://www.eclipse.org/legal/epl-v10.html , or the Apache License,
8      Version 2.0 which is available at https://www.apache.org/licenses/LICENSE-2.0
9
10      SPDX-License-Identifier: EPL-1.0 OR Apache-2.0
11 -->
12
13 <!--
14   ///////////////////////////////////////////////////////////////////////////////////////
15   // clustered-app-config instance responsible for AAA configuration.  In the future,  //
16   // this will contain all AAA related configuration.                                  //
17   ///////////////////////////////////////////////////////////////////////////////////////
18 -->
19
20 <shiro-configuration xmlns="urn:opendaylight:aaa:app:config">
21
22     <!--
23       ///////////////////////////////////////////////////////////////////////////////////
24       // shiro-configuration is the model based container that contains all shiro      //
25       // related information used in ODL AAA configuration.  It is the sole pain of    //
26       // glass for shiro related configuration, and is how to configure shiro concepts //
27       // such as:                                                                      //
28       // * realms                                                                      //
29       // * urls                                                                        //
30       // * security manager settings                                                   //
31       //                                                                               //
32       // In general, you really shouldn't muck with the settings in this file.  The    //
33       // way an operator should configure AAA shiro settings is through one of ODL's   //
34       // northbound interfaces (i.e., RESTCONF or NETCONF).  These are just the        //
35       // defaults if no values are specified in MD-SAL.  The reason this file is so    //
36       // verbose is for two reasons:                                                   //
37       // 1) to demonstrate payload examples for plausible configuration scenarios      //
38       // 2) to allow bootstrap of the controller (first time start) since otherwise    //
39       //    configuration becomes a chicken and the egg problem.                       //
40       //                                                                               //
41       ///////////////////////////////////////////////////////////////////////////////////
42     -->
43
44     <!--
45       ===================================================================================
46       =                                                                                 =
47       =                                                                                 =
48       =                                      MAIN                                       =
49       =                                                                                 =
50       =                                                                                 =
51       ===================================================================================
52     -->
53
54     <!--
55       ===================================================================================
56       ============================ ODLJndiLdapRealmAuthNOnly ============================
57       ===================================================================================
58       =                                                                                 =
59       = Description:  A Realm implementation aimed at federating with an external LDAP  =
60       =               server for authentication only.  For authorization support, refer =
61       =               to ODLJndiLdapRealm.                                              =
62       ===================================================================================
63     -->
64     <!-- Start ldapRealm commented out
65     <main>
66         <pair-key>ldapRealm</pair-key>
67         <pair-value>org.opendaylight.aaa.shiro.realm.ODLJndiLdapRealmAuthNOnly</pair-value>
68     </main>
69     <main>
70         <pair-key>ldapRealm.userDnTemplate</pair-key>
71         <pair-value>uid={0},ou=People,dc=DOMAIN,dc=TLD</pair-value>
72     </main>
73     <main>
74         <pair-key>ldapRealm.contextFactory.url</pair-key>
75         <pair-value>ldap://&lt;URL&gt;:389</pair-value>
76     </main>
77     <main>
78         <pair-key>ldapRealm.searchBase</pair-key>
79         <pair-value>dc=DOMAIN,dc=TLD</pair-value>
80     </main>
81     <main>
82         <pair-key>ldapRealm.groupRolesMap</pair-key>
83         <pair-value>&quot;person&quot;:&quot;admin&quot;, &quot;organizationalPerson&quot;:&quot;user&quot;</pair-value>
84     </main>
85     <main>
86         <pair-key>ldapRealm.ldapAttributeForComparison</pair-key>
87         <pair-value>objectClass</pair-value>
88     </main>
89     End ldapRealm commented out-->
90
91     <!--
92       ===================================================================================
93       ============================= ODLActiveDirectoryRealm =============================
94       ===================================================================================
95       =                                                                                 =
96       = Description:  A Realm implementation aimed at federating with an external AD    =
97       =               IDP server.                                                       =
98       ===================================================================================
99     -->
100     <!-- Start adRealm commented out
101     <main>
102         <pair-key>adRealm</pair-key>
103         <pair-value>org.opendaylight.aaa.shiro.realm.ODLActiveDirectoryRealm</pair-value>
104     </main>
105     <main>
106         <pair-key>adRealm.searchBase</pair-key>
107         <pair-value>&quot;CN=Users,DC=example,DC=com&quot;</pair-value>
108     </main>
109     <main>
110         <pair-key>adRealm.systemUsername</pair-key>
111         <pair-value>aduser@example.com</pair-value>
112     </main>
113     <main>
114         <pair-key>adRealm.systemPassword</pair-key>
115         <pair-value>adpassword</pair-value>
116     </main>
117     <main>
118         <pair-key>adRealm.url</pair-key>
119         <pair-value>ldaps://adserver:636</pair-value>
120     </main>
121     <main>
122         <pair-key>adRealm.groupRolesMap</pair-key>
123         <pair-value>&quot;CN=sysadmin,CN=Users,DC=example,DC=com&quot;:&quot;admin&quot;, &quot;CN=unprivileged,CN=Users,DC=example,DC=com&quot;:&quot;user&quot;</pair-value>
124     </main>
125     End adRealm commented out-->
126
127     <!--
128       ===================================================================================
129       ================================== ODLJdbcRealm ===================================
130       ===================================================================================
131       =                                                                                 =
132       = Description:  A Realm implementation aimed at federating with an external JDBC  =
133       =               DBMS.                                                             =
134       ===================================================================================
135     -->
136     <!-- Start jdbcRealm commented out
137     <main>
138         <pair-key>ds</pair-key>
139         <pair-value>com.mysql.jdbc.Driver</pair-value>
140     </main>
141     <main>
142         <pair-key>ds.serverName</pair-key>
143         <pair-value>localhost</pair-value>
144     </main>
145     <main>
146         <pair-key>ds.user</pair-key>
147         <pair-value>user</pair-value>
148     </main>
149     <main>
150         <pair-key>ds.password</pair-key>
151         <pair-value>password</pair-value>
152     </main>
153     <main>
154         <pair-key>ds.databaseName</pair-key>
155         <pair-value>db_name</pair-value>
156     </main>
157     <main>
158         <pair-key>jdbcRealm</pair-key>
159         <pair-value>ODLJdbcRealm</pair-value>
160     </main>
161     <main>
162         <pair-key>jdbcRealm.dataSource</pair-key>
163         <pair-value>$ds</pair-value>
164     </main>
165     <main>
166         <pair-key>jdbcRealm.authenticationQuery</pair-key>
167         <pair-value>&quot;SELECT password FROM users WHERE user_name = ?&quot;</pair-value>
168     </main>
169     <main>
170         <pair-key>jdbcRealm.userRolesQuery</pair-key>
171         <pair-value>&quot;SELECT role_name FROM user_rolesWHERE user_name = ?&quot;</pair-value>
172     </main>
173     End jdbcRealm commented out-->
174
175     <!--
176       ===================================================================================
177       ================================= TokenAuthRealm ==================================
178       ===================================================================================
179       =                                                                                 =
180       = Description:  A Realm implementation utilizing a per node H2 database store.    =
181       ===================================================================================
182     -->
183     <main>
184         <pair-key>tokenAuthRealm</pair-key>
185         <pair-value>org.onap.aaf.cadi.shiro.AAFRealm</pair-value>
186         <!-- <pair-value>org.opendaylight.aaa.shiro.realm.TokenAuthRealm</pair-value> -->
187     </main>
188
189     <!--
190       ===================================================================================
191       =================================== MdsalRealm ====================================
192       ===================================================================================
193       =                                                                                 =
194       = Description:  A Realm implementation utilizing the aaa.yang model.              =
195       ===================================================================================
196     -->
197     <!-- Start mdsalRealm commented out
198     <main>
199         <pair-key>mdsalRealm</pair-key>
200         <pair-value>org.opendaylight.aaa.shiro.realm.MdsalRealm</pair-value>
201     </main>
202     End mdsalRealm commented out-->
203
204     <!--
205       ===================================================================================
206       ================================= MoonAuthRealm ===================================
207       ===================================================================================
208       =                                                                                 =
209       = Description:  A Realm implementation aimed at federating with OPNFV Moon.       =
210       ===================================================================================
211     -->
212     <!-- Start moonAuthRealm commented out
213     <main>
214         <pair-key>moonAuthRealm</pair-key>
215         <pair-value>org.opendaylight.aaa.shiro.realm.MoonRealm</pair-value>
216     </main>
217     <main>
218         <pair-key>moonAuthRealm.moonServerURL</pair-key>
219         <pair-value>http://&lt;host&gt;:&lt;port&gt;</pair-value>
220     </main>
221     End moonAuthRealm commented out-->
222
223     <!--
224       ===================================================================================
225       ================================= KeystoneAuthRealm == ============================
226       ===================================================================================
227       =                                                                                 =
228       = Description:  A Realm implementation aimed at federating with an OpenStack      =
229       =               Keystone.                                                         =
230       ===================================================================================
231     -->
232     <!-- Start keystoneAuthRealm commented out
233     <main>
234         <pair-key>keystoneAuthRealm</pair-key>
235         <pair-value>org.opendaylight.aaa.shiro.realm.KeystoneAuthRealm</pair-value>
236     </main>
237     <main>
238         <pair-key>keystoneAuthRealm.url</pair-key>
239         <pair-value>https://&lt;host&gt;:&lt;port&gt;</pair-value>
240     </main>
241     <main>
242         <pair-key>keystoneAuthRealm.sslVerification</pair-key>
243         <pair-value>true</pair-value>
244     </main>
245     <main>
246         <pair-key>keystoneAuthRealm.defaultDomain</pair-key>
247         <pair-value>Default</pair-value>
248     </main>
249     -->
250
251     <!--
252     Add tokenAuthRealm as the only realm.  To enable mdsalRealm, add it to the list to he right of tokenAuthRealm.
253     -->
254     <main>
255         <pair-key>securityManager.realms</pair-key>
256         <pair-value>$tokenAuthRealm</pair-value>
257     </main>
258     <!-- Used to support OAuth2 use case. -->
259     <main>
260         <pair-key>authcBasic</pair-key>
261         <pair-value>org.opendaylight.aaa.shiro.filters.ODLHttpAuthenticationFilter</pair-value>
262     </main>
263
264     <!-- Start moonAuthRealm commented out
265     <main>
266         <pair-key>rest</pair-key>
267         <pair-value>org.opendaylight.aaa.shiro.filters.MoonOAuthFilter</pair-value>
268     </main>
269     End moonAuthRealm commented out-->
270
271     <!-- in order to track AAA challenge attempts -->
272     <main>
273         <pair-key>accountingListener</pair-key>
274         <pair-value>org.opendaylight.aaa.shiro.filters.AuthenticationListener</pair-value>
275     </main>
276     <main>
277         <pair-key>securityManager.authenticator.authenticationListeners</pair-key>
278         <pair-value>$accountingListener</pair-value>
279     </main>
280
281     <!-- Model based authorization scheme supporting RBAC for REST endpoints -->
282     <main>
283         <pair-key>dynamicAuthorization</pair-key>
284         <pair-value>org.opendaylight.aaa.shiro.realm.MDSALDynamicAuthorizationFilter</pair-value>
285     </main>
286
287
288     <!--
289       ===================================================================================
290       =                                                                                 =
291       =                                                                                 =
292       =                                      URLS                                       =
293       =                                                                                 =
294       =                                                                                 =
295       ===================================================================================
296     -->
297     <!-- Start moonAuthRealm commented out
298     <urls>
299         <pair-key>/token</pair-key>
300         <pair-value>rest</pair-value>
301     </urls>
302     End moonAuthRealm commented out-->
303    <!-- URLS comment out
304     <urls>
305         <pair-key>/operations/cluster-admin**</pair-key>
306         <pair-value>authcBasic, roles[admin]</pair-value>
307     </urls>
308     <urls>
309         <pair-key>/v1/**</pair-key>
310         <pair-value>authcBasic, roles[admin]</pair-value>
311     </urls>
312     <urls>
313         <pair-key>/config/aaa*/**</pair-key>
314         <pair-value>authcBasic, roles[admin]</pair-value>
315     </urls>
316     End URLS commented out -->
317     <urls>
318         <pair-key>/**</pair-key>
319         <!-- <pair-value>authcBasic</pair-value> -->
320         <pair-value>authcBasic, rest[org.onap.sdnc.odl:odl-api]</pair-value>
321     </urls>
322 </shiro-configuration>
323