Introduction
JS7 - Deployment of Scheduling Objects makes use of signing certificates to digitally sign workflows and other objects. Use of certificates for signing is not related to use of certificates to secure connections such as HTTPS.
- Certificates for the specific use of code signing should be used.
- Users choose which approach they want to follow:
- Creating self-signed certificates.
- Creating CA-signed certificates.
Rollout of certificates to Controllers and Agents depends on the following choice:
- Self-signed certificates have to be deployed from individual certificate files made available for Controllers and Agents.
- There is no security gap in use of self-signed certificates. When users store certificate files to Controllers and Agents then this proves that they trust the certificates.
- CA-signed certificates usually are not deployed. Instead, the CA Certificate is deployed that was used to sign individual certificates.
- The approach includes that any signing certificate signed by the CA will be accepted for deployment of scheduling objects.
- For better control which certificates are made available for deplyoment, users might decide to use a specific Signing CA.
Creating self-signed Certificates
Users have an option ot use ECDSA or RSA for the encryption type.
Users can run the following commands from a bash shell and replace the value of the key_name
environment variable with a name of their choice that is used when creating related files.
Using ECDSA Encryption
# Specify key name used for file names key_name=signing # Step 1 - Generate Private Key openssl ecparam -name secp256k1 -genkey -noout -out ${key_name}.key # Step 2 - Generate and sign Certificate openssl req -new -x509 -sha256 -key ${key_name}.key -out ${key_name}.crt -days 5475
Explanation:
- Step 1: The Private Key is created.
- Choice of algorithm such as
secp256k1
is up to the user. - The
<key_name>
.key
file will hold the Private Key.
- Choice of algorithm such as
- Step 2: The Certificate is created.
- The
-days
argument optionally specifies the validity period of the Certificate. - The
<key_name>
.crt
file will hold the self-signed Certificate.
- The
Using RSA Encryption
# Specify key name used for file names key_name=signing # Generate Private Key and Certificate openssl req -x509 -sha256 -newkey rsa:4096 -nodes -keyout ${key_name}.key -out ${key_name}.crt -days 5475
Explanation:
- In the example the Private Key is created using the specified key size of
4096
. - The Certificate is created with the
-days
argument optionally specified for the validity period of the Certificate. - The
<key_name>
.key
file will hold the Private Key. - The
<key_name>
.crt
file will hold the self-signed Certificate.
Creating CA-signed Certificates
Creating the CA Certificate
Steps include to create the signing-ca.key
Private Key file and signing-ca.crt
self-signed Certificate file for the CA both in PEM format.
# Step 1: Generate Certificate Authority (CA) Private Key openssl ecparam -genkey -name secp256k1 -noout -out signing-ca.key # Step 2: Generate CA Certificate openssl req -new -x509 -sha256 -days 5475 -key signing-ca.key -out signing-ca.crt # You are about to be asked to enter information that will be incorporated # into your certificate request. # What you are about to enter is what is called a Distinguished Name or a DN. # There are quite a few fields but you can leave some blank # For some fields there will be a default value, # If you enter '.', the field will be left blank. # ----- # Country Name (2 letter code) [XX]:DE # State or Province Name (full name) []:Berlin # Locality Name (eg, city) [Default City]:Berlin # Organization Name (eg, company) [Default Company Ltd]:SOS # Organizational Unit Name (eg, section) []:JS7 # Common Name (eg, your name or your server's hostname) []:JS7 Deployment CA # Email Address []:
# Step 1: Generate Signing Certificate Authority (CA) Private Key using passphrase openssl ecparam -genkey -name secp256k1 | openssl ec -aes256 -passout pass:"jobscheduler" -out signing-ca.key # Step 2: Generate Signing CA Certificate openssl req -new -x509 -sha256 -days 5475 -key signing-ca.key -passin pass:"jobscheduler" -out signing-ca.crt
Explanation:
- Step 1: The Private Key is created.
- Choice of algorithm such as
secp256k1
is up to the user. - The
signing-ca.key
file will hold the Private Key.
- Choice of algorithm such as
- Step 2: The CA Certificate is created
- As a response to the command the OpenSSL utility prompts for a number of specifications for the Distinguished Name, i.e. the unique name of the CA Certificate:
Country Name
: a 2 letter country code is expected as stated for example with https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2State or Province Name
: the name of a state is expectedLocality Name
: the name of a city is expectedOrganization Name
: arbitrary input is allowedOrganizational Unit Name
: arbitrary input is allowedCommon Name
: an arbitrary name can be chosen as the name of the CAEmail Address
: empty input is allowed
- The
signing-ca.crt
file will hold the Signing Certificate..
- As a response to the command the OpenSSL utility prompts for a number of specifications for the Distinguished Name, i.e. the unique name of the CA Certificate:
Creating a Signing Certificate
For a Signing Certificate the steps include to create the Private Key and Certificate Signing Request (CSR). The resulting Signing Certificate will be signed by the CA.
Users can run the following commands from a bash shell and replace the value of the key_name
environment variable with a name of their choice that is used when creating related files:
# Specify key name used for file names key_name=signing # Step 1 - Generate Private Key and Certificate Signing Request openssl req -new -sha256 -config <(cat openssl-cert.config <(printf "\n[SAN]\nnsCertType = objsign\nkeyUsage = critical, nonRepudiation, digitalSignature, keyEncipherment\n\nextendedKeyUsage = critical, codeSigning\n\nsubjectKeyIdentifier = hash\n")) \ -nodes -keyout ${key_name}.key -out ${key_name}.csr # Step 2 - Generate and sign the Signing Certificate openssl x509 -req \ -in ${key_name}.csr \ -CA signing-ca.crt \ -CAkey signing-ca.key \ -CAcreateserial \ -out ${key_name}.crt -days 7300 \ -extfile <(printf 'nsCertType = objsign\nkeyUsage = critical, nonRepudiation, digitalSignature, keyEncipherment\n\n\nextendedKeyUsage = critical, codeSigning\n\nsubjectKeyIdentifier = hash\n' "${key_name}")
Explanation:
- Step 1: Create Private Key and Certificate Signing Request
- The Certificate Signing Request is created for the Key Usage and Extended Key Usage as indicated.
- The following files will be created:
<key_name>
.key
: the Private Key<key_name>
.csr
: the Certificate Signing Request
- Step 2: The Signing Certificate is created.
- The following files will be created:
<key_name>
.crt
: the Signing Certificate
- The following files will be created:
In order to run the script successfully the following openssl-cert.config
file has to be present. To create a Signing Certificate the CommonName
attribute has to be adjusted.
- Download: openssl-cert.config
- Replace the value of the
commonName
attribute with the name of an account or user for which the certificate should be created. - Adjust other attributes in the
[ standard_dn ]
section to your needs.
[ req ] prompt = no distinguished_name = standard dn [ standard dn ] countryName = DE stateOrProvinceName = Berlin localityName = Berlin organizationName = SOS organizationalUnitName = IT commonName = signing [ standard exts ] keyUsage = critical, nonRepudiation, digitalSignature # see x509v3_config for other extensions