summaryrefslogtreecommitdiff
path: root/BKUOnline/src/main/policy/50mocca.policy
blob: 84bf59887eeb3d4dfdc400b0f17067c2851c1e5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
// Copyright 2011 by Graz University of Technology, Austria
// MOCCA has been developed by the E-Government Innovation Center EGIZ, a joint
// initiative of the Federal Chancellery Austria and Graz University of Technology.
//
// Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
// the European Commission - subsequent versions of the EUPL (the "Licence");
// You may not use this work except in compliance with the Licence.
// You may obtain a copy of the Licence at:
// http://www.osor.eu/eupl/
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Licence is distributed on an "AS IS" basis,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the Licence for the specific language governing permissions and
// limitations under the Licence.
//
// This product combines work with different licenses. See the "NOTICE" text
// file for details on the various modules and licenses.
// The "NOTICE" text file is part of the distribution. Any derivative works
// that you distribute must include a readable copy of the "NOTICE" text file.
//
//
// =========================================================================
// || IMPORTANT: REVIEW AND ADAPT TO YOUR NEEDS PRIOR TO INSTALLATION
// =========================================================================
//
// (set -Djava.security.debug=access,failure and search for "denied" (failed))
//
// ========== MOCCA CODE PERMISSIONS =======================================
//
// replace  ${catalina.base}/webapps/bkuonline
//    with  ${catalina.base}/webapps/<mocca_context>
// replace  ${catalina.base}/work/Catalina/localhost/bkuonline
//    with  ${catalina.base}/work/Catalina/localhost/<mocca_context> (the path to the compiled JSPs, excl. package dir: org/apache/jsp/)
// replace  version info in 
//          ${catalina.base}/webapps/bkuonline/WEB-INF/lib/utils-1.3.7.jar and
//          ${catalina.base}/webapps/bkuonline/WEB-INF/lib/bkucommon-1.3.7.jar
//    with  current version
// replace  www.sozialversicherung.gv.at:443
//    with  <DataURL_host:DataURL_port>
// replace  localhost:8080
//    with  <StylesheetURL_host:StylesheetURL_port>
// replace  www.xslt-stylesheet-include-url.org:80
//    with  <XSL_include_URL>
// replace  ../conf/secret.xml
//    with  <any_resource_you_would_like_to_grant_XSLTs_document()_function_access_to>
//
// replace  www.a-trust.at and ksp.ecard.sozialversicherung.gv.at
//    with  <idLink_template_download_URL>, currently:
//          A-Trust: http://www.a-trust.at/zmr/persb204.xsl
//          Verwaltungssignatur: http://ksp.ecard.sozialversicherung.gv.at/ePortal/public/xslt/ExpandIdLink-2_0.xslt
// replace  ldap.a-trust.at:389, ocsp.a-trust.at:80 and ocsp.ecard.sozialversicherung.at:80
//    with  <certificate_revocation_authority_endpoint> (OCSP, CRLs)
//

// =========== container grants required by MOCCA
//
grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" {
      permission java.lang.RuntimePermission "accessClassInPackage.sun.util.logging.resources";
      permission java.io.FilePermission "${catalina.base}/webapps/bkuonline/WEB-INF/classes/logging.properties", "read";
      // (for manager webapp)
      // permission java.lang.RuntimePermission "setContextClassLoader";
};

grant codeBase "file:${catalina.base}/work/Catalina/localhost/bkuonline" {
      permission java.io.FilePermission "/helpfiles/-", "read";
      permission java.lang.RuntimePermission "defineClassInPackage.org.apache.jasper.runtime";
};

