Enhancement to use the common CryptoUtils
[policy/engine.git] / ONAP-REST / src / main / java / org / onap / policy / rest / XACMLRestProperties.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP-REST
4  * ================================================================================
5  * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.policy.rest;
22
23 import com.att.research.xacml.util.XACMLProperties;
24
25 /**
26  * These are XACML Properties that are relevant to the RESTful API interface for
27  * the PDP, PAP and AC interfaces.
28  *
29  *
30  */
31 public class XACMLRestProperties extends XACMLProperties {
32     /**
33      * A unique identifier for the PDP servlet instance. Usually set to the URL
34      * it is running as in the J2EE container.
35      *
36      * Eg. http://localhost:8080/pdp/
37      */
38     public static final String PROP_PDP_ID = "xacml.rest.pdp.id";
39     /**
40      * A PDP servlet's configuration directory. Holds the pip and policy
41      * configuration data as well as the local policy cache.
42      *
43      * Eg: /opt/app/xacml/config
44      */
45     public static final String PROP_PDP_CONFIG = "xacml.rest.pdp.config";
46     // Resilience feature-
47     public static final String PROP_PDP_WEBAPPS = "xacml.rest.pdp.webapps";
48     //Closed Loop JSON table
49     public static final String PROP_ADMIN_CLOSEDLOOP = "xacml.rest.admin.closedLoopJSON";
50     /**
51      * Set this property to true or false if the PDP servlet should register
52      * itself upon startup with the PAP servlet.
53      */
54     public static final String PROP_PDP_REGISTER = "xacml.rest.pdp.register";
55     /**
56      * Number of seconds the PDP will sleep while retrying registration with the
57      * PAP. This value must be greater or equal to 5.
58      */
59     public static final String PROP_PDP_REGISTER_SLEEP = "xacml.rest.pdp.register.sleep";
60     /**
61      * Number of retry attempts at registration with the PAP. A value of -1
62      * indicates infinite retries.
63      */
64     public static final String PROP_PDP_REGISTER_RETRIES = "xacml.rest.pdp.register.retries";
65     /**
66      * Max content length accepted for an incoming POST XML/JSON request.
67      * Default is 32767 bytes.
68      */
69     public static final String PROP_PDP_MAX_CONTENT = "xacml.rest.pdp.maxcontent";
70     /**
71      * Custom HTTP header used by PDP to send the value of the PROP_PDP_ID
72      */
73     public static final String PROP_PDP_HTTP_HEADER_ID = "X-XACML-PDP-ID";
74     /**
75      * Custom HHTP header used by PDP to send its heartbeat value.
76      */
77     public static final String PROP_PDP_HTTP_HEADER_HB = "X-XACML-PDP-HB";
78     /*
79      * Custom HTTP header used by PDP to send the value of the
80      * X-XACML-PDP-JMX-PORT
81      */
82     public static final String PROP_PDP_HTTP_HEADER_JMX_PORT = "X-XACML-PDP-JMX-PORT";
83     /**
84      * The URL of the PAP servlet. Used by PDP servlet's to communicate. Because
85      * administrators can set whatever context they want to run the PAP servlet,
86      * it isn't easy to determine a return URL for the PAP servlet. This is
87      * especially true upon initialization.
88      */
89     public static final String PROP_PAP_URL = "xacml.rest.pap.url";
90     /**
91      * A comma divided list of urls pointing to avaiable PAP urls.
92      * If one or more fail, the other servers in the list can
93      * handle the requests.
94      */
95     public static final String PROP_PAP_URLS = "xacml.rest.pap.urls";
96     public static final String PROP_PAP_FAILED_URLS = "xacml.rest.pap.failedUrls";
97     public static final String PROP_PAP_SUCCEEDED_URLS = "xacml.rest.pap.succeededUrls";
98
99     /**
100      * Upon startup, have the PAP servlet send latest configuration information
101      * to all the PDP nodes it knows about.
102      */
103     public static final String PROP_PAP_INITIATE_PDP_CONFIG = "xacml.rest.pap.initiate.pdp";
104     /**
105      * The interval the PAP servlet uses to send heartbeat requests to the PDP
106      * nodes.
107      */
108     public static final String PROP_PAP_HEARTBEAT_INTERVAL = "xacml.rest.pap.heartbeat.interval";
109     /**
110      * Timeout value used by the PAP servlet when trying to check the heartbeat
111      * of a PDP node.
112      */
113     public static final String PROP_PAP_HEARTBEAT_TIMEOUT = "xacml.rest.pap.heartbeat.timeout";
114     /*
115      * This is the domain you can setup for your organization, it should be a URI.
116      * Eg. com:sample:foo
117      */
118     public static final String PROP_PAP_DOMAIN = "xacml.rest.pap.domain";
119
120     /*
121      * Local path to where user workspaces exist. The user workspace contains temporary files, the
122      * user's clone of the GIT repository, anything specific to the user, etc.
123      */
124     public static final String PROP_PAP_WORKSPACE = "xacml.rest.pap.workspace";
125
126     /*
127      * Local path to  where the GIT repository exists.
128      *
129      * Eg. /opt/app/xacml/repository
130      */
131     public static final String PROP_PAP_REPOSITORY = "xacml.rest.pap.repository";
132
133     /*
134      * Database driver property
135      */
136     public static final String PROP_PAP_DB_DRIVER = "javax.persistence.jdbc.driver";
137
138     /*
139      * Database url
140      */
141     public static final String PROP_PAP_DB_URL = "javax.persistence.jdbc.url";
142
143     /*
144      * Database user
145      */
146     public static final String PROP_PAP_DB_USER = "javax.persistence.jdbc.user";
147
148     /*
149      * Database password
150      */
151     public static final String PROP_PAP_DB_PASSWORD = "javax.persistence.jdbc.password";
152
153     /*
154      * Time in ms which a Policy DB transaction will wait to get the transaction lock object
155      */
156     public static final String PROP_PAP_TRANS_WAIT = "xacml.rest.pap.transaction.waitms";
157
158     /*
159      * Policy DB transaction timeout in ms after it has obtained the transaction lock object
160      */
161     public static final String PROP_PAP_TRANS_TIMEOUT = "xacml.rest.pap.transaction.timeoutms";
162
163     /*
164      * Policy Audit transaction timeout in ms after it has obtained the transaction lock object
165      */
166     public static final String PROP_PAP_AUDIT_TIMEOUT = "xacml.rest.pap.audit.timeoutms";
167
168     /*
169      * Value determines direction of audit.  Value=true will synch the file system to contents of the DB.
170      * Value=false will synch the DB to the contents of the file system.
171      */
172     public static final String PROP_PAP_AUDIT_FLAG = "xacml.rest.pap.filesystem.audit";
173
174     /*
175      * Value for enable/disable of audit functionality
176      */
177     public static final String PROP_PAP_RUN_AUDIT_FLAG = "xacml.rest.pap.run.audit.flag";
178
179     /*
180      * Controls how long the timeout will be when a pap sends a notification to another pap
181      */
182     public static final String PROP_PAP_NOTIFY_TIMEOUT = "xacml.rest.pap.notify.timeoutms";
183     /*
184      *  Value for Enable/Disable of AutoPush Flag.
185      */
186     public static final String PROP_PAP_PUSH_FLAG = "xacml.rest.pap.autopush.flag";
187
188     /*
189      *  Properties file for the AutoPush Functionality.
190      */
191     public static final String PROP_PAP_PUSH_FILE = "xacml.rest.pap.autopush.file";
192
193     /*
194      * Local path to where the GIT repository exists.
195      *
196      * Eg. /opt/app/xacml/repository
197      */
198     public static final String PROP_ADMIN_REPOSITORY = "xacml.rest.admin.repository";
199     /*
200      * Local path to where user workspaces exist. The user workspace contains
201      * temporary files, the user's clone of the GIT repository, anything
202      * specific to the user, etc.
203      */
204     public static final String PROP_ADMIN_WORKSPACE = "xacml.rest.admin.workspace";
205     /*
206      * This is the domain you can setup for your organization, it should be a
207      * URI.
208      *
209      * Eg. com:sample:foo
210      */
211     public static final String PROP_ADMIN_DOMAIN = "xacml.rest.admin.domain";
212     /**
213      * PROP_ADMIN_USER_NAME is simply a name for the logged in user.
214      *
215      * AC authentication is out the scope of the web application itself. It is
216      * up to the developer to setup authentication as they please in the J2EE
217      * container used to run the web application. Whatever authentication
218      * mechanism they use, they should then set the attribute into the
219      * HttpSession object. The Admin Console will be able to read that value
220      * (default to "guest") in.
221      *
222      * ((HttpServletRequest)
223      * request).getSession().setAttribute("xacml.rest.admin.user.name",
224      * "Homer");
225      *
226      */
227     public static final String PROP_ADMIN_USER_NAME = "xacml.rest.admin.user.name";
228     /**
229      *
230      * PROP_ADMIN_USER_ID is an id for the logged in user.
231      *
232      * Eg. hs1234
233      *
234      * @see #PROP_ADMIN_USER_NAME for more information.
235      */
236     public static final String PROP_ADMIN_USER_ID = "xacml.rest.admin.user.id";
237     /**
238      *
239      * PROP_ADMIN_USER_EMAIL is a user's email address.
240      *
241      * @see #PROP_ADMIN_USER_NAME for more information.
242      */
243     public static final String PROP_ADMIN_USER_EMAIL = "xacml.rest.admin.user.email";
244     /**
245      * Directory path containing sub-directories where the Subscriber servlet
246      * puts files sent through data feeds.
247      */
248     public static final String PROP_SUBSCRIBER_INCOMING = "xacml.subscriber.incoming";
249     /**
250      * The specific data feed name for the Subscriber servlet to register for.
251      */
252     public static final String PROP_SUBSCRIBER_FEED = "xacml.subscriber.feed";
253     /**
254      * Value for the log time frame that is to be stored in the database any
255      * logs after this time frame will be removed.
256      */
257     public static final String PROP_LOG_TIMEFRAME = "xacml.log.timeframe";
258     /**
259      * Value for the DB connections used to store the log files.
260      */
261     public static final String PROP_LOG_DB_DRIVER = "xacml.log.db.driver";
262     public static final String PROP_LOG_DB_URL = "xacml.log.db.url";
263     public static final String PROP_LOG_DB_USER = "xacml.log.db.user";
264     public static final String PROP_LOG_DB_PASSWORD = "xacml.log.db.password";
265     /*
266      * Value for JMX port for the PDP
267      */
268     public static final String PROP_PDP_JMX_PORT = "xacml.jmx.port";
269
270     /*
271      * Value for refresh rate
272      */
273     public static final String PROP_REFRESH_RATE = "xacml.refresh.rate";
274
275     // added for Security between Policy Components.
276     // 6/26
277     /*
278      * PROP_PAP_USERID is the PAP Unique User ID
279      */
280     public static final String PROP_PAP_USERID = "xacml.rest.pap.userid";
281     /*
282      * PROP_PAP_PASS is the PAP password
283      */
284     public static final String PROP_PAP_PASS = "xacml.rest.pap.password";
285     /*
286      * PROP_PAP_PASS is the PAP password
287      */
288     public static final String PROP_CONFIG_URL = "xacml.rest.config.url";
289     /*
290      * PROP_PDP_USERID is the PDP Unique User ID
291      */
292     public static final String PROP_PDP_USERID = "xacml.rest.pdp.userid";
293     /*
294      * PROP_PDP_PASS is the PDP password
295      */
296     public static final String PROP_PDP_PASS = "xacml.rest.pdp.password";
297     /*
298      * PROP_PDP_IDFILE is the PDP Authentication File
299      */
300     public static final String PROP_PDP_IDFILE = "xacml.rest.pdp.idfile";
301     /*
302      * PROP_PEP_IDFILE is the Client Authentication File
303      */
304     public static final String PROP_PEP_IDFILE = "xacml.rest.pep.idfile";
305     /*
306      * webapps Location of the PAP-REST server
307      */
308     public static final String PROP_PAP_WEBAPPS= "xacml.rest.config.webapps";
309     /*
310      * Value for Notification Option
311      */
312     public static final String PROP_NOTIFICATION_TYPE = "NOTIFICATION_TYPE";
313     /*
314      * Value for Notification DMaaP servers
315      */
316     public static final String PROP_NOTIFICATION_SERVERS = "NOTIFICATION_SERVERS";
317     /*
318      * Value for Notification Delay
319      */
320     public static final String PROP_NOTIFICATION_DELAY= "NOTIFICATION_DELAY";
321     /*
322      * Value for Notification Topic
323      */
324     public static final String PROP_NOTIFICATION_TOPIC= "NOTIFICATION_TOPIC";
325     /*
326      * Value for Notification Topic
327      */
328     public static final String PROP_UEB_API_KEY= "UEB_API_KEY";
329     /*
330      * Value for Notification Topic
331      */
332     public static final String PROP_UEB_API_SECRET= "UEB_API_SECRET";
333     /*
334      * Closedloop Fault Policy Template Version
335      */
336     public static final String TemplateVersion_Fault= "xacml.rest.closedLoopFault";
337     /*
338      * Closedloop PM Policy Template Version
339      */
340     public static final String TemplateVersion_PM= "xacml.rest.closedLoopPM";
341     /*
342      * Value for model properties file
343      */
344     public static final String PROP_ADMIN_MICROSERVICE = "xacml.rest.admin.microServiceModel";
345     /*
346      * MicroService Policy Template Version
347      */
348     public static final String TemplateVersion_MS= "xacml.rest.microServices";
349     /*
350      * Optimization Policy Template Version
351      */
352     public static final String TemplateVersion_OOF= "xacml.rest.optimization";
353     /*
354      * Firewall Policy Template Version
355      */
356     public static final String TemplateVersion_FW= "xacml.rest.firewallPolicy";
357     /*
358      *  Size of SelectList for Users in MS
359      *
360     */
361     public static final String PROP_USER_SELECTLIST_WINDOW_SIZE= "xacml.user.column.count";
362     /*
363      * Audit function in pap admin to Update userinfo table to syncronize with Roles table
364      */
365     public static final String PROP_ROLES_USERINFO_AUDIT= "xacml.audit.userInfo";
366     /*
367      * test Environment LoginId
368      */
369     public static final String PROP_TEST_ENVIRONMENT_LOGINID= "xacml.testEnvironment.loginId";
370     /*
371      *  Size of of the page length for sqlcontainer
372      *
373     */
374     public static final String PROP_SQLCONTAINER_PAGE_LENGTH= "xacml.sqlcontainer.page.length";
375     /*
376      *  add values used to connect to restful api
377      *
378     */
379     public static final String PROP_RESTFUL_INTERFACE= "xacm.restful.interface.file";
380     /*
381      *  add pattern to identify what values are designed as required
382      *
383     */
384     public static final String PROP_XCORE_REQUIRED_PATTERN= "xacm.xcor.required.pattern";
385     /*
386      *  Time before a cache value is evicted
387      *
388     */
389     public static final String PROP_CACHE_LIVE_TIME= "xacm.cache.live.time";
390     /*
391      *  Highest value allowed in priority
392      *
393     */
394     public static final String PROP_PRIORITY_COUNT= "xacml.max.priority.count";
395     /*
396      * The name of the PAP.  Must be unique across the system
397      */
398     public static final String PAP_RESOURCE_NAME="xacml.rest.pap.resource.name";
399     /*
400      * The name of the site in which the PAP resides
401      */
402     public static final String PAP_SITE_NAME="site_name";
403     /*
404      * The node type of the PAP - really a no-op since it's value is pap
405      */
406     public static final String PAP_NODE_TYPE="node_type";
407     /*
408      * A list of the groups of resources/nodes on which the PAP is dependent. The members of a
409      * group are comma-separated and the groups are separated with semicolons.
410      */
411     public static final String PAP_DEPENDENCY_GROUPS="dependency_groups";
412     /*
413      * The (optional) period of time in seconds between executions of the integrity audit.
414      * Value < 0 : Audit does not run (default value if property is not present = -1)
415      * Value = 0 : Audit runs continuously
416      * Value > 0 : The period of time in seconds between execution of the audit on a particular node
417      */
418     public static final String PAP_INTEGRITY_AUDIT_PERIOD_SECONDS = "integrity_audit_period_seconds";
419     /*
420      * The name of the Admin.  Must be unique across the system
421      */
422     public static final String ADMIN_RESOURCE_NAME="xacml.rest.admin.resource.name";
423     /*
424      * The name of the PDP.  Must be unique across the system
425      */
426     public static final String PDP_RESOURCE_NAME="xacml.rest.pdp.resource.name";
427     /*
428      * Audit function in pap admin to Update userinfo table to syncronize with Roles table
429      */
430     public static final String PROP_AUTOMATIC_POLICYPUSH= "xacml.automatic.push";
431     /*
432      * Add Limit for Onap Portal Dashboard tab data
433      */
434     public static final String PROP_ONAP_LOGLIMIT = "xacml.onap.dashboard.logTableLimit";
435     public static final String PROP_ONAP_SYSTEMALERTLIMIT = "xacml.onap.dashboard.systemAlertTableLimit";
436     /*
437      * Diff of the policies for the Firewall Feature.
438      */
439     public static final String PROP_FW_GETURL = "FW_GETURL";
440     public static final String PROP_FW_AUTHOURL = "FW_AUTHOURL";
441     public static final String PROP_FW_PROXY = "FW_PROXY";
442     public static final String PROP_FW_PORT = "FW_PORT";
443
444     /*
445      * The number of Risk Levels allowed
446      */
447     public static final String ADMIN_RISK_LEVEL_COUNT="xacml.risk.level.count";
448     /*
449      * The maxium Level displayed on the UI for Micro Services
450      */
451     public static final String PROP_MODEL_LEVEL = "xacml.model.level";
452
453     /*
454      * Value for Incoming Notification tries
455      *
456      * */
457     public static final String PROP_PAP_INCOMINGNOTIFICATION_TRIES = "xacml.rest.pap.incomingnotification.tries";
458
459     /*
460      * The encryption key
461      */
462     public static final String PROP_AES_KEY = "org.onap.policy.encryption.aes.key";
463
464
465     // Static class, hide constructor
466     private XACMLRestProperties() {
467         super();
468     }
469 }