Git Product home page Git Product logo

Comments (3)

dhoard avatar dhoard commented on September 26, 2024

@sumitbaurai There are two usage scenarios:

Java agent

We could add the properties to the exporter YAML for use when loading the SSL configuration for HTTPS.

This could cause configuration confusion since the application's SSL properties may still require the system properties, negating the value of having the SSL configuration for HTTPS in the exporter YAML.

The Java agent is recommended.

Standalone HTTP Server

Java RMI (used by JMX) doesn't provide the necessary configuration hooks to allow non-system properties for RMI SSL configuration.

Here is a great blog on the issue: https://blogger.ziesemer.com/2010/02/jmx-avoid-java-system-properties-rmi.html

TL;DR - it requires custom code in both the Standalone HTTP server and custom code in the application (possibly implemented as a Java agent, simply to bypass using system properties.)

The standalone HTTP server is not recommended.

from jmx_exporter.

sumitbaurai avatar sumitbaurai commented on September 26, 2024

Hi Doug,

Is it not the case that the same keystore , truststore can be used for both

  • Setting up ssl connection with jmx
  • exposing an https url

Isn't something similar to what jmx offers possible.

  excerpt from the jmx configuration
      com.sun.management.jmxremote.ssl.config.file=filepath
      Specifies the location of the SSL configuration file. A properties
      file can be used to supply the keystore and truststore location and
      password settings thus avoiding to pass them as cleartext in the
      command-line.

      The current implementation of the out-of-the-box management agent will
      look up and use the properties specified below to configure the SSL
      keystore and truststore, if present:
          javax.net.ssl.keyStore=<keystore-location>
          javax.net.ssl.keyStorePassword=<keystore-password>
         javax.net.ssl.trustStore=<truststore-location>
         javax.net.ssl.trustStorePassword=<truststore-password>

from jmx_exporter.

dhoard avatar dhoard commented on September 26, 2024

@sumitbaurai not sure that will help.

Conceptually... the standalone HTTP server exporter...

  1. would have to create a new/custom RMI registry with a custom SslServerSocketFactory on a non-standard port using a custom SSLContext using custom configuration to load the SSL keystore/truststore files/passwords.

  2. use the custom SslServerSocketFactory in the JmxScraper code when initiating the connection to the application.

  3. the application would then use the custom SslServerSocketFactory (really just the configuration since the actual class isn't serialized) to connect back to the new/custom RMI registry on the non-standard port.

  4. the new/custom RMI registry would use the custom SSLContext to create the SslServerSocketFactory to accept the connection.

This all assumes that you can bind a Remote in the local RMI registry to the custom RMI registry (I have no idea if a Remote can be bound to two registries or if it can be moved.)

(I'm sure I'm missing something/left out some things.)

The complexities, code changes, integration tests, etc. to support all of this (if it would even work) for the standalone HTTP server exporter (which is not the recommended deployment scenario) simply to prevent a clear-text password doesn't feel like a worthwhile effort.

from jmx_exporter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.