You are viewing the documentation for Blueriq 17. Documentation for other versions is available in our documentation directory.
Runtime
Encrypting connection passwords
Connection passwords will be encrypted when configured by the development dashboard.
The development dashboard provides an interface to configure a Blueriq Studio connection to retrieve projects and SOAP or REST connections which use authentication.
In R10+, Blueriq provides a password encryptor which can be used without the development dashboard Property Encryptor.
Authentication
Out-of-the-box, Blueriq comes with an in-memory authentication provider. This default implementation should be used for development purposes as they store the credentials in plain text on the file system. To configure an authentication provider for production purposes, please read Runtime Authentication and HTTP Security in Runtime.
Blueriq session & cookie
Blueriq Runtime and Publisher are using the HTTP session to store data before it is persisted. As stated by OWASP, the session timeout should be set as low as possible (https://owasp.org/www-community/Session_Timeout). Depending on your infrastructure it is possible to set the Secure flag of the session cookie (https://owasp.org/www-community/controls/SecureCookieAttribute). Both the session timeout and the secure flag can be configured by following the steps in the articles below:
By default the secure flag of the session cookie is enabled since release 16.0 and onwards. In earlier versions, the property was disabled by default.
Disabling the secure session cookie from Blueriq version 14.7 onwards can be done by configuring the following property:
blueriq.session.cookie.secure=false
When the secure
flag is set on the session cookie, the cookie will only be sent to the server over a secured connection (HTTPS).
If your runtime runs in HTTP mode, despite the cookie having the secure
flag, you will get errors about Blueriq Sessions not being found or being expired.
Additionally, the SameSite
attribute can be set on the session cookie: Security: SameSite.
Runtime protection
Out-of-the-box, Blueriq comes with an in-memory authentication provider. This default implementation should be used for development purposes as they store the credentials in plain text on the file system. To configure an authentication provider for production purposes, please read Runtime Authentication and HTTP Security in Runtime.
Default exposed endpoints
The following list contains all endpoints that are exposed in Blueriq by default.
Shortcuts
In a production environment shortcuts should be used instead of exposed flows. By default, all exposed flows can be started externally. Please read Create a shortcut in the Runtime on how to create a shortcut. Disabling starting all exposed flows can be done by setting the blueriq.production.shortcuts-only
to true in application.properties
.
Example in application.properties
:
blueriq.production.shortcuts-only=true
AQ_StartProject
By default shortcuts can be accessed externally via the url (e.q. http://localhost:91/Runtime/server/start/<SHORTCUT_NAME>). When using shortcuts in combination with AQ_StartProject you should be aware that this shortcut can also be accessed externally. To prevent this from happening, you should set the property privateAccess
to true.
The reason for this is that via the AQ_StartProject, parameters are passed to the shortcut application and are picked up via the AQ_GetRequestParameters service. The AQ_GetRequestParameters does not distinguish on how parameters are send, by the AQ_StartProject service or the end user threw the URL. For more information about passing parameters via the AQ_StartProject, please read AQ_StartProject#Security.
Example shortcut in application.properties
:
blueriq.shortcut.<SHORTCUT_NAME>.flow=<FLOW>
blueriq.shortcut.<SHORTCUT_NAME>.languageCode=<LANGUAGE>
blueriq.shortcut.<SHORTCUT_NAME>.project=<PROJECT>
blueriq.shortcut.<SHORTCUT_NAME>.theme=<THEME>
blueriq.shortcut.<SHORTCUT_NAME>.ui=<MVC>
blueriq.shortcut.<SHORTCUT_NAME>.version=<VERSION>
blueriq.shortcut.<SHORTCUT_NAME>.privateAccess=true
AQ_GetRequestParameters
The AQ_GetRequestParameters service is able to retrieve parameters from the URL. You should treat these parameters as "dirty", which means you should validate these parameters before using them.
Security properties
Blueriq Runtime has build in security and is enabled by default with application properties.
The security configuration can be customized as needed. For a better understanding of the properties and default configuration, below is a list of all the security properties Blueriq contains.
Cross-site scripting (XSS) protection
Cross-site scripting, also known as XSS protection, is implemented as an IValueFormatter for values coming from external sources. It implements basic HTML escaping as described on the OWASP website using a normalization and targeted replace technique.
- Web application - data from inputs are formatted in the controllers before being processed;
- Development plugin - modifying the profile from the development plugin will use formatted values as well;
- Web services - both REST and SOAP services are protected against XSS by the formatter;
- The Request Parameters plugin.
Canonicalization
All input is transformed into a canonical form before validation. Canonicalization involves URL- and HTML-decoding the input.
We use ESAPI to canonicalize the input string to improve the detection. We allow mixed and multiple encodings before we validate if no malicious pattern is found. You can disallow multiple and mixed encoding by specifying your own ESAPI.properties. You can specify the location of this file by passing the environment setting org.owasp.esapi.resources. When ESAPI throws an IntrusionException an empty string will be used.
By default this is enabled.
The property should be:
blueriq.security.xss-protection.enabled=true
To disable use:
blueriq.security.xss-protection.enabled=false
XSS Components
The above properties enable/disable cross site scripting protection as a whole. If needed, custom rules can be applied, as described below. Cross site scripting protection has the following components :
- Setting the HTTP header
- Request body validation
- Request parameters validation
- Request url validation
- Multipart request validation
- Whitelist
- Blacklist
By default all components are enabled.
By default all components are enabled.
The properties should be:
blueriq.security.xss-protection.header.enabled=true blueriq.security.xss-protection.request-body-validation.enabled=true blueriq.security.xss-protection.request-parameter-validation.enabled=true blueriq.security.xss-protection.request-url-validation.enabled=true blueriq.security.xss-protection.whitelist.enabled=true blueriq.security.xss-protection.blacklist.enabled=true
To disable use:
blueriq.security.xss-protection.header.enabled=false blueriq.security.xss-protection.request-body-validation.enabled=false blueriq.security.xss-protection.request-parameter-validation.enabled=false blueriq.security.xss-protection.request-url-validation.enabled=false blueriq.security.xss-protection.whitelist.enabled=false blueriq.security.xss-protection.blacklist.enabled=false
1 Header
For the header there are no additional parameters.
2 Request Body Validation
This property refers to validation for POST requests that contain an application/json request body. When this type of validation is enabled, the request is blocked if dangerous input is detected in the request body.
3 Request Parameter Validation
This property refers to validation for request parameters. When this type of validation is enabled, the request is blocked if dangerous input is detected in the request parameters.
4 Request URL Validation
This property refers to validation for request URL. When this type of validation is enabled, the request is blocked if dangerous input is detected in the request URL.
5 Multipart Request Validation
This property refers to validation for multipart requests. Body parts that have content-type "application/json" are validated the same way as for the Request Body Validation. When this type of validation is enabled, the request is blocked if dangerous input is detected in the JSON request parts.
Note: for all of the properties above , dangerous input is determined by the blacklist and whitelist configuration.
6 Whitelist Customization
(White list validation is appropriate for all input fields provided by the user. White list validation involves defining exactly what IS authorized, and by definition, everything else is not authorized.)
By default, when the XSS Whitelist protection is activated, all tags and attributes are blocked.
Property | Description |
---|---|
blueriq.security.xss-protection.whitelist.allowed-protocols | defines the allowed protocols for URI attributes |
blueriq.security.xss-protection.whitelist.allowed-tags | html tags that will be allowed |
blueriq.security.xss-protection.whitelist.allowed-global-attributes | attributes that will be allowed for all the allowed tags |
blueriq.security.xss-protection.whitelist.allowed-attributes. <tag name> | allows fine tuning of allowed attributes for a specific tag name |
| allows specifying for a specific tag what attributes are URI attributes and the protocols allowed will be the ones globally defined(first property in this table) Note: If an attribute is marked as an URI attribute, then the attribute value must be a URI, otherwise it will not pass the validation and it will be removed |
Note: If an attribute is marked as an URI attribute, then the attribute value must be a URI, otherwise it will not pass the validation and itwill be removed
Whitelist configuration examples
The example is just a simple example for understanding how whitelist properties work. This is not meant for production use! Please define your own whitelist properties tailored for your project needs.
blueriq.security.xss-protection.whitelist.enabled=true # define what protocols are allowed on uri attributes blueriq.security.xss-protection.whitelist.allowed-protocols=http,https # define what tags are allowed blueriq.security.xss-protection.whitelist.allowed-tags=b,i,u,q,img # define what attributes are allowed on all the allowed tags blueriq.security.xss-protection.whitelist.allowed-global-attributes=class,tabindex,title # define what attribute are allowed on each tag blueriq.security.xss-protection.whitelist.allowed-attributes.q=cite blueriq.security.xss-protection.whitelist.allowed-attributes.img=src,alt # define which attributes of which tags can contain URIs and are subject to the allowed-protocols restrictions blueriq.security.xss-protection.whitelist.uri-attributes.a=href blueriq.security.xss-protection.whitelist.uri-attributes.img=src
7 Blacklist
The blacklist checks the input against predefined regular expressions. The blacklist can be enabled or disabled with the following settings:
By default this is enabled.
The property should be:
blueriq.security.xss-protection.blacklist.enabled=true
To disable use:
blueriq.security.xss-protection.blacklist.enabled=false
X-XSS-Protection Header
The HTTP X-XSS-Protection response header is a feature of Internet Explorer, Chrome and Safari that stops pages from loading when they detect reflected cross-site scripting attacks. Although these protections are largely unnecessary in modern browsers when sites implement a strong Content-Security-Policy that disables the use of inline JavaScript ('unsafe-inline'), they can still provide protections for users of older web browsers that don't yet support CSP. The response header that will be sent:
X-XSS-Protection: 1; mode=block
Enables XSS filtering. Rather than sanitizing the page, the browser will prevent rendering of the page if an attack is detected.
By default all components are enabled.
The properties should be:
blueriq.security.xss-protection.header.enabled=true
To disable use:
blueriq.security.xss-protection.header.enabled=false
Registering custom XSS protection components
In case the default blacklist and/or whitelist implementations are not sufficient, it is possible to register custom blacklist and/or whitelist implementations.
Create your own blacklist implementation:
import com.aquima.interactions.project.impl.xss; public class SampleXssBlacklist implements IXssBlacklist { public String sanitize(String input) { // custom input sanitization } public boolean isValid(String input) { // custom input validation } }
Create your own whitelist implementation:
import com.aquima.interactions.project.impl.xss; public class SampleXssWhitelist implements IXssWhitelist { public String sanitize(String input) { // custom input sanitization } public boolean isValid(String input) { // custom input validation } }
Expose your custom blacklist and/or whitelist implementations as Spring beans:
@Configuration public class SampleXssConfiguration { @Bean public IXssBlacklist xssBlacklist() { return new SampleXssBlacklist(); } @Bean public IXssWhitelist xssWhitelist() { return new SampleXssWhitelist(); } }
The Runtime will automatically detect your custom implementations and register them instead of the default implementations.
Potential problems
- In its current form, the formatter does not provide 100% protection against cross-site scripting. Other countermeasures (such as a web application firewall) are recommended. See the OWASP website for more information on XSS attacks.
- It is not possible to disallow XML/HTML content in the profile values because there are valid use cases which require this. Therefore the decision to protect only the entry points mentioned above has been made. It is the responsibility of the developer using extension points to make sure the values inserted into the profile are validated against XSS.
- Requests with parameters containing tags with URI attributes of the form "http://www.example.com" (i.e. without a trailing slash) will be blocked
- Values entered in fields (profile) or comments containing tags with URI attributes will be sanitized (eg. the input
<a href="http://www.example.com">link</a>
will be sanitized to<a href="http://www.example.com/">link</a>
)
Hiding the WSDL
WSDL files provide detailed information about the services ports and bindings available to web server. An attacker can try to submit special characters or malicious content to the Web service and potentially cause a denial of service condition or unauthorised access to database records. In addition, the attacker may try to guess other 'private' (unexposed) methods by using the information provided in the WSDL files.
For example the following web service description was discovered:
ManagementService.wsdl
The URL of the above WSDL is:
https://<host>:<port>/Services/Managementsservice?singleWsdl
Recommendation: The access to WSDL file should be limited as much as possible (for example the entry point should go thourgh nginx [https://nginx.org/en/] or something similar). If services are provided only to a limited number of entities, it may be better to provide WSDL privately to each of these entities than to publish WSDL publicly.