Optional: Setting up data grid security
Data grid security ensures that all servers in a topology have the right credentials, so a malicious server cannot join the data grid.
About this task
The xs-server.properties file, the xs-security.xml file, and the keystore are all used to configure the data grid security.
For more information, see Data grid security.
Procedure
- Create an xs-server.properties file in the server configuration
directories for the catalog and runtime servers with the following content:
securityEnabled=true secureTokenManagerType=autoSecret authenticationSecret=OurGridServersExampleSecret transportType=TCP/IP credentialAuthentication=Required - In the catalog server configuration directory, create an xs-security.xml
file with the following content.
<?xml version="1.0" encoding="UTF-8"?> <securityConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://ibm.com/ws/objectgrid/config/security ../objectGridSecurity.xsd" xmlns="http://ibm.com/ws/objectgrid/config/security"> <security securityEnabled="true"> <authenticator className="com.ibm.websphere.objectgrid.security.plugins.builtins.KeyStoreLoginAuthenticator"/> </security> </securityConfig> - Open the
<WLP_USER_DIR>/servers/runtime_server_name/server.xml
files of the runtime servers, and add a serverProps element to the
xsServer referencing the xs-server.properties file.
<xsServer catalogServer="false" catalogServiceBootstrap="${ia.bootstrapEndpoints}" listenerPort="${xs.port}" serverName="${ia.host}-${wlp.server.name}" transport="XIO" serverProps="xs-server.properties"/> - In the catalog
<WLP_USER_DIR>/servers/catalog_server_name/server.xml
files, add a serverProps element to the xsServer referencing the
xs-server.properties file and reference the
xs-security.xml file.
For example:
<xsServer catalogServer="true" listenerPort="${xs.port}" serverName="${ia.host}-${wlp.server.name}" transport="XIO" serverProps="xs-server.properties" clusterSecurityURL="file://${server.config.dir}/xs-security.xml"/> - In the <server> element in both catalog and runtime servers, add the
xsKeyStoreLoginModule defined in the xs-security.xml
file.
<library id="xslib"> <fileset dir="${wlp.install.dir}/lib" includes="com.ibm.ws.xs.server_1.1.jar"/> </library> <jaasLoginModule id="xsKeyStoreLoginModule" className="com.ibm.websphere.objectgrid.security.plugins.builtins.KeyStoreLoginModule" controlFlag="REQUIRED" libraryRef="xslib"> <options keyStoreFile="${server.config.dir}/resources/security/cis-key.jks" debug="true"/> </jaasLoginModule> <jaasLoginContextEntry id="KeyStoreLogin" name="KeyStoreLogin" loginModuleRef="xsKeyStoreLoginModule"/> - Create a <ia_gateway> configuration element inside the
<server> element in all runtime servers. In this element, define the following
three attributes.
- securityEnabled="true"
- username="<your-keystore-alias>"
- password="<your-keystore-alias-password>"
For example:<ia_gateway securityEnabled="true" username="tester" password="tester"/> - In the
<WLP_USER_DIR>/servers/connectivity_server_name/server.xml
files in all the inbound and outbound servers, add the user and password to the
<ia_connectivity> configuration element defined in the runtime servers.
- user="<your-keystore-alias>"
- password="<your-keystore-alias-password>"
For example:The password can be encoded with XOR or encrypted with AES by using the securityUtil tool, or the WDT server.xml editor.<ia_connectivity catalogServerEndpoint="${ia.bootstrapEndpoints}" user="tester" password="tester"/> - Create the keystore for both the catalog and runtime servers.
- Run the JRE keytool command to create a keystore. For example:
This keytool command creates a key with an alias and password that are both tester, which is the same user name and password that is used for quick start security.keytool -genkey -alias tester -keypass tester -keyalg RSA -dname CN=tester,O=ibm,C=us -storepass tester -keystore C:\tmp\cis-key.jks - Copy the key file into the resources/security directory of the catalog and
runtime servers.
${server.config.dir}/resources/security/cis-key.jks
- Run the JRE keytool command to create a keystore.
Previous topic: Creating and customizing outbound servers
Related concepts: