Introduction
- An Agent makes use of two configuration files:
- the
agent.conf
general configuration file which is found in the following locations:- Windows:
C:\ProgramData\sos-berlin.com\js7\agent\var\config\agent.conf
- Unix
/var/sos-berlin.com/js7/agent/var/config/agent.conf
- Windows:
- the
private.conf
security configuration file which is found in the following locations:- Windows:
C:\ProgramData\sos-berlin.com\js7\agent\var\config\private.conf
- Unix:
/var/sos-berlin.com/js7/agent/var/config/private/private.conf
- Windows:
- The configuration format makes use of Typesafe Config, see the JS7 - Configuration Format article.
- Restart the Agent instance to apply changes to any configuration files.
- the
- For HTTPS configuration refer to the JS7 - Configuration Templates article.
Default Configuration
General Configuration File: agent.conf
HTTP Connections
By default the Agent configuration ships with HTTP connections enabled. It is recommended that public/private keys and certificates for secure HTTPS communication are used and that HTTP connections are disabled.
# Allow http connections without authentication js7.web.server.auth.public = true
Director Agent Cluster Configuration
If a JS7 Agent cluster is used then the following configuration has to be applied for Director Agent instances:
Primary Director Agent Configuration
- A Primary Director Agent instance does not require any configuration items for cluster operation.
Secondary Director Agent Configuration
- A Secondary Director Agent instance specifies this setting to indicate that this instance starts as a standby node (Backup). When this setting is not in place, both instances of a Director Agent Cluster will start as standalone instances.
- This setting is relevant for initial operation only. It is independent of which Director Agent instance later on will be the active one and which instance will be the standby one.
- This setting has to be added by the user before starting a Secondary Director Agent instance.
js7 | journal | cluster | |||
---|---|---|---|---|---|
node | |||||
Primary | <url> | ||||
Backup | <url> | ||||
is-backup | <yes>|<no> |
- This setting is used for Director Agent instances in cluster mode only, it is not used for standalone Director Agent instances.
- The registration of Primary and Secondary Director Agent instances is performed by the JOC Cockpit during initial operation.
- Therefore the only setting required for cluster operation is:
js7.journal.cluster.node.is-backup=yes
: For a Secondary Director Agent instance this setting specifies that during initial operation the given instance will be the inactive standby node.
- Additional settings can be applied. However, we recommend that the JOC Cockpit is used instead.
nodes
Primary, Backup
: For a Primary Director Agent instance this setting specifies the URLs of thePrimary
andBackup
(Secondary) instance. The URL includes specification of the http/https protocol, the hostname and port.
- Therefore the only setting required for cluster operation is:
Security Configuration File: private.conf
Directory for Trusted Certificates used to verify Signed Workflow Signatures
The Agent requires X.509 certificates and/or PGP public keys to be in place. These are used to verify the signatures of signed workflows. Unsigned workflows are not accepted by an Agent and therefore a minimum of one X.509 certificate file or PGP public key file has to be present in the directories which are specified in the following configuration item:
# Security configuration js7 { configuration { # Locations of certificates and public keys used for signature verification trusted-signature-keys { PGP=${js7.config-directory}"/private/trusted-pgp-keys" X509=${js7.config-directory}"/private/trusted-x509-keys" } }
Explanation:
- The Agent verifies the signature of deployable objects such as workflows. This can be performed for PGP and X.509 signatures.
- The
trusted-signature-keys
setting specifies the location of PGP public keys and X.509 certificates. - If no PGP public keys are used or if no X.509 certificates are used then this setting should not be used as it expects the indicated directory to be populated with public keys or certificates respectively.
Script Execution from Signed Workflows
The default Agent configuration allows job scripts which include shell commands to be executed from any location. Without this setting scripts are restricted to being executed from the Agent's config/executables
directory only.
# Allow jobs from signed workflows to execute shell commands js7.job.execution.signed-script-injection-allowed = yes
Secure Configuration
It is essential that the connections between Controller and Agents are secured. This includes:
- using HTTPS connections which are secured by private keys and certificates,
- applying mutual authentication between Controller and Agent,
- applying mutual authentication between Director Agent and Subagent in an Agent Cluster.
- applying password authentication between components should mutual authentication not be in place.
Client Authentication with Controller
Controller Connections
js7 { auth { # User accounts for https connections users { # Controller ID for connections by primary/secondary Controller instance Controller { distinguished-names=[ "DNQ=SOS CA, CN=controller-2-0-primary, OU=IT, O=SOS, L=Berlin, ST=Berlin, C=DE", "DNQ=SOS CA, CN=controller-2-0-secondary, OU=IT, O=SOS, L=Berlin, ST=Berlin, C=DE" ] } } } }
Explanation:
- This setting applies to the use of an Agent with a Standalone Controller or with a Controller Cluster.
- Note that the
Controller
element name is an example that has to be replaced by the Controller ID which is specified with the same value during installation of both cluster Controller instances. - This setting specifies the distinguished name indicated with the Controller instance's Client Authentication certificate. The certificate acts as a replacement for a password.
- The Agent configuration specifies the distinguished names of the Controller instances that access the Agent by use of a Client Authentication certificate.
- Note that the common name (CN) setting in the distinguished name has to match the fully qualified domain name (FQDN) of a Controller instance's host.
Client Authentication with Director Agent
Director Agent Connections
js7 { auth { # User accounts for https connections users { # Agent Cluster ID for connections by primary/secondary Director Agent instance agent-cluster { distinguished-names=[ "DNQ=SOS CA, CN=director-2-0-primary, OU=IT, O=SOS, L=Berlin, ST=Berlin, C=DE", "DNQ=SOS CA, CN=director-2-0-secondary, OU=IT, O=SOS, L=Berlin, ST=Berlin, C=DE" ] } } } }
Explanation:
- This setting applies to the use of a Subagent with a Director Agent in an JS7 - Agent Cluster.
- Similar to a Controller that orchestrates Standalone Agents the Director Agent orchestrates Subagents.
- Subagents do not know of a Controller, they know of a Director Agent.
- Note that the
agent-cluster
element name is an example that has to be replaced by the Agent Cluster ID which is specified with the same value during installation of the Agent Cluster. This is not the Primary/Secondary Directory Agent ID. - This setting specifies the distinguished names indicated with the Director Agent instance's Client Authentication certificates. The certificate acts as a replacement for a password.
- The Agent configuration specifies the distinguished names of any Director Agent instances that access the current Director Agent instance or Subagent instance by use of a Client Authentication certificate.
- Note that the common name (CN) setting in the distinguished name has to match the fully qualified domain name (FQDN) of a Director Agent instance's host.
Password Authentication with Controller
Controller Connections
js7 { auth { # User accounts for https connections users { # Controller ID for connections by primary/secondary Controller instance Controller { password="plain:secret" } } } }
Explanation:
- This setting applies to the use of an Agent with a Standalone Controller or with a Controller Cluster.
- Note that the
Controller
element name is an example that has to be replaced by the Controller ID which is specified with the same value during installation of both cluster Controller instances. - This setting specifies the password indicated with the Controller instance's
js7.auth.agents
configuration item.- The password can be specified as plain text preceded by
plain:
. - The password can be specified as a hashed value preceded by
sha512:
.
- The password can be specified as plain text preceded by
Password Authentication with Director Agent
Director Agent Connections
js7 { auth { # User accounts for https connections users { # Agent Cluster ID for connections by primary/secondary Director Agent instance agent-cluster { password="plain:secret" } } } }
Explanation:
- This setting applies to the use of a Subagent with a Director Agent in an JS7 - Agent Cluster.
- Note that the
Director
element name is an example that has to be replaced by the Director Agent ID which is specified with the same value during installation of the Primary and Secondary Director Agent instances. - This setting specifies the distinguished name indicated with the Director Agent's Client Authentication certificate. The certificate acts as a replacement for a password.
- This setting specifies the password indicated with the Director Agent instance's
js7.auth.subagents
configuration item.- The password can be specified as plain text preceded by
plain:
. - The password can be specified as a hashed value preceded by
sha512:
.
- The password can be specified as plain text preceded by
Server Authentication
HTTPS Keystore and Truststore Locations
js7 { web { # keystore and truststore location for https connections https { client-keystore { # Default: ${js7.config-directory}"/private/https-client-keystore.p12" file=${js7.config-directory}"/private/https-client-keystore.p12" key-password="jobscheduler" store-password="jobscheduler" } keystore { # Default: ${js7.config-directory}"/private/https-keystore.p12" file=${js7.config-directory}"/private/https-keystore.p12" key-password="jobscheduler" store-password="jobscheduler" # alias= } truststores=[ { # Default: ${js7.config-directory}"/private/https-truststore.p12" file=${js7.config-directory}"/private/https-truststore.p12" store-password="jobscheduler" # alias= } ] } } }
Explanation:
- HTTPS keystore and truststore are used to hold private keys and certificates.
- The keystore holds the Agent's private key and certificate. This information is used:
- for Server Authentication with JOC Cockpit and
- for Client Authentication with Agents.
- The truststore holds the certificate(s) used to verify:
- Client Authentication certificates presented by a Controller and
- Server Authentication certificates challenged by pairing Controllers.
- The keystore holds the Agent's private key and certificate. This information is used:
- Optionally a separate HTTPS client keystore can be used:
- The client keystore is used for HTTPS mutual authentication and holds a private key and certificate created for
Client Auth
extended key usage. - When using HTTPS mutual authentication then:
- a single certificate can be used that is generated for both
Server Auth
andClient Auth
extended key use. In this case do not use the HTTPS client keystore but use the HTTPS keystore to hold the certificate. - separate certificates can be used with the certificate for
Server Auth
key usage being stored with the HTTPS keystore and the certificate forClient Auth
key use being stored with the HTTPS client keystore.
- a single certificate can be used that is generated for both
- For details see - JS-1959Getting issue details... STATUS
- The client keystore is used for HTTPS mutual authentication and holds a private key and certificate created for
- Keystore and Truststore locations are specified. In addition:
- a password for the private keys included in the keystore and a password for access to the keystore can be specified,
- for the truststore a password for access to the truststore can be specified.
- Passwords for keystores and truststores do not tend to improve security of the configuration: the passwords have to be specified as plain text and have to be in reach of the Agent. This mechanism is not too different from hiding the key under your doormat. In fact, limiting ownership and access permissions for keystore and truststore files to the JS7 Agent's run-time account are more important than using a password.
- The
key-password
is used for access to a private key in keystore. - The
store-password
setting is used for access to a keystore or to a truststore. - For PKCS12 (*.p12) keystores both settings have to use the same value. The settings can be omitted if no passwords are used.
- The
- The
alias
setting can be used for example with a keystore that holds a number of private keys from which the relevant private key is selected by its alias name.
Configuration Items
General Configuration File: agent.conf
js7.web.server: Authentication Settings
js7 | web | server | |||
---|---|---|---|---|---|
auth | public | <true>|<false> |
- This setting specifies public access to an Agent if incoming HTTP connections are to be used. If used with a value
true
then no authentication is applied. - Default:
false
js7.job.execution: Job Script Encoding
js7 | job | execution | |||
---|---|---|---|---|---|
encoding | <MIME-Type > |
- This setting specifies the code page to be used if Agents are operated for Windows. For details see JS7 - Unicode Support.
The following code pages are automatically detected and used, they do not need the above setting:
The Agent detects and makes use of the code page used by the Windows OS
- for code pages from the above list,
- for code pages that are prefixed with
cp#
orCP#
with # being the number of the code page.
- Users can enforce use of a supported code page by adding a setting to the Agent's
JS7_AGENT_CONFIG_DIR/agent.conf
configuration file such as:js7.job.execution.encoding = "UTF-8"
- This setting specifies the MIME type not the numeric code page identifier, for example
UTF-8
instead of65001
. - Default: the default code page of the Windows operating system is used, for example, 932 for Japan, 850 for Western Europe.
Security Configuration File: private.conf
js7.job.execution: Job Script Execution Permissions
js7 | job | execution | ||
---|---|---|---|---|
signed-script-injection-allowed | <yes>|<no> |
- By default the Agent prevents any commands and scripts from being executed except for scripts located in specific directories. This setting allows any commands and scripts to be executed that the workflow has signed and where the signature has been verified.
js7.job.execution: Job Script Termination
js7 | job | execution | Default | |
---|---|---|---|---|
kill-with-sigterm-command | "/bin/kill", "$pid" | |||
kill-with-sigkill-command | "/bin/kill", "-KILL", "$pid" |
- The Agent can be instructed to terminate running jobs - see the JS7 - FAQ - Does JS7 reliably kill running jobs article.
- The following settings are in place to terminate running jobs by an Agent operated for a Unix OS:
- The setting
kill-with-sigterm-command
specifies the OS command executed by the Agent to forward a SIGTERM signal to the running job. - The setting
kill-with-sigkill-command
specifies the OS command executed by the Agent to forward a SIGKILL signal to the running job.
- The setting
- Both settings are specified as an array of arguments, i.e.
"/bin/kill", "-KILL", "$pid"
translates to the command:/bin/kill -KILL 99,
provided that99
is the Process ID of the running job. - This setting can be applied if the Agent is operated on an OS that makes use of a different syntax for the
kill
command.
js7.configuration: Trusted Signature Keys
js7 | configuration | |||
---|---|---|---|---|
trusted-signature-keys | ||||
PGP | <directory> | |||
X509 | <directory> |
- The Agent expects a signature for any deployed objects such as workflows. Such signatures are created with a private key and are verified by the Agent according to the available certificates.
- When deploying objects with JOC Cockpit:
- for a Low Security Level JOC Cockpit creates the signature from a single private key that is used for any JOC Cockpit user accounts allowed to deploy objects.
- for a Medium Security Level JOC Cockpit creates the signature from the private key of the JOC Cockpit user account that deploys objects.
- for a High Security Level the user creates the signature outside of JOC Cockpit and uploads the signed objects.
- The Agent supports PGP public keys and X.509 certificates. This setting expects a directory that holds a number of public key files or certificate files.
trusted-signature-keys
PGP
: specifies the directory from which PGP public keys are used to verify the signature of deployed objects.X509
: specifies the directory from which X.509 certificates are used to verify the signature of deployed objects.
js7.auth.users: HTTPS Authentication and Authorization
js7 | auth | users | |||
---|---|---|---|---|---|
Controller | |||||
distinguished-names | <distinguished-name>[,<distinguished-name] |
- An additional authentication mechanism is applied when using HTTPS certificates or public keys for incoming connections, see below: the client of the incoming connection, i.e. a Controller, is required to provide a Client Authentication Certificate. This includes two certificates that are in place for a secure HTTPS connection: the Agent's Server Authentication Certificate and the Controller's Client Authentication Certificate.
- The fact that a given certificate is to be used for Server Authentication and/or Client Authentication is specified with the key usage when the certificate is being created and signed.
- The distinguished name that is specified with the Agent's configuration has to match the Client Authentication Certificate's subject attribute of the Controller. This attribute specifies the hostname and additional information that is created when the certificate or public key is generated.
Controller
- Settings in this section are used for incoming HTTPS connections from Controller instances.
distinguished-names
:- Specifies the distinguished name as given with the subject of the Client Authentication Certificate for incoming HTTPS connections from a Controller.
- Any number of distinguished names can be specified allowing a number of incoming HTTPS connections from different Controllers.
js7.web.https: HTTPS Certificates
js7 | web | https | |||
---|---|---|---|---|---|
keystore | |||||
file | <path> | ||||
key-password | <text> | ||||
store-password | <text> | ||||
alias | <text> | ||||
client-keystore | |||||
file | <path> | ||||
key-password | <text> | ||||
store-password | <text> | ||||
alias | <text> | ||||
truststores | |||||
file | <path> | ||||
store-password | <text> | ||||
alias | <text> |
- This setting is used to specify the location of a keystore and any truststores used for HTTPS connections.
- Keystore and truststore files are expected in PKCS#12 format.
keystore
- The keystore includes the private key for the Agent's incoming HTTPS connections.
- Private key types RSA and ECDSA are supported.
file
: the full path to the location of the keystore file is expected.- Default:
${js7.config-directory}"/private/https-keystore.p12"
- Default:
key-password
: Any keys included with the keystore are protected with a password. The same password has to be used for all private keys in the given keystore.store-password
: The keystore file is protected by a password.alias
: can be used for example with a keystore that holds a number of private keys from which the relevant private key is selected by its alias name.
client-keystore
- Use of this setting is optional. It can be used if separate certificates for Server Authentication and Client Authentication are used.
- The Client Authentication private key and certificate can be added to this keystore.
- Included configuration items correspond to the
keystore
setting.
truststores
- A truststore contains the certificates or public keys for the Agent's incoming HTTPS connections.
- Certificates are signed by a Certificate Authority (CA) - alternatively a self-signed certificate can be used.
- It is recommended that certificates are used instead of public keys.
- Certificates of type X.509 are supported.
file
: the full path to the location of the truststore file is expected.- Default:
${js7.config-directory}"/private/https-truststore.p12"
- Default:
store-password
: A truststore file is protected by a password.alias
: can be used for example with a truststore that holds a number of certificates from which the relevant certificate is selected by its alias name.- A number of truststores can be specified by repeating the
file
andstore-password
settings.
- A truststore contains the certificates or public keys for the Agent's incoming HTTPS connections.
js7.web.server: HTTPS Authentication
js7 | web | server | |||
---|---|---|---|---|---|
auth | |||||
https-client-authentication | <on|off> |
- This setting is used to specify the authentication type for HTTPS connections to an Agent.
https-client-authentication
- The value
on
(default) specifies that mutual authentication with certificates for Server Authentication and Client Authentication is used. - The value
off
specifies that only HTTP Basic Authentication is used.
- The value
- By default JS7 makes use of mutual authentication including both Server and Client Authentication Certificates. This setting can be switched off to use Server Authentication Certificates only.