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