// =========== MOCCA grants
//
grant codeBase "file:${catalina.base}/webapps/bkuonline/-" {
      permission java.io.FilePermission "${catalina.base}/logs", "read, write";
      permission java.io.FilePermission "${catalina.base}/logs/*", "read, write";
      permission java.io.FilePermission "${catalina.base}/logs/*", "delete";

      // DataURLs
      permission java.net.SocketPermission "apps.egiz.gv.at:443", "connect, resolve";
      permission java.net.SocketPermission "www.buergerkarte.at:443", "connect, resolve";
      permission java.net.SocketPermission "www.sozialversicherung.gv.at:443", "connect, resolve";
      permission java.net.SocketPermission "www.sozialversicherung.at:443", "connect, resolve";
      permission java.net.SocketPermission "www.int.esv.sozialversicherung.at:443", "connect, resolve";
      permission java.net.SocketPermission "www.int.esv.sozialversicherung.gv.at:443", "connect, resolve";
      permission java.net.SocketPermission "ooegkk.int.esv.sozialversicherung.at:443", "connect, resolve";
      //permission java.net.SocketPermission "www2.sozialversicherung.gv.at:443", "connect, resolve";
      //permission java.net.SocketPermission "www2.sozialversicherung.at:443", "connect, resolve";
      
      // other resources (crls, persb.xsl, ...)
      permission java.net.SocketPermission "www.a-trust.at:80", "connect, resolve";
      permission java.net.SocketPermission "ksp.ecard.sozialversicherung.gv.at:80", "connect,resolve";
      permission java.net.SocketPermission "ldap.a-trust.at:389", "connect, resolve";
      permission java.net.SocketPermission "ocsp.a-trust.at:80", "connect, resolve";
      permission java.net.SocketPermission "ocsp.ecard.sozialversicherung.at:80", "connect, resolve";
//      permission java.net.SocketPermission "localhost:8080", "connect, resolve";
//      permission java.net.SocketPermission "www.xslt-stylesheet-include-url.org:80", "connect, resolve";

      permission java.security.SecurityPermission "insertProvider.IAIK";
      permission java.security.SecurityPermission "putProviderProperty.IAIK";
      permission java.security.SecurityPermission "removeProvider.IAIK";
      permission java.security.SecurityPermission "insertProvider.IAIK_ECC";
      permission java.security.SecurityPermission "putProviderProperty.IAIK_ECC";
      permission java.security.SecurityPermission "removeProvider.IAIK_ECC";
      permission java.security.SecurityPermission "insertProvider.XSECT";
      permission java.security.SecurityPermission "putProviderProperty.XSECT";
      permission java.security.SecurityPermission "removeProvider.XSECT";
      permission java.security.SecurityPermission "insertProvider.STAL";
      permission java.security.SecurityPermission "putProviderProperty.STAL";
      // XMLDSig is moved backwards by XSECT
      permission java.security.SecurityPermission "insertProvider.XMLDSig";
      permission java.security.SecurityPermission "removeProvider.XMLDSig";

      permission java.util.PropertyPermission "*", "read";
      permission java.lang.RuntimePermission "accessDeclaredMembers";
      permission java.lang.RuntimePermission "getClassLoader";
      permission java.lang.RuntimePermission "getProtectionDomain";
      //bkucommon,pki
      permission java.lang.RuntimePermission "accessClassInPackage.sun.net.www.protocol.ldap";
      //jax-ws jaxb
      permission java.lang.RuntimePermission "accessClassInPackage.sun.util.logging.resources";
      //permission java.lang.RuntimePermission "modifyThread";
      //permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
      permission java.net.NetPermission "specifyStreamHandler";
};

grant codeBase "file:${catalina.base}/webapps/bkuonline/WEB-INF/classes/-" {
//      permission java.util.PropertyPermission "com.sun.xml.ws.fault.SOAPFaultBuilder.disableCaptureStackTrace", "write";
//      permission java.util.PropertyPermission "com.sun.xml.ws.transport.http.HttpAdapter.dump", "write";

      permission java.io.FilePermission "${catalina.base}/webapps/bkuonline/WEB-INF/classes/at/gv/egiz/bku/certs/certStore", "write";
      permission java.io.FilePermission "${catalina.base}/webapps/bkuonline/WEB-INF/classes/at/gv/egiz/bku/certs/certStore/-", "write";
      permission java.io.FilePermission "${catalina.base}/webapps/bkuonline/WEB-INF/classes/at/gv/egiz/bku/certs/certStore/toBeAdded/-", "delete";

      permission java.lang.RuntimePermission "defineClassInPackage.java.lang";
      permission java.util.PropertyPermission "*", "read, write";
      permission java.lang.RuntimePermission "modifyThread";
      permission java.lang.RuntimePermission "setFactory";
      permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
};

grant codeBase "file:${catalina.base}/webapps/bkuonline/WEB-INF/lib/utils-1.3.7.jar" {
//      permission java.lang.RuntimePermission "accessDeclaredMembers";
      permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
};

grant codeBase "file:${catalina.base}/webapps/bkuonline/WEB-INF/lib/bkucommon-1.3.7.jar" {
      permission java.io.FilePermission "${catalina.base}/webapps/bkuonline/WEB-INF/classes/at/gv/egiz/bku/certs/certStore", "write";
      permission java.io.FilePermission "${catalina.base}/webapps/bkuonline/WEB-INF/classes/at/gv/egiz/bku/certs/certStore/-", "write";
      permission java.io.FilePermission "${catalina.base}/webapps/bkuonline/WEB-INF/classes/at/gv/egiz/bku/certs/certStore/toBeAdded/-", "delete";
      permission java.io.FilePermission "${catalina.base}/temp/*", "read, write";
//      permission java.io.FilePermission "../conf/secret.xml", "read";
      permission java.util.PropertyPermission "*", "read, write";
      permission java.lang.RuntimePermission "modifyThread";
      permission java.lang.RuntimePermission "setFactory";
      permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
};

