2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.onap.policy.rest;
23 import com.att.research.xacml.util.XACMLProperties;
26 * These are XACML Properties that are relevant to the RESTful API interface for
27 * the PDP, PAP and AC interfaces.
31 public class XACMLRestProperties extends XACMLProperties {
33 * A unique identifier for the PDP servlet instance. Usually set to the URL
34 * it is running as in the J2EE container.
36 * Eg. http://localhost:8080/pdp/
38 public static final String PROP_PDP_ID = "xacml.rest.pdp.id";
40 * A PDP servlet's configuration directory. Holds the pip and policy
41 * configuration data as well as the local policy cache.
43 * Eg: /opt/app/xacml/config
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";
51 * Set this property to true or false if the PDP servlet should register
52 * itself upon startup with the PAP servlet.
54 public static final String PROP_PDP_REGISTER = "xacml.rest.pdp.register";
56 * Number of seconds the PDP will sleep while retrying registration with the
57 * PAP. This value must be greater or equal to 5.
59 public static final String PROP_PDP_REGISTER_SLEEP = "xacml.rest.pdp.register.sleep";
61 * Number of retry attempts at registration with the PAP. A value of -1
62 * indicates infinite retries.
64 public static final String PROP_PDP_REGISTER_RETRIES = "xacml.rest.pdp.register.retries";
66 * Max content length accepted for an incoming POST XML/JSON request.
67 * Default is 32767 bytes.
69 public static final String PROP_PDP_MAX_CONTENT = "xacml.rest.pdp.maxcontent";
71 * Custom HTTP header used by PDP to send the value of the PROP_PDP_ID
73 public static final String PROP_PDP_HTTP_HEADER_ID = "X-XACML-PDP-ID";
75 * Custom HHTP header used by PDP to send its heartbeat value.
77 public static final String PROP_PDP_HTTP_HEADER_HB = "X-XACML-PDP-HB";
79 * Custom HTTP header used by PDP to send the value of the
80 * X-XACML-PDP-JMX-PORT
82 public static final String PROP_PDP_HTTP_HEADER_JMX_PORT = "X-XACML-PDP-JMX-PORT";
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.
89 public static final String PROP_PAP_URL = "xacml.rest.pap.url";
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.
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";
100 * Upon startup, have the PAP servlet send latest configuration information
101 * to all the PDP nodes it knows about.
103 public static final String PROP_PAP_INITIATE_PDP_CONFIG = "xacml.rest.pap.initiate.pdp";
105 * The interval the PAP servlet uses to send heartbeat requests to the PDP
108 public static final String PROP_PAP_HEARTBEAT_INTERVAL = "xacml.rest.pap.heartbeat.interval";
110 * Timeout value used by the PAP servlet when trying to check the heartbeat
113 public static final String PROP_PAP_HEARTBEAT_TIMEOUT = "xacml.rest.pap.heartbeat.timeout";
115 * This is the domain you can setup for your organization, it should be a URI.
118 public static final String PROP_PAP_DOMAIN = "xacml.rest.pap.domain";
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.
124 public static final String PROP_PAP_WORKSPACE = "xacml.rest.pap.workspace";
127 * Local path to where the GIT repository exists.
129 * Eg. /opt/app/xacml/repository
131 public static final String PROP_PAP_REPOSITORY = "xacml.rest.pap.repository";
134 * Database driver property
136 public static final String PROP_PAP_DB_DRIVER = "javax.persistence.jdbc.driver";
141 public static final String PROP_PAP_DB_URL = "javax.persistence.jdbc.url";
146 public static final String PROP_PAP_DB_USER = "javax.persistence.jdbc.user";
151 public static final String PROP_PAP_DB_PASSWORD = "javax.persistence.jdbc.password";
154 * Time in ms which a Policy DB transaction will wait to get the transaction lock object
156 public static final String PROP_PAP_TRANS_WAIT = "xacml.rest.pap.transaction.waitms";
159 * Policy DB transaction timeout in ms after it has obtained the transaction lock object
161 public static final String PROP_PAP_TRANS_TIMEOUT = "xacml.rest.pap.transaction.timeoutms";
164 * Policy Audit transaction timeout in ms after it has obtained the transaction lock object
166 public static final String PROP_PAP_AUDIT_TIMEOUT = "xacml.rest.pap.audit.timeoutms";
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.
172 public static final String PROP_PAP_AUDIT_FLAG = "xacml.rest.pap.filesystem.audit";
175 * Value for enable/disable of audit functionality
177 public static final String PROP_PAP_RUN_AUDIT_FLAG = "xacml.rest.pap.run.audit.flag";
180 * Controls how long the timeout will be when a pap sends a notification to another pap
182 public static final String PROP_PAP_NOTIFY_TIMEOUT = "xacml.rest.pap.notify.timeoutms";
184 * Value for Enable/Disable of AutoPush Flag.
186 public static final String PROP_PAP_PUSH_FLAG = "xacml.rest.pap.autopush.flag";
189 * Properties file for the AutoPush Functionality.
191 public static final String PROP_PAP_PUSH_FILE = "xacml.rest.pap.autopush.file";
194 * Local path to where the GIT repository exists.
196 * Eg. /opt/app/xacml/repository
198 public static final String PROP_ADMIN_REPOSITORY = "xacml.rest.admin.repository";
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.
204 public static final String PROP_ADMIN_WORKSPACE = "xacml.rest.admin.workspace";
206 * This is the domain you can setup for your organization, it should be a
211 public static final String PROP_ADMIN_DOMAIN = "xacml.rest.admin.domain";
213 * PROP_ADMIN_USER_NAME is simply a name for the logged in user.
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.
222 * ((HttpServletRequest)
223 * request).getSession().setAttribute("xacml.rest.admin.user.name",
227 public static final String PROP_ADMIN_USER_NAME = "xacml.rest.admin.user.name";
230 * PROP_ADMIN_USER_ID is an id for the logged in user.
234 * @see #PROP_ADMIN_USER_NAME for more information.
236 public static final String PROP_ADMIN_USER_ID = "xacml.rest.admin.user.id";
239 * PROP_ADMIN_USER_EMAIL is a user's email address.
241 * @see #PROP_ADMIN_USER_NAME for more information.
243 public static final String PROP_ADMIN_USER_EMAIL = "xacml.rest.admin.user.email";
245 * Directory path containing sub-directories where the Subscriber servlet
246 * puts files sent through data feeds.
248 public static final String PROP_SUBSCRIBER_INCOMING = "xacml.subscriber.incoming";
250 * The specific data feed name for the Subscriber servlet to register for.
252 public static final String PROP_SUBSCRIBER_FEED = "xacml.subscriber.feed";
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.
257 public static final String PROP_LOG_TIMEFRAME = "xacml.log.timeframe";
259 * Value for the DB connections used to store the log files.
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";
266 * Value for JMX port for the PDP
268 public static final String PROP_PDP_JMX_PORT = "xacml.jmx.port";
271 * Value for refresh rate
273 public static final String PROP_REFRESH_RATE = "xacml.refresh.rate";
275 // added for Security between Policy Components.
278 * PROP_PAP_USERID is the PAP Unique User ID
280 public static final String PROP_PAP_USERID = "xacml.rest.pap.userid";
282 * PROP_PAP_PASS is the PAP password
284 public static final String PROP_PAP_PASS = "xacml.rest.pap.password";
286 * PROP_PAP_PASS is the PAP password
288 public static final String PROP_CONFIG_URL = "xacml.rest.config.url";
290 * PROP_PDP_USERID is the PDP Unique User ID
292 public static final String PROP_PDP_USERID = "xacml.rest.pdp.userid";
294 * PROP_PDP_PASS is the PDP password
296 public static final String PROP_PDP_PASS = "xacml.rest.pdp.password";
298 * PROP_PDP_IDFILE is the PDP Authentication File
300 public static final String PROP_PDP_IDFILE = "xacml.rest.pdp.idfile";
302 * PROP_PEP_IDFILE is the Client Authentication File
304 public static final String PROP_PEP_IDFILE = "xacml.rest.pep.idfile";
306 * webapps Location of the PAP-REST server
308 public static final String PROP_PAP_WEBAPPS= "xacml.rest.config.webapps";
310 * Value for Notification Option
312 public static final String PROP_NOTIFICATION_TYPE = "NOTIFICATION_TYPE";
314 * Value for Notification DMaaP servers
316 public static final String PROP_NOTIFICATION_SERVERS = "NOTIFICATION_SERVERS";
318 * Value for Notification Delay
320 public static final String PROP_NOTIFICATION_DELAY= "NOTIFICATION_DELAY";
322 * Value for Notification Topic
324 public static final String PROP_NOTIFICATION_TOPIC= "NOTIFICATION_TOPIC";
326 * Value for Notification Topic
328 public static final String PROP_UEB_API_KEY= "UEB_API_KEY";
330 * Value for Notification Topic
332 public static final String PROP_UEB_API_SECRET= "UEB_API_SECRET";
334 * Closedloop Fault Policy Template Version
336 public static final String TemplateVersion_Fault= "xacml.rest.closedLoopFault";
338 * Closedloop PM Policy Template Version
340 public static final String TemplateVersion_PM= "xacml.rest.closedLoopPM";
342 * Value for model properties file
344 public static final String PROP_ADMIN_MICROSERVICE = "xacml.rest.admin.microServiceModel";
346 * MicroService Policy Template Version
348 public static final String TemplateVersion_MS= "xacml.rest.microServices";
350 * Optimization Policy Template Version
352 public static final String TemplateVersion_OOF= "xacml.rest.optimization";
354 * Firewall Policy Template Version
356 public static final String TemplateVersion_FW= "xacml.rest.firewallPolicy";
358 * Size of SelectList for Users in MS
361 public static final String PROP_USER_SELECTLIST_WINDOW_SIZE= "xacml.user.column.count";
363 * Audit function in pap admin to Update userinfo table to syncronize with Roles table
365 public static final String PROP_ROLES_USERINFO_AUDIT= "xacml.audit.userInfo";
367 * test Environment LoginId
369 public static final String PROP_TEST_ENVIRONMENT_LOGINID= "xacml.testEnvironment.loginId";
371 * Size of of the page length for sqlcontainer
374 public static final String PROP_SQLCONTAINER_PAGE_LENGTH= "xacml.sqlcontainer.page.length";
376 * add values used to connect to restful api
379 public static final String PROP_RESTFUL_INTERFACE= "xacm.restful.interface.file";
381 * add pattern to identify what values are designed as required
384 public static final String PROP_XCORE_REQUIRED_PATTERN= "xacm.xcor.required.pattern";
386 * Time before a cache value is evicted
389 public static final String PROP_CACHE_LIVE_TIME= "xacm.cache.live.time";
391 * Highest value allowed in priority
394 public static final String PROP_PRIORITY_COUNT= "xacml.max.priority.count";
396 * The name of the PAP. Must be unique across the system
398 public static final String PAP_RESOURCE_NAME="xacml.rest.pap.resource.name";
400 * The name of the site in which the PAP resides
402 public static final String PAP_SITE_NAME="site_name";
404 * The node type of the PAP - really a no-op since it's value is pap
406 public static final String PAP_NODE_TYPE="node_type";
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.
411 public static final String PAP_DEPENDENCY_GROUPS="dependency_groups";
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
418 public static final String PAP_INTEGRITY_AUDIT_PERIOD_SECONDS = "integrity_audit_period_seconds";
420 * The name of the Admin. Must be unique across the system
422 public static final String ADMIN_RESOURCE_NAME="xacml.rest.admin.resource.name";
424 * The name of the PDP. Must be unique across the system
426 public static final String PDP_RESOURCE_NAME="xacml.rest.pdp.resource.name";
428 * Audit function in pap admin to Update userinfo table to syncronize with Roles table
430 public static final String PROP_AUTOMATIC_POLICYPUSH= "xacml.automatic.push";
432 * Add Limit for Onap Portal Dashboard tab data
434 public static final String PROP_ONAP_LOGLIMIT = "xacml.onap.dashboard.logTableLimit";
435 public static final String PROP_ONAP_SYSTEMALERTLIMIT = "xacml.onap.dashboard.systemAlertTableLimit";
437 * Diff of the policies for the Firewall Feature.
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";
445 * The number of Risk Levels allowed
447 public static final String ADMIN_RISK_LEVEL_COUNT="xacml.risk.level.count";
449 * The maxium Level displayed on the UI for Micro Services
451 public static final String PROP_MODEL_LEVEL = "xacml.model.level";
454 * Value for Incoming Notification tries
457 public static final String PROP_PAP_INCOMINGNOTIFICATION_TRIES = "xacml.rest.pap.incomingnotification.tries";
460 // Static class, hide constructor
461 private XACMLRestProperties() {