WSO2 Product Administration
WSO2 Product Administration
WSO2 Product Administration
WSO2 Training
Module 07 - Security
Security of Carbon Based Products
Transport Level Security
Asymmetric Encryption
Symmetric Encryption
https://docs.wso2.com/display/ADMIN44x/Security+Guidelines+for+Production+Deplo
yment
Transport Level Security
<PRODUCT_HOME>/conf/tomcat/catalina-server.xml
2 ways to configure
1. Disable SSL
Disable SSL protocol (Remove 'sslProtocol="TLS"' ) and replace it with the supported TLS
protocol versions (Add sslEnabledProtocols="TLSv1,TLSv1.1,TLSv1.2")
The transport level security protocol of the Tomcat server is configured in the .
<PRODUCT_HOME>/conf/tomcat/catalina-server.xml.
By default the ssLprotocol attribute is set to "TLS"
Keystore Based
○ Single Keystore
○ Multiple Keystores
In asymmetric encryption, keystores (Containing Key pairs and Certificates) and made
available for each product.
You can configure multiple key store enabling the usages of different keys for
different use cases.
SSL/Keystores
Use CA-signed or self-signed certificates
CA-Signed
● Export Certificate (OpenSSL)
● Generate Keystore (Java Keytool)
Self-signed
● Using Java Keytool
Keystore
● Default Keystore - wso2carbon.jks
● Replace with a keystore containing a self-signed or CA-signed certificate
Trust-store
● Default TrustStore - client-truststore.jks
Key store
WSO2 Carbon-based products are shipped with a default keystore named
wso2carbon.jks in the <PRODUCT_HOME>/repository/resources/security directory.
This comes with a private/public key pair used to encrypt sensitive information, when
communicating over SSL and for encryption/signature purposes in WS-Security.
The recommendation for production deployments is to replace this keystore as
anyone can have access other private key of this.
Truststore
In the SSL handshake, the client verifies the server certificate. For this, the client
needs to have a stored list of trusted certificates , in a trust store. All WSO2 products
are shipped with the trust store named client-truststore.jks, in the
<PRODUCT_HOME>/repository/resources/security/ directory.
They public certificate of the keystore server, needs to be imported into this truststore
during SSL based communication of WSO2 products.
Symmetric Encryption
WSO2 Products based on Carbon 4.4.3 and above provide the option of switching
between asymmetric and symmetric encryption.
Symmetric encryption allows a single key to be shared for encryption and decryption
purposes.
Java Security Manager
The Java Security Manager defines security policies that prohibit untrusted code from
manipulating the server.
Enabling this activates the Java permissions in
<PRODUCT_HOME>/repository/conf/sec.policy file.
These permissions can be altered as required.
Secure Vault
Repository
Manager
Secret Callback
Resolver
https://docs.wso2.com/display/ADMIN44x/Carbon+Secure+Vault+Implementation
Plain text passwords in WSO2 product configuration files can be secured using the
'Secure Vault' implementation built into Carbon products.
The cipher tool (<PRODUCT_HOME>/bin/ciphertool.sh) enables this.
Secret repository:
This stores encrypted values of the plain text passwords in the
<PRODUCT_HOME>/repository/conf/security/cipher-text.properties file against the
alias defined in cipher-tool.properties file.
Secret Manager:
<PRODUCT_HOME>/repository/conf/security/cipher-tool.properties file stores
password aliases against their xpaths.
Secret manager initializes the secret repository and keystore of the carbon server.
The secrets (passwords) of the secret repository are accessed using aliases indicated
in the cipher-tool.properties file.
The decryption crypt, used to resolve encrypted secret values is created using the
keystore.
Secret Callback:
The SecretManagerSecretCallbackHandler together with the secret Manager resolve
the secret to identify the actual password.
Secret Resolver:
Configuration builders that contain configuration files with secret information should
be initialized with the secret resolver when building the configurations.
This keeps a list of secured elements that should be defined in the configuration file
with secret aliases.
It initializes the Secret Callback handler class defined in the configuration file.
Mitigating Cross Site Request Forgery (CSRF)
Attacks
2 Approaches
● Using CSRF Valve
White list and pattern based
Cross Site Request Forgery (CSRF) attacks trick users into sending a malicious
request, forcing the them to execute unwanted actions on a web browser where they
are already authenticated. The attacker uses the same sessions in which the user has
logged in to the web application on the browser , to bypass the authentication step.
There are 2 approaches to mitigate CSRF attacks.
Cross Site Scripting (XSS) attacks inject malicious scripts / payload into trusted
legitimate web applications using client side scripts
Using this attackers gain access to sensitive page content, session cookies etc of
web applications that are maintained by the web browser on behalf of the user.
To mitigate XSS attacks we can use the XSS Valve approach, which uses a filter to
differentiate between malicious and legitimate scripts, by validating the URL patterns.
Hardening
Reduce the surface of vulnerability
For this we recommend to apply the organization's backup policies on the entire
deployment.
In addition, all security patches provided by the relevant OS vendor should be applied
on each machine running instances of the deployment.
Turn off all services that are not utilized and add firewall rules to close all ports other
than the ports used by WSO2 products.
In addition you can follow securing and hardening techniques depending on the OS.
Changing default credentials is a must as all servers use an administrator use with
common credentials.
All WSO2 products use a default keystore which comes with a self signed SSL key.
These keys are public, therefore the recommendation is to configure a new keystore.
Appropriate Heap and Permgen values for JVM should be configured based on the
deployment scenarios.
These can be configured in the '<PRODUCT_HOME>/bin/wso2server.sh' file.
The recommended values for a typical deployment are as follows.
-Xms512m -Xmx2048m -XX:MaxPermSize=1024m
Also keep in mind that in order to run the JVM with 2 GB (-Xmx2048m), you should
ideally have about 4GB of memory on the physical machine.
WSO2 products identify the current machine's hostname via the Java API by default.
But this sometimes causes errors in certain environment. Therefore it is
recommended to configure a hostname explicitly for the server instance by setting
the HostName parameters in <Product_Home>/repository/conf/carbon.xml
<HostName>wso2.esb.com</HostName>
The default database used by the registry as the persistent storage of WSO2
products is the embedded H2. This is less reliable and performant compared to
standard databases like MySQL / Oracle when there is a large number of deployed
artifacts. Therefore it is recommended to point the registry to a database like MySQL
/ Oracle/ MSSQL and also follow periodic backup procedures. When the registry is
pointed to a remote database in this manner, multiple instances of products can boot
up and run against the same registry configurations.
When there is a large user base, it is recommended to plug a user store. WSO2
products support the use of LDAP, Active directory and JDBC use stores.
WSO2 products support JMX monitoring by default and JMX monitoring helps you
keep track of memory and CPU usages , Threads etc.
Best Practices and Recommendations
● WSO2 product specific tuning
● Secure plain text passwords with 'Secure Vault'
● Firewalls
● Use of proxy servers
● Ensure high availability
● Data backup and archiving
● Feature management
● Log rotation
● Log off idle users
● Anomalous activity detection software
You can use secure vault implementation of WSO2 products to encrypt plaintext
passwords included in configuration files.
You can also enable firewalls and block the ports which are not used by server
instances within the deployment.
Compatible features can be installed on WSO2 products using the WSO2 Carbon
Feature Manager when required. For example, WSO2 Identity server can be used as
a Key Management Server by installing the Key Manager features.
Idle users impose security threats. Therefore idle timeouts can be specified to log off
Use programs like logcheck to detect security violations and anomalous activities and
notify periodically.
THANK YOU
wso2.com