Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Flowchart
Controller[label="   Controller   \nStandalone / Cluster",fillcolor="lightskyblue"]
Agent_A [label="   Agent 1   ",fillcolor="lightskyblue"]
Agent_B [label="   Agent 2   ",fillcolor="lightskyblue"]
 
Controller_Truststore [label="Controller Truststore\nhttps-truststore.p12\n\nCA certificates",fillcolor="orange"]
Agent_AController_Keystore [label="Agent 1Controller Keystore\nhttps-keystore.p12\n\nCA certificates\nPrivate Key / Certificate",fillcolor="orangelimegreen"]

Agent_BA_KeystoreTruststore [label="Agent 2 KeystoreTruststore\nhttps-keystoretruststore.p12\n\nCA Certificates\certificates",fillcolor="limegreen"]
Agent_A_Keystore [label="Agent Keystore\nhttps-keystore.p12\n\nCA certificates\nPrivate Key / Certificate",fillcolor="orange"]

CAController_Truststore_RootCertificate [shape="ellipse",shape="ellipse",label="CA Root\nCertificate",fillcolor="white"]

AgentController_AKeystore_RootCertificate [shape="ellipse",shape="ellipse",label="CA Root\nCertificate",fillcolor="white"]
AgentController_AKeystore_IntermediateCertificate [shape="ellipse",label="CA Intermediate\nCertificate",fillcolor="white"]
AgentController_BKeystore_RootCertificatePrivateKey [shape="ellipse",shape="ellipse",label="CAClient RootAuthenciation\nCertificatenPrivate Key",fillcolor="white"]
AgentController_BKeystore_IntermediateCertificateCertificate [shape="ellipse",label="CAClient IntermediateAuthentication\nCertificate",fillcolor="white"]

Agent_A_Truststore_PrivateKeyRootCertificate [shape="ellipse",shape="ellipse",label="ServerCA AuthenciationRoot\nPrivate KeynCertificate",fillcolor="white"]
Agent_A_Keystore_CertificateRootCertificate [shape="ellipse",shape="ellipse",label="ServerCA AuthenticationRoot\nCertificate",fillcolor="white"]
Agent_A_BKeystore_PrivateKeyIntermediateCertificate [shape="ellipse",label="ServerCA AuthenticationIntermediate\nPrivate KeynCertificate",fillcolor="white"]

Agent_B_KeystoreA_PrivateKey [shape="ellipse",label="Server Authenciation\nPrivate Key",fillcolor="white"]
Agent_A_Keystore_Certificate [shape="ellipse",label="Server Authentication\nCertificate",fillcolor="white"]

Agent_A -> Agent_A_Keystore 
Agent_A_Keystore -> Agent_A_PrivateKey -> Agent_A_Keystore_Certificate [label=" add to keystore "]
Agent_A_Keystore -> Agent_A_Keystore_RootCertificate -> Agent_A_Keystore_IntermediateCertificate [label=" add add to keystore keystore "]

