Setting up certificate-based authentication

To secure Insight Monitor from unauthorized users, you can use certificate authentication.

About this task

Make sure that the admin user is the owner of the certificate that is in the truststore of the runtime servers.

Procedure

  1. In the server.xml file of all the servers in your topology, create a keystore to set up security certification. For more information, see Setting up security certification and user access.
  2. Configure the servers truststores:
    1. On each server that has the admin feature, export a certificate from the keystore to a file. The following keytool command exports a certificate from the keystore key.jks to a file named certfile.cer.

      keytool -exportcert -alias <default> -file certfile.cer -keystore key.jks

      Enter the keystore password when prompted.

    2. On each server that has the monitor feature, import the certificate to a truststore file. For example, to import the certificate file that is named certfile.cer in a truststore named trust.jks, enter the following command:

      keytool -importcert -file certfile.cer -keystore trust.jks

      Enter the password when prompted and enter yes to trust the certificate.

      Note: The password is for the new file trust.jks. It is different from the password that is used for the private key keystore.
    3. Export a certificate from each truststore trust.jks to a file. The following keytool command exports a certificate from the truststore trust.jks to a file named certfile2.cer:

      keytool -exportcert -alias <default> -file certfile2.cer -truststore trust.jks

      Enter the keystore password when prompted.

    4. On each server that has the admin feature, import the certificate to the keystore file. For example, to import the certificate file that is named certfile2.cer in a public keystore named key.jks, enter the following command:

      keytool -importcert -file certfile2.cer -keystore key.jks

      Enter the password when prompted and enter yes to trust the certificate.

  3. In the server.xml file of every server in your topology:
    1. Add the clientAuthenticationSupported="true" attribute to the <ssl> tag. For example:
      <ssl id="defaultSSLConfig"
      clientAuthenticationSupported="true"/>
    2. Configure the keyStoreRef and trustStoreRef in the same SSL tag. For example:
      <ssl id="defaultSSLConfig"       
              clientAuthenticationSupported="true"       
              keyStoreRef="defaultKeyStore"       
              trustStoreRef="defaultTrustStore"        
              sslProtocol="TLSv1.2"/>         
              
              <keyStore id="defaultKeyStore"      
              location="${shared.resource.dir}/security/key.jks"       
              password="{xor}KzosKzot"/>         
      
              <keyStore id="defaultTrustStore"
              location="${shared.resource.dir}/security/trust.jks"        
              password="{xor}KzosKzot"/>

      The password is the XOR encoded version of the password you entered when exporting the certificates.

  4. In the server.xml file of each server that has the admin feature, set the SSL configuration. The following example shows the SSL configuration where Insight Monitor uses the authentication settings in defaultSSLConfig to communicate over a secured connection.
    <ia_admincenter http.ssl.config="defaultSSLConfig"/>
  5. In the server.xml file of each server that has the monitor feature, define an administrator role to access the keystore of the servers that have the admin feature. The following example configures the administrator role where adminuser is the name of the owner that imported the trusted certificate in the public key keystore, and adminpassword is the password that you entered.
    <basicRegistry id="basic" realm="realm">
       <user name="adminuser" password="adminpassword"/>
    </basicRegistry>
    
    <administrator-role>
       <user>adminuser</user>
    </administrator-role>
  6. Save your changes to the server.xml files.
  7. Start all of your servers, if they are not started, by running the server start command.