Setting up security and user access

If you want to customize your development server, you can configure the Secure Sockets Layer (SSL) communication, a user registry, and authorization roles.

About this task

Communications with a cisDev server are secured with the SSL protocol. To configure secure communications, you specify an SSL configuration in the server.xml file. The default configuration provides the SSL feature and a keystore <keyStore id="defaultKeyStore" password="${ia.test.password}"/>. A key.jks file is generated in the resources/security folder when you start the server for the first time. You can import other public certificates into the keystore file. For more information, see Enabling SSL communication for the Liberty profile.

You can also configure the server to authorize named users by using a basic or LDAP user registry and security roles. The following steps show you how to add a user registry and configure role mapping in the server.xml file. A server.xml file is in each server home directory <WLP_USER_DIR>/servers/server_name.

Procedure

  1. Open the server.xml file.
  2. Add a user registry configuration.

    The following example shows a basic user registry with two groups. The iaTester group and the Administrator group contain a user who is named tester.

    <basicRegistry id="basic" realm="SimpleRealm">
       <group name="iaTester">
          <member name="tester"/>
       </group>
       <group name="Administrator">
          <member name="tester"/>
       </group>
    </basicRegistry>

    If you use a basic registry, the quickStartSecurity element in the server configuration is ignored. For more information, see Getting started with security in the Liberty profile.

    Important: You must define an administrator-role in the Liberty profile when you use basicRegistry. The following example configures the administrator-role with the tester user.
    <administrator-role>
       <user>tester</user>
    </administrator-role>
    You can also define a specific user or multiple users in a user group.
    <user name="tester" password="tester"/>
    <user name="Joe" password="abc"/>
    <user name="Kate" password="xyz"/>
    <group name="iaTester">
       <member name="tester"/>
       <member name="Joe"/>
       <member name="Kate"/>
    </group/>

    The iaTester group includes the users tester, Joe, and Kate.

    For information on LDAP user registries, see Configuring LDAP user registries with the Liberty profile.

  3. Add the authorization for your users and roles.

    By default, the iaRESTWriter, iaRESTReader, and iaSolutionDeveloper roles are configured.

    <authorization-roles id="iaAuthorization">
       <security-role name="iaRESTWriter">
          <special-subject type="EVERYONE"/>
       </security-role>
       <security-role name="iaRESTReader">
          <special-subject type="EVERYONE"/>
       </security-role>
       <security-role name="iaHTTPGatewaySubmitter">
          <special-subject type="EVERYONE"/>
       </security-role>
       <security-role name="iaSolutionDeveloper">
          <special-subject type="EVERYONE"/>
       </security-role>
    </authorization-roles>

    The iaSolutionDeveloper role is used to authorize access to Insight Inspector and debugging services. If you want to give specific users authorization to Insight Inspector, add a user group to the iaSolutionDeveloper security role.

    In the following example, the iaTester group is configured with the iaSolutionDeveloper security role.

    <security-role name="iaSolutionDeveloper">
       <group name="iaTester"/>
    </security-role>
  4. Start the server to test that the server is updated.

    For example, to start a server that is named cisDev01 on Windows enter the following command from <InstallDir>\runtime\wlp\bin:

    server start cisDev01

    For example, to start a server that is named cisDev01 on Linux enter the following command from <InstallDir>/runtime/wlp/bin:

    ./server start cisDev01