c210e3730f6738d7613b350a381d3adf09cc67b9
[oam.git] / solution / integration / smo / oam / sdnr / oauth-aaa-app-config.xml
1 <?xml version="1.0" ?>
2 <!--
3   ~ ============LICENSE_START=======================================================
4   ~ ONAP : ccsdk features
5   ~ ================================================================================
6   ~ Copyright (C) 2021 highstreet technologies GmbH Intellectual Property.
7   ~ All rights reserved.
8   ~ ================================================================================
9   ~ Licensed under the Apache License, Version 2.0 (the "License");
10   ~ you may not use this file except in compliance with the License.
11   ~ You may obtain a copy of the License at
12   ~
13   ~     http://www.apache.org/licenses/LICENSE-2.0
14   ~
15   ~ Unless required by applicable law or agreed to in writing, software
16   ~ distributed under the License is distributed on an "AS IS" BASIS,
17   ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18   ~ See the License for the specific language governing permissions and
19   ~ limitations under the License.
20   ~ ============LICENSE_END=======================================================
21   ~
22   -->
23
24 <shiro-configuration xmlns="urn:opendaylight:aaa:app:config">
25
26
27     <main>
28         <pair-key>tokenAuthRealm</pair-key>
29         <pair-value>org.onap.ccsdk.features.sdnr.wt.oauthprovider.OAuth2Realm</pair-value>
30     </main>
31
32     <main>
33         <pair-key>securityManager.realms</pair-key>
34         <pair-value>$tokenAuthRealm</pair-value>
35     </main>
36     <!-- Used to support OAuth2 use case. -->
37     <main>
38         <pair-key>authcBasic</pair-key>
39         <pair-value>org.opendaylight.aaa.shiro.filters.ODLHttpAuthenticationFilter</pair-value>
40     </main>
41     <main>
42         <pair-key>anyroles</pair-key>
43         <pair-value>org.onap.ccsdk.features.sdnr.wt.oauthprovider.filters.AnyRoleHttpAuthenticationFilter</pair-value>
44     </main>
45     <main>
46         <pair-key>authcBearer</pair-key>
47         <pair-value>org.onap.ccsdk.features.sdnr.wt.oauthprovider.filters.BearerAndBasicHttpAuthenticationFilter</pair-value>
48     </main>
49
50     <!-- in order to track AAA challenge attempts -->
51     <main>
52         <pair-key>accountingListener</pair-key>
53         <pair-value>org.opendaylight.aaa.shiro.filters.AuthenticationListener</pair-value>
54     </main>
55     <main>
56         <pair-key>securityManager.authenticator.authenticationListeners</pair-key>
57         <pair-value>$accountingListener</pair-value>
58     </main>
59
60     <!-- Model based authorization scheme supporting RBAC for REST endpoints -->
61     <main>
62         <pair-key>dynamicAuthorization</pair-key>
63         <pair-value>org.opendaylight.aaa.shiro.realm.MDSALDynamicAuthorizationFilter</pair-value>
64     </main>
65
66
67     <urls>
68         <pair-key>/**/operations/cluster-admin**</pair-key>
69         <pair-value>authcBearer, roles[admin]</pair-value>
70     </urls>
71     <urls>
72         <pair-key>/**/v1/**</pair-key>
73         <pair-value>authcBearer, roles[admin]</pair-value>
74     </urls>
75     <!-- allow admin only access to write mdsal auth config -->
76     <urls>
77         <pair-key>/rests/**/aaa*/**</pair-key>
78         <pair-value>authcBearer, roles[admin]</pair-value>
79     </urls>
80     <!-- anon access for login api -->
81     <urls>
82         <pair-key>/oauth/**</pair-key>
83         <pair-value>anon</pair-value>
84     </urls>
85     <urls>
86         <pair-key>/ready</pair-key>
87         <pair-value>anon</pair-value>
88     </urls>
89     <!-- anon access for odlux ui -->
90     <urls>
91         <pair-key>/odlux/**</pair-key>
92         <pair-value>anon</pair-value>
93     </urls>
94     <!-- admin only access for apidocs -->
95     <urls>
96         <pair-key>/apidoc/**</pair-key>
97         <pair-value>authcBasic, roles[admin]</pair-value>
98     </urls>
99     <urls>
100         <pair-key>/rests/**</pair-key>
101         <pair-value>authcBearer, anyroles["admin,provision"]</pair-value>
102     </urls>
103     <!-- any other access with configured dynamic filter -->
104     <urls>
105         <pair-key>/**</pair-key>
106         <pair-value>authcBearer, anyroles["admin,provision"]</pair-value>
107     </urls>
108 </shiro-configuration>