[POLICY-122] Policy GUI Fixes
[policy/engine.git] / ECOMP-REST / src / main / java / org / openecomp / policy / rest / XACMLRestProperties.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ECOMP-REST
4  * ================================================================================
5  * Copyright (C) 2017 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.openecomp.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         //public static final String PROP_PAP_FAILED_URL_TIME = "xacml.rest.pap.failedUrlTime";
99         
100         /**
101          * Upon startup, have the PAP servlet send latest configuration information
102          * to all the PDP nodes it knows about.
103          */
104         public static final String PROP_PAP_INITIATE_PDP_CONFIG = "xacml.rest.pap.initiate.pdp";
105         /**
106          * The interval the PAP servlet uses to send heartbeat requests to the PDP
107          * nodes.
108          */
109         public static final String PROP_PAP_HEARTBEAT_INTERVAL = "xacml.rest.pap.heartbeat.interval";
110         /**
111          * Timeout value used by the PAP servlet when trying to check the heartbeat
112          * of a PDP node.
113          */
114         public static final String PROP_PAP_HEARTBEAT_TIMEOUT = "xacml.rest.pap.heartbeat.timeout";
115         /*
116          * This is the domain you can setup for your organization, it should be a URI.
117          * Eg. com:sample:foo
118          */
119         public static final String PROP_PAP_DOMAIN = "xacml.rest.pap.domain";
120         
121         /*
122          * Local path to where user workspaces exist. The user workspace contains temporary files, the
123          * user's clone of the GIT repository, anything specific to the user, etc.
124          */
125         public static final String PROP_PAP_WORKSPACE = "xacml.rest.pap.workspace";
126         
127         /*
128          * Local path to  where the GIT repository exists.
129          * 
130          * Eg. /opt/app/xacml/repository
131          */
132         public static final String PROP_PAP_REPOSITORY = "xacml.rest.pap.repository";
133         
134         /*
135          * Database driver property
136          */
137         public static final String PROP_PAP_DB_DRIVER = "javax.persistence.jdbc.driver";
138         
139         /*
140          * Database url
141          */
142         public static final String PROP_PAP_DB_URL = "javax.persistence.jdbc.url";
143         
144         /*
145          * Database user
146          */
147         public static final String PROP_PAP_DB_USER = "javax.persistence.jdbc.user";
148         
149         /*
150          * Database password
151          */
152         public static final String PROP_PAP_DB_PASSWORD = "javax.persistence.jdbc.password";
153         
154         /*
155          * Time in ms which a Policy DB transaction will wait to get the transaction lock object
156          */
157         public static final String PROP_PAP_TRANS_WAIT = "xacml.rest.pap.transaction.waitms";
158         
159         /*
160          * Policy DB transaction timeout in ms after it has obtained the transaction lock object
161          */
162         public static final String PROP_PAP_TRANS_TIMEOUT = "xacml.rest.pap.transaction.timeoutms";
163         
164         /*
165          * Policy Audit transaction timeout in ms after it has obtained the transaction lock object
166          */
167         public static final String PROP_PAP_AUDIT_TIMEOUT = "xacml.rest.pap.audit.timeoutms";
168         
169         /*
170          * Value determines direction of audit.  Value=true will synch the file system to contents of the DB.  
171          * Value=false will synch the DB to the contents of the file system.
172          */     
173         public static final String PROP_PAP_AUDIT_FLAG = "xacml.rest.pap.filesystem.audit";
174         
175         /*
176          * Value for enable/disable of audit functionality
177          */             
178         public static final String PROP_PAP_RUN_AUDIT_FLAG = "xacml.rest.pap.run.audit.flag";
179         
180         /*
181          * Controls how long the timeout will be when a pap sends a notification to another pap
182          */
183         public static final String PROP_PAP_NOTIFY_TIMEOUT = "xacml.rest.pap.notify.timeoutms";
184         /*
185          *  Value for Enable/Disable of AutoPush Flag. 
186          */
187         public static final String PROP_PAP_PUSH_FLAG = "xacml.rest.pap.autopush.flag";
188         
189         /*
190          *  Properties file for the AutoPush Functionality. 
191          */
192         public static final String PROP_PAP_PUSH_FILE = "xacml.rest.pap.autopush.file";
193         
194         /*
195          * Local path to where the GIT repository exists.
196          * 
197          * Eg. /opt/app/xacml/repository
198          */
199         public static final String PROP_ADMIN_REPOSITORY = "xacml.rest.admin.repository";
200         /*
201          * Local path to where user workspaces exist. The user workspace contains
202          * temporary files, the user's clone of the GIT repository, anything
203          * specific to the user, etc.
204          */
205         public static final String PROP_ADMIN_WORKSPACE = "xacml.rest.admin.workspace";
206         /*
207          * This is the domain you can setup for your organization, it should be a
208          * URI.
209          * 
210          * Eg. com:sample:foo
211          */
212         public static final String PROP_ADMIN_DOMAIN = "xacml.rest.admin.domain";
213         /**
214          * PROP_ADMIN_USER_NAME is simply a name for the logged in user.
215          * 
216          * AC authentication is out the scope of the web application itself. It is
217          * up to the developer to setup authentication as they please in the J2EE
218          * container used to run the web application. Whatever authentication
219          * mechanism they use, they should then set the attribute into the
220          * HttpSession object. The Admin Console will be able to read that value
221          * (default to "guest") in.
222          * 
223          * ((HttpServletRequest)
224          * request).getSession().setAttribute("xacml.rest.admin.user.name",
225          * "Homer");
226          * 
227          */
228         public static final String PROP_ADMIN_USER_NAME = "xacml.rest.admin.user.name";
229         /**
230          * 
231          * PROP_ADMIN_USER_ID is an id for the logged in user.
232          * 
233          * Eg. hs1234
234          *
235          * @see #PROP_ADMIN_USER_NAME for more information.
236          */
237         public static final String PROP_ADMIN_USER_ID = "xacml.rest.admin.user.id";
238         /**
239          * 
240          * PROP_ADMIN_USER_EMAIL is a user's email address.
241          * 
242          * @see #PROP_ADMIN_USER_NAME for more information.
243          */
244         public static final String PROP_ADMIN_USER_EMAIL = "xacml.rest.admin.user.email";
245         /**
246          * Directory path containing sub-directories where the Subscriber servlet
247          * puts files sent through data feeds.
248          */
249         public static final String PROP_SUBSCRIBER_INCOMING = "xacml.subscriber.incoming";
250         /**
251          * The specific data feed name for the Subscriber servlet to register for.
252          */
253         public static final String PROP_SUBSCRIBER_FEED = "xacml.subscriber.feed";
254         /**
255          * Value for the log time frame that is to be stored in the database any
256          * logs after this time frame will be removed.
257          */
258         public static final String PROP_LOG_TIMEFRAME = "xacml.log.timeframe";
259         /**
260          * Value for the DB connections used to store the log files.
261          */
262         public static final String PROP_LOG_DB_DRIVER = "xacml.log.db.driver";
263         public static final String PROP_LOG_DB_URL = "xacml.log.db.url";
264         public static final String PROP_LOG_DB_USER = "xacml.log.db.user";
265         public static final String PROP_LOG_DB_PASSWORD = "xacml.log.db.password";
266         /*
267          * Value for JMX port for the PDP
268          */
269         public static final String PROP_PDP_JMX_PORT = "xacml.jmx.port";
270
271         /*
272          * Value for refresh rate
273          */
274         public static final String PROP_REFRESH_RATE = "xacml.refresh.rate";
275
276         // added for Security between Policy Components.
277         // 6/26
278         /*
279          * PROP_PAP_USERID is the PAP Unique User ID
280          */
281         public static final String PROP_PAP_USERID = "xacml.rest.pap.userid";
282         /*
283          * PROP_PAP_PASS is the PAP password
284          */
285         public static final String PROP_PAP_PASS = "xacml.rest.pap.password";
286         /*
287          * PROP_PAP_PASS is the PAP password
288          */
289         public static final String PROP_CONFIG_URL = "xacml.rest.config.url";   
290         /*
291          * PROP_PDP_USERID is the PDP Unique User ID
292          */
293         public static final String PROP_PDP_USERID = "xacml.rest.pdp.userid";
294         /*
295          * PROP_PDP_PASS is the PDP password
296          */
297         public static final String PROP_PDP_PASS = "xacml.rest.pdp.password";
298         /*
299          * PROP_PDP_IDFILE is the PDP Authentication File
300          */
301         public static final String PROP_PDP_IDFILE = "xacml.rest.pdp.idfile";
302         /*
303          * PROP_PEP_IDFILE is the Client Authentication File
304          */
305         public static final String PROP_PEP_IDFILE = "xacml.rest.pep.idfile";
306         /*
307          * webapps Location of the PAP-REST server
308          */
309         public static final String PROP_PAP_WEBAPPS= "xacml.rest.config.webapps";
310         /*
311          * Value for Notification Option
312          */
313         public static final String PROP_NOTIFICATION_TYPE = "NOTIFICATION_TYPE";
314         /*
315          * Value for Notification DMaaP servers
316          */
317         public static final String PROP_NOTIFICATION_SERVERS = "NOTIFICATION_SERVERS";  
318         /*
319          * Value for Notification Delay
320          */
321         public static final String PROP_NOTIFICATION_DELAY= "NOTIFICATION_DELAY";
322         /*
323          * Value for Notification Topic
324          */
325         public static final String PROP_NOTIFICATION_TOPIC= "NOTIFICATION_TOPIC";       
326         /*
327          * Value for Notification Topic
328          */
329         public static final String PROP_UEB_API_KEY= "UEB_API_KEY";     
330         /*
331          * Value for Notification Topic
332          */
333         public static final String PROP_UEB_API_SECRET= "UEB_API_SECRET";       
334         /*
335          * Closedloop Fault Policy Template Version
336          */
337         public static final String TemplateVersion_Fault= "xacml.rest.closedLoopFault";
338         /*
339          * Closedloop PM Policy Template Version
340          */
341         public static final String TemplateVersion_PM= "xacml.rest.closedLoopPM";
342         /*
343          * Value for model properties file
344          */
345         public static final String PROP_ADMIN_MICROSERVICE = "xacml.rest.admin.microServiceModel";      
346         /*
347          * MicroService Policy Template Version
348          */
349         public static final String TemplateVersion_MS= "xacml.rest.microServices";
350         /*
351          * Firewall Policy Template Version
352          */
353         public static final String TemplateVersion_FW= "xacml.rest.firewallPolicy";
354         /*
355          *  Size of SelectList for Users in MS
356          *  
357         */
358         public static final String PROP_USER_SELECTLIST_WINDOW_SIZE= "xacml.user.column.count";
359         /*
360          * Audit function in pap admin to Update userinfo table to syncronize with Roles table 
361          */
362         public static final String PROP_ROLES_USERINFO_AUDIT= "xacml.audit.userInfo";
363         /*
364          * test Environment LoginId
365          */
366         public static final String PROP_TEST_ENVIRONMENT_LOGINID= "xacml.testEnvironment.loginId";
367         /*
368          *  Size of of the page length for sqlcontainer
369          *  
370         */
371         public static final String PROP_SQLCONTAINER_PAGE_LENGTH= "xacml.sqlcontainer.page.length";
372         /*
373          *  add values used to connect to restful api
374          *  
375         */
376         public static final String PROP_RESTFUL_INTERFACE= "xacm.restful.interface.file";
377         /*
378          *  add pattern to identify what values are designed as required
379          *  
380         */
381         public static final String PROP_XCORE_REQUIRED_PATTERN= "xacm.xcor.required.pattern";
382         /*
383          *  Time before a cache value is evicted
384          *  
385         */
386         public static final String PROP_CACHE_LIVE_TIME= "xacm.cache.live.time";
387         /*
388          *  Highest value allowed in priority
389          *  
390         */
391         public static final String PROP_PRIORITY_COUNT= "xacml.max.priority.count";
392         /*
393          * The name of the PAP.  Must be unique across the system
394          */
395         public static final String PAP_RESOURCE_NAME="xacml.rest.pap.resource.name";
396         /*
397          * The name of the site in which the PAP resides
398          */
399         public static final String PAP_SITE_NAME="site_name";
400         /*
401          * The node type of the PAP - really a no-op since it's value is pap
402          */
403         public static final String PAP_NODE_TYPE="node_type";
404         /*
405          * A list of the groups of resources/nodes on which the PAP is dependent. The members of a 
406          * group are comma-separated and the groups are separated with semicolons.
407          */
408         public static final String PAP_DEPENDENCY_GROUPS="dependency_groups";
409         /*
410          * The (optional) period of time in seconds between executions of the integrity audit.
411          * Value < 0 : Audit does not run (default value if property is not present = -1)
412          * Value = 0 : Audit runs continuously
413          * Value > 0 : The period of time in seconds between execution of the audit on a particular node
414          */
415         public static final String PAP_INTEGRITY_AUDIT_PERIOD_SECONDS = "integrity_audit_period_seconds";
416         /*
417          * The name of the Admin.  Must be unique across the system
418          */
419         public static final String ADMIN_RESOURCE_NAME="xacml.rest.admin.resource.name";
420         /*
421          * The name of the PDP.  Must be unique across the system
422          */
423         public static final String PDP_RESOURCE_NAME="xacml.rest.pdp.resource.name";
424         /*
425          * Audit function in pap admin to Update userinfo table to syncronize with Roles table 
426          */
427         public static final String PROP_AUTOMATIC_POLICYPUSH= "xacml.automatic.push";
428         /*
429          * Add Limit for Ecomp Portal Dashboard tab data
430          */
431         public static final String PROP_ECOMP_LOGLIMIT = "xacml.ecomp.dashboard.logTableLimit";
432         public static final String PROP_ECOMP_SYSTEMALERTLIMIT = "xacml.ecomp.dashboard.systemAlertTableLimit";
433         /*
434          * Diff of the policies for the Firewall Feature. 
435          */
436         public static final String PROP_FW_GETURL = "FW_GETURL";
437         public static final String PROP_FW_AUTHOURL = "FW_AUTHOURL";
438         public static final String PROP_FW_PROXY = "FW_PROXY";
439         public static final String PROP_FW_PORT = "FW_PORT";
440         
441         /*
442          * The number of Risk Levels allowed
443          */
444         public static final String ADMIN_RISK_LEVEL_COUNT="xacml.risk.level.count";
445         /*
446          * The maxium Level displayed on the UI for Micro Services
447          */
448         public static final String PROP_MODEL_LEVEL = "xacml.model.level";
449         
450         /*
451          * Value for Incoming Notification tries
452          * 
453          * */
454         public static final String PROP_PAP_INCOMINGNOTIFICATION_TRIES = "xacml.rest.pap.incomingnotification.tries";
455         
456 }