ControllerAgent_A -> Agent_A [label_Truststore
Agent_A_Truststore -> Agent_A_Truststore_RootCertificate [label=" establishadd to connectiontruststore "]

Controller -> Agent_BA [label=" establish connection "]
Controller -> Controller_Truststore
Controller_Truststore -> CAController_Truststore_RootCertificate [label=" add to truststore "]

Agent_BController -> AgentController_B_Keystore 
Agent_BController_Keystore -> AgentController_BKeystore_PrivateKeyRootCertificate -> Agent_BController_Keystore_CertificateIntermediateCertificate [label=" add to keystore "]
Agent_BController_Keystore -> AgentController_BKeystore_RootCertificatePrivateKey -> AgentController_BKeystore_IntermediateCertificateCertificate [label=" add to keystore "]


Explanation:

  • Keystore and truststore in orange color are required for any connections of a Controller to an Agent.
    • The Agent's private key and certificate for Server Authentication are added to the Agent's keystore. In case of a self-signed certificate the certificate is added to the

...

    • Controller truststore too.
    • This step can be skipped if a CA-signed certificate is used as the Root

...

    • Certificate in

...

    • the Controller truststore is sufficient to verify

...

    • Agent certificates.

Secure Connection Setup

...

  • Keystore and truststore in green color are required if mutual authentication is in place for certificate based client authentication (default).

Secure Connection Setup

In the following the placeholders SCHEDULERplaceholder JS7_CONTROLLER_CONFIG_DIR specifies the configuration directory of the Controller. The placeholders JS7_AGENT_HOME, SCHEDULER_DATA JS7_AGENT_CONFIG_DIR specify the directories where JobScheduler Master the Agent is installed and configured on the JobScheduler Master's server. The placeholders AGENT_HOME, AGENT_DATA specify the directories where JobScheduler Agent is installed and configured on the JobScheduler Agent's server..

  • JS7_CONTROLLER_CONFIG_HOMEDIR is the installation path Controller's configuration directory that is specified during Controller installation:
    • /optvar/sos-berlin.com/js7/controller/config (default on Linux)
    • C:\Program FilesProgramData\sos-berlin.com\js7\controller \config (default on Windows)
  • JS7_CONTROLLERAGENT_CONFIG_DIR HOME is the Controller's configuration directory that installation path that is specified during Controller the JobScheduler Agent installation:
    • /varopt/sos-berlin.com/js7/controller/config agent (default on Linux)
    • C:\ProgramDataProgram Files\sos-berlin.com\js7\controller\configagent (default on Windows)
  • JS7_AGENT_CONFIG_HOME is the installation path DIR is the Agent's configuration directory that is specified during the JobScheduler Agent installation:
    • /optvar/sos-berlin.com/js7/agent/agent config (default on Linux)
    • C:\Program FilesProgramData\sos-berlin.com\js7\agent\config (default on Windows)
  • JS7_AGENT_CONFIG_DIR is the Agent's configuration directory that is specified during Agent installation:
    • /var/sos-berlin.com/js7/agent/config (default on Linux)
    • C:\ProgramData\sos-berlin.com\js7\agent\config (default on Windows)

Set up a Secure Connection to the Agent

Step 1: Create the

...

Agent Keystore

  • On the JobScheduler Agent server create the keystore using the keytool from your Java JRE or JKD. Alternatively import a certificate that your you received from your certificate authority:
    • Generate the keystore with the private key and public certificate for the Agent and export the certificate to a second Keystore keystore that is later on used by the Master or use the attached script keygen.sh to perform this task. The below examples suggest one possible approach for certificate management, however, there may be other ways how to achieve similar results.
      • Example for use of selfCA-signed certificate:

        Code Block
        languagebash
        titleExample for use of self-CA signed certificate: generate export Agent private key and export Agent public certificate
        # should generateyour Agent private key withand aliascertificate name "agent-https" in aby provided with a .jks keystore (private-httpskeypair.p12jks)
        # then temporarily useconvert the fullykeystore qualifiedto hostnamepkcs12 (FQDNkeystore.p12)
        # and name offor your organization forlater use with openssl, assuming the distinguishedalias name
        keytool -genkey -alias of the Agent private key is "agent-https"
        # keytool -dname "CN=hostname,O=organization" -validity 1461 -keyalg RSA -keysize 2048 -keypass jobscheduler -keystore "AGENT_DATA/config/private/private-https.p12" -storepass jobscheduler -storetype PKCS12
        
        # exportimportkeystore -srckeystore keypair.jks -destkeystore keystore.p12 -deststoretype PKCS12 -srcalias agent-https
        
        # assuming your Agent private key from a pkcs12 keystore (keystore.p12), store the Agent publicprivate certificatekey to a .key file in PEM format (agent-https.crtkey)
        keytoolopenssl -exportcertpkcs12 -rfcin keystore.p12 -nopromptnocerts -fileout "agent-https.crt" -alias "agent-https" -keystore "AGENT_DATA/config/private/private-https.p12" -storepass jobscheduler -storetype PKCS12
        

        Example for use of CA signed certificate

        key
        
        # concatenate CA root certificate and CA intermediate certificate to a single CA Bundle certificate file (ca-bundle.crt)
        cat RootCACertificate.crt > ca-bundle.crt
        cat CACertificate.crt >> ca-bundle.crt
        
        # Export Agent private key (agent-https.key), Agent certificate (agent-https.crt) and CA Bundle in PEM format (ca-bundle.crt) to a new keystore (https-keystore.p12)
        #   assume the fully qualified hostname (FQDN) of the Agent server to be agent.example.com
        openssl pkcs12 -export -in agent-https.crt -inkey agent-https.key -chain -CAfile ca-bundle.crt -name agent.example.com -out JS7_AGENT_CONFIG_DIR/private/https-keystore.p12
        
        # should you require use of a .jks keystore type then convert the pkcs12 keystore assuming the alias name of the Agent private key to be "agent-https"
        # keytool -importkeystore -srckeystore agent-https.p12 -srcstoretype PKCS12 -destkeystore JS7_AGENT_CONFIG_DIR/private/https-keystore.jks -deststoretype JKS -srcalias agent-https
      • Example for use of self-signed certificate:

        Code Block
        languagebash
        titleExample for use of self-signed certificate: generate Agent private key and export Agent public certificate
        # generate the Agent's private key with alias name "agent-https" in a keystore (https-keystore.p12)
        #   use the 
        Code Block
        languagebash
        titleExample for use of CA signed certificate: export Agent private key and Agent public certificate
        # should your Agent private key and certificate by provided with a .jks keystore (keypair.jks) then temporarily convert the keystore to pkcs12 (keystore.p12)
        #   for later use with openssl, assuming the alias name of the Agent private key is "agent-https"
        # keytool -importkeystore -srckeystore keypair.jks -destkeystore keystore.p12 -deststoretype PKCS12 -srcalias agent-https
        
        # assuming your Agent private key from a pkcs12 keystore (keystore.p12), store the Agent private key to a .key file in PEM format (agent-https.key)
        openssl pkcs12 -in keystore.p12 -nocerts -out agent-https.key
        
        # concatenate CA root certificate and CA intermediate certificate to a single CA Bundle certificate file (ca-bundle.crt)
        cat RootCACertificate.crt > ca-bundle.crt
        cat CACertificate.crt >> ca-bundle.crt
        
        # Export Agent private key (agent-https.key), Agent public certificate in PEM format (agent-https.crt) and CA Bundle in PEM format (ca-bundle.crt) to a new keystore (agent-https.p12)
        #   assume the fully qualified hostname (FQDN) and name of theyour Agentorganization serverfor tothe be agent.example.com
        openssl pkcs12 -export -in agent-https.crt -inkey agent-https.key -chain -CAfile ca-bundle.crt -name agent.example.com -out agent-https.p12
        
        # should you require use of a .jks keystore type then convert the pkcs12 keystore assuming the alias name of the Agent private key to be "agent-https"
        # keytool -importkeystore -srckeystore agent-https.p12 -srcstoretype PKCS12 -destkeystore agent-https.jks -deststoretype JKS -srcalias agent-https
    • If not otherwise configured then JobScheduler Agent and Master by default use the password jobscheduler for the respective Keystore.
      • distinguished name
        keytool -genkey -alias "agent-https" -dname "CN=hostname,O=organization" -validity 1461 -keyalg RSA -keysize 2048 -keypass jobscheduler -keystore "JS7_AGENT_CONFIG_DIR/private/https-keystore.p12" -storepass jobscheduler -storetype PKCS12
        
        # export the Agent's certificate to a file in PEM format (agent-https.crt)
        keytool -exportcert -rfc -noprompt -file "agent-https.crt" -alias "agent-https" -keystore "JS7_AGENT_CONFIG_DIR/private/https-keystore.p12" -storepass jobscheduler -storetype PKCS12
        
    • if you choose an individual password for the if you choose an individual password for the Agent Keystore then adjust the following properties in the <agent_data>/config/private/private.conf configuration file:
      • Explanations
        • jobscheduler.agent.webserver.https.keystore.file is used for the path to the Keystore
        • jobscheduler.agent.webserver.https.keystore.password is used for the Keystore password
        • jobscheduler.agent.webserver.https.keystore.key-password is used for the password of your private HTTPS certificate
      • Example

        Code Block
        languagetext
        titleExample for private.conf file with keystore specification
        jobscheduler.agent.webserver.https.keystore {
          file = "C:/ProgramData/sos-berlin.com/jobscheduler/agent110/config/private/private-https.jks"
          # Backslashes are written twice (as in JSON notation):
          # file = "\\\\other-computer\\share\\my-keystore.jks"
          password = "jobscheduler"
          key-password = "jobscheduler"
        }
    • For the Master the Truststore that contains the Agents' public certificate is expected with the password jobscheduler.
  • On the JobScheduler Agent server store the Keystore with the private key in the directory <agent_data>/config/private
    • Default file name: private-https.jks
  • On the JobScheduler Master server store the Truststore with the public certificate of the Agent in the directory <master_data>/config
    • Default file name: agent-https.jks
    • Display feature availability
      StartingFromRelease1.13.3
      • The location, type and password of the Master Truststore can be specified:

        Code Block
        titleExample for specification of Master Truststore with Agent public certificates
        jobscheduler.master.agents.https.keystore {
          file = "/var/sos-berlin.com/jobscheduler/apmaccs_4444/config/agent-https.p12"
          # Backslashes are written twice (as in JSON notation):
          # file = "\\\\other-computer\\share\\my-keystore.jks"
          password = "jobscheduler"
          key-password = "jobscheduler"
        }
      • Example for import of an Agent public certificate to a Master Truststore in pkcs12 format:

        Code Block
        titleExample for import of Agent public certificate to a pkcs12 Master Truststore
        # import Agent public certificate to a truststore (agent-https.p12) by specifying the Agent public certificate file (agent-https.crt) and alias name (agent-https)
        keytool -importcert -noprompt -file "agent-https.crt" -alias "agent-https" -keystore "SCHEDULER_DATA/config/agent-https.p12" -storepass jobscheduler -storetype PKCS12 -trustcacerts
    • Example for import of an Agent public certificate to a Master Truststore in jks format (specifying the default values for location, type and password):

      Code Block
      titleExample for import of Agent public certificate to a jks Master Truststore
      # import Agent public certificate to a truststore (agent-https.p12) by specifying the Agent public certificate file (agent-https.crt) and alias name (agent-https)
      keytool -importcert -noprompt -file "agent-https.crt" -alias "agent-https" -keystore "SCHEDULER_DATA/config/agent-https.jks" -storepass jobscheduler -trustcacerts

...

  • On the JobScheduler Agent server start the Agent with the corresponding parameters: 
    • Example (using port 44445 for HTTPS): <agent_data>/bin/jobscheduler_agent -https-port=44445
    • The HTTP port will always be used, even if the Agent is started for communicating over HTTPS. If no HTTP port is indicated when starting the Agent, then the default port (4445) will be used. The reason for this behavior is the requirement that the Agent can be locally controlled by its start script without further need for authentication.
    • HTTPS has to be indicated when starting an Agent by use of the parameter -https-port.
    • The Agent requires a data directory for configuration files and temporary files The data directory has to be indicated when starting the Agent by using the parameter -data-directory.
    • The above mentioned parameters can be specified as environment variables with the Agent instance script, see Installation & Operation.

Step 4: Create a Process Class assignment for Agents using HTTPS 

  • On the JobScheduler Master server create a Process Class for a job chain or a job.
    • Add the Agent URL to the process class using the HTTPS protocol.
    • Assign the process class to the job chain or job.
    • Example:

      Code Block
      languagexml
      titleExample of process class specification for use with Agents
       <?xml version="1.0" encoding="ISO-8859-1"?>
       <process_class max_processes="30" remote_scheduler="https://my_agent:44445"/>

Notes

Notes

  • A restart of the respective component is required to apply modifications to .the JS7_AGENT_CONFIG_DIR/private/private.conf file of the Agent and JS7_CONTROLLER_CONFIG_DIR/private/private.conf file of the Controller respectively
  • In order to apply modifications to ./config/private/private.conf files of the Master or the Agent a restart of the respective component is required.
  • Modifications to a Master Truststore are applied without a restart for 
    Display feature availability
    StartingFromRelease1.13.3
    , see 
    Jira
    serverSOS JIRA
    columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
    serverId6dc67751-9d67-34cd-985b-194a8cdc9602
    keyJS-1874
  • For releases before 
    Display feature availability
    StartingFromRelease1.10.7
     the problem
    Jira
    serverSOS JIRA
    columnskey,summary,type,created,updated,due,assignee,reporter,priority,status,resolution
    serverId6dc67751-9d67-34cd-985b-194a8cdc9602
    keyJS-1675
     occurs. Consider to apply the workaround as specified from the issue.

Further Resources

...