grant codeBase "file:${catalina.base}/webapps/bkuonline/WEB-INF/lib/iaik_jce_full_signed-5.01.jar" {
      permission java.util.PropertyPermission "*", "read, write";
};

grant codeBase "file:${catalina.base}/webapps/bkuonline/WEB-INF/lib/iaik_xsect-1.17.jar" {
      permission java.util.PropertyPermission "*", "read, write";
};

grant codeBase "file:${catalina.base}/webapps/bkuonline/WEB-INF/lib/iaik_pki-1.0-MOCCA.jar" {
      permission java.io.FilePermission "${catalina.base}/webapps/bkuonline/WEB-INF/classes/at/gv/egiz/bku/certs/certStore", "write";
      permission java.io.FilePermission "${catalina.base}/webapps/bkuonline/WEB-INF/classes/at/gv/egiz/bku/certs/certStore/-", "write";
      permission java.io.FilePermission "${catalina.base}/webapps/bkuonline/WEB-INF/classes/at/gv/egiz/bku/certs/certStore/toBeAdded/-", "delete";
      //permission java.net.NetPermission "specifyStreamHandler";
      //permission java.lang.RuntimePermission "accessClassInPackage.sun.net.www.protocol.ldap";
};

grant codeBase "file:${catalina.base}/webapps/bkuonline/WEB-INF/lib/xalan-2.7.1.jar" {
      permission java.io.FilePermission "${java.home}/lib/xalan.properties", "read";
      //permission java.lang.RuntimePermission "getClassLoader";
};

// allow xsl:include from the specified URL
//grant codeBase "jar:file:${catalina.base}/webapps/bkuonline/WEB-INF/lib/xalan-2.7.1.jar!/org/apache/xalan/processor/-" {
//      permission java.net.SocketPermission "www.xslt-stylesheet-include-url.org:80", "connect, resolve";
//};

// allow XSLT document function to reference the specified URL
//grant codeBase "jar:file:${catalina.base}/webapps/bkuonline/WEB-INF/lib/xalan-2.7.1.jar!/org/apache/xalan/xsltc/dom/LoadDocument.class" {
//      permission java.io.FilePermission "../conf/secret.xml", "read";
//};

// use tomcat/jre endorsed xerces instead
grant codeBase "file:${catalina.base}/webapps/bkuonline/WEB-INF/lib/xercesImpl-2.9.1.jar" {
      permission java.io.FilePermission "${java.home}/lib/xerces.properties", "read";
//      permission java.io.FilePermission "../conf/secret.xml", "read";
//      permission java.net.SocketPermission "www.xslt-stylesheet-include-url.org:80", "connect, resolve";
      permission java.io.FilePermission "/WEB-INF/classes/-", "read";
      permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina";
      permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.*";
      //permission java.lang.RuntimePermission "accessDeclaredMembers";
};

grant codeBase "file:${catalina.base}/webapps/bkuonline/WEB-INF/lib/commons-logging-1.1.1.jar" {
      permission java.lang.RuntimePermission "defineClassInPackage.java.lang";
};

grant codeBase "file:${catalina.base}/webapps/bkuonline/WEB-INF/lib/log4j-1.2.17.jar" {
      permission java.io.FilePermission "${catalina.base}/webapps/bkuonline/WEB-INF/classes/log4j.properties", "read";
      permission java.lang.RuntimePermission "defineClassInPackage.java.lang";
};

grant codeBase "file:${catalina.base}/webapps/bkuonline/WEB-INF/lib/spring-core-2.5.5.jar" {
      //permission java.lang.RuntimePermission "accessDeclaredMembers";
      permission java.lang.RuntimePermission "modifyThread";
};

grant codeBase "file:${catalina.base}/webapps/bkuonline/WEB-INF/lib/spring-web-2.5.5.jar" {
      permission java.io.FilePermission "${catalina.base}/webapps/bkuonline/WEB-INF/classes/at/gv/egiz/bku/certs/certStore", "write";
      permission java.io.FilePermission "${catalina.base}/webapps/bkuonline/WEB-INF/classes/at/gv/egiz/bku/certs/certStore/-", "write";
      permission java.io.FilePermission "${catalina.base}/webapps/bkuonline/WEB-INF/classes/at/gv/egiz/bku/certs/certStore/toBeAdded/-", "delete";
      permission java.util.PropertyPermission "*", "read, write";
      //permission java.lang.RuntimePermission "accessDeclaredMembers";
      permission java.lang.RuntimePermission "modifyThread";
      permission java.lang.RuntimePermission "setFactory";
      //permission java.lang.RuntimePermission "getProtectionDomain";
      permission java.lang.RuntimePermission "defineClassInPackage.java.lang";
      permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
};

grant codeBase "file:${catalina.base}/webapps/bkuonline/WEB-INF/lib/spring-beans-2.5.5.jar" {
      permission java.io.FilePermission "${catalina.base}/webapps/bkuonline/WEB-INF/classes/at/gv/egiz/bku/certs/certStore", "write";
      permission java.io.FilePermission "${catalina.base}/webapps/bkuonline/WEB-INF/classes/at/gv/egiz/bku/certs/certStore/-", "write";
      permission java.io.FilePermission "${catalina.base}/webapps/bkuonline/WEB-INF/classes/at/gv/egiz/bku/certs/certStore/toBeAdded/-", "delete";
      permission java.util.PropertyPermission "*", "read, write";
      //permission java.lang.RuntimePermission "accessDeclaredMembers";
      permission java.lang.RuntimePermission "setFactory";
      permission java.lang.RuntimePermission "getProtectionDomain";
      permission java.lang.RuntimePermission "defineClassInPackage.java.lang";
      permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
};
grant codeBase "file:${catalina.base}/webapps/bkuonline/WEB-INF/lib/spring-context-2.5.5.jar" {
      permission java.io.FilePermission "${catalina.base}/webapps/bkuonline/WEB-INF/classes/at/gv/egiz/bku/certs/certStore", "write";
      permission java.io.FilePermission "${catalina.base}/webapps/bkuonline/WEB-INF/classes/at/gv/egiz/bku/certs/certStore/-", "write";
      permission java.io.FilePermission "${catalina.base}/webapps/bkuonline/WEB-INF/classes/at/gv/egiz/bku/certs/certStore/toBeAdded/-", "delete";
      permission java.util.PropertyPermission "*", "read, write";
      //permission java.lang.RuntimePermission "accessDeclaredMembers";
      permission java.lang.RuntimePermission "modifyThread";
      permission java.lang.RuntimePermission "setFactory";
      permission java.lang.RuntimePermission "getProtectionDomain";
      permission java.lang.RuntimePermission "defineClassInPackage.java.lang";
      permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
};

grant codeBase "file:${catalina.base}/webapps/bkuonline/WEB-INF/lib/jaxws-rt-2.1.5.jar" {
      // need write access to set disableCaptureStackTrace and HttpAdapter.dump
      permission java.util.PropertyPermission "com.sun.xml.ws.*", "read, write";
      //permission java.util.PropertyPermission "com.sun.xml.bind.*", "read";
      //permission java.util.PropertyPermission "javax.xml.soap.*", "read";
      //permission java.util.PropertyPermission "javax.activation.*", "read";
      //permission java.util.PropertyPermission "xml.catalog.*", "read";
      //permission java.util.PropertyPermission "user.dir", "read";
      //permission java.util.PropertyPermission "user.home", "read";
      permission java.io.FilePermission "${java.home}/lib/jaxm.properties", "read";
      permission java.io.FilePermission "${java.home}/lib/mailcap", "read";
      permission java.io.FilePermission "${user.home}/.mailcap", "read";
      permission java.io.FilePermission "basename", "read";
      permission java.io.FilePermission "${catalina.home}/bin/xcatalog", "read";
      permission java.io.FilePermission "${catalina.home}/temp/xcatalog", "read";
      permission java.io.FilePermission "/WEB-INF/classes/-", "read";
      //permission java.lang.RuntimePermission "accessDeclaredMembers";
      //permission java.lang.RuntimePermission "accessClassInPackage.sun.util.logging.resources";
      permission java.lang.RuntimePermission "setContextClassLoader";
      permission javax.management.MBeanServerPermission "createMBeanServer";
      permission javax.management.MBeanPermission "com.sun.xml.ws.*", "registerMBean";
      permission javax.management.MBeanTrustPermission "register";
      permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
      permission java.lang.reflect.ReflectPermission "newProxyInPackage.at.gv.egiz.stalx.service";
};

grant codeBase "file:${catalina.base}/webapps/bkuonline/WEB-INF/lib/jaxb-impl-2.1.9.jar" {
      //permission java.lang.RuntimePermission "accessClassInPackage.sun.util.logging.resources";
      permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
//      permission java.lang.RuntimePermission "accessDeclaredMembers";
//      permission java.util.PropertyPermission "com.sun.xml.bind.v2.*", "read";
//      permission java.util.PropertyPermission "user.dir", "read";
      permission java.io.FilePermission "/WEB-INF/classes/-", "read";
};

// ======== NETBEANS

grant codeBase "file:${catalina.base}/nblib/-" {
      permission java.security.AllPermission;
};