Skip to content

Commit 25bf0f5

Browse files
committed
[irods/irods#2626] Update SSL documentation
This commit makes the following changes to the SSL documentation: - Rename SSL page SSL/TLS - Removes explanation about using encryption only for data or only for passwords on TLS page - Move SSL configuration instructions out of PAM page to SSL/TLS page - Move some TLS configurations which were previously in the client configuration into the server configuration - More cleanly separated client and server TLS configuration sections The wording remains largely in tact with the exception of sections which dealt directly with the configurations which changed.
1 parent c9f5c10 commit 25bf0f5

File tree

5 files changed

+204
-235
lines changed

5 files changed

+204
-235
lines changed

docs/plugins/pluggable_authentication.md

Lines changed: 3 additions & 172 deletions
Original file line numberDiff line numberDiff line change
@@ -78,179 +78,10 @@ This will allow any username/password combination to successfully authenticate w
7878

7979
With the permissive configuration working with irodsPamAuthCheck, the next step is to adjust your PAM configuration to your desired settings (LDAP, in this case). You will know that is correct when irodsPamAuthCheck behaves as you would expect when using LDAP username/passwords. iRODS uses irodsPamAuthCheck directly, so if it is working on the command line, it should work when run by iRODS.
8080

81-
### Server SSL Setup
81+
### Setting up SSL/TLS
8282

8383
Since PAM requires the user's password in plaintext, iRODS relies on SSL encryption to protect these credentials. PAM authentication makes use of SSL regardless of the iRODS Zone SSL configuration (meaning even if iRODS explicitly does *not* encrypt data traffic, PAM will use SSL during authentication).
8484

85-
In order to use the iRODS PAM support, you also need to have SSL working between the iRODS client and server. The SSL communication between client and iRODS server needs some basic setup in order to function properly. Much of the setup concerns getting a proper X.509 certificate setup on the server side, and setting up the trust for the server certificate on the client side. You can use either a self-signed certificate (best for testing) or a certificate from a trusted CA.
86-
87-
Here are the basic steps to configure the server:
88-
89-
#### Generate a new RSA key
90-
91-
Make sure it does not have a passphrase (i.e. do not use the -des, -des3 or -idea options to genrsa):
92-
93-
~~~
94-
irods@hostname:~/ $ openssl genrsa -out server.key
95-
~~~
96-
97-
#### Acquire a certificate for the server
98-
99-
The certificate can be either from a trusted CA (internal or external), or can be self-signed (common for development and testing). To request a certificate from a CA, create your certificate signing request, and then follow the instructions given by the CA. When running the 'openssl req' command, some questions will be asked about what to put in the certificate. The locality fields do not really matter from the point of view of verification, but you probably want to try to be accurate. What is important, especially since this is a certificate for a server host, is to make sure to use the FQDN of the server as the "common name" for the certificate (should be the same name that clients use as their `irods_host`), and do not add an email address. If you are working with a CA, you can also put host aliases that users might use to access the host in the 'subjectAltName' X.509 extension field if the CA offers this capability.
100-
101-
To generate a Certificate Signing Request that can be sent to a CA, run the 'openssl req' command using the previously generated key:
102-
103-
~~~
104-
irods@hostname:~/ $ openssl req -new -key server.key -out server.csr
105-
~~~
106-
107-
To generate a self-signed certificate, also run 'openssl req', but with slightly different parameters. In the openssl command, you can put as many days as you wish:
108-
109-
~~~
110-
irods@hostname:~/ $ openssl req -new -x509 -key server.key -out server.crt -days 365
111-
~~~
112-
113-
#### Create the certificate chain file
114-
115-
If you are using a self-signed certificate, the chain file is just the same as the file with the certificate (server.crt). If you have received a certificate from a CA, this file contains all the certificates that together can be used to verify the certificate, from the host certificate through the chain of intermediate CAs to the ultimate root CA.
116-
117-
An example best illustrates how to create this file. A certificate for a host 'irods.example.org' is requested from the proper domain registrar. Three files are received from the CA: irods.crt, PositiveSSLCA2.crt and AddTrustExternalCARoot.crt. The certificates have the following 'subjects' and 'issuers':
118-
119-
~~~
120-
openssl x509 -noout -subject -issuer -in irods.crt
121-
subject= /OU=Domain Control Validated/OU=PositiveSSL/CN=irods.example.org
122-
issuer= /C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=PositiveSSL CA 2
123-
openssl x509 -noout -subject -issuer -in PositiveSSLCA2.crt
124-
subject= /C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=PositiveSSL CA 2
125-
issuer= /C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust External CA Root
126-
openssl x509 -noout -subject -issuer -in AddTrustExternalCARoot.crt
127-
subject= /C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust External CA Root
128-
issuer= /C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust External CA Root
129-
~~~
130-
131-
The irods.example.org cert was signed by the PositiveSSL CA 2, and that the PositiveSSL CA 2 cert was signed by the AddTrust External CA Root, and that the AddTrust External CA Root cert was self-signed, indicating that it is the root CA (and the end of the chain).
132-
133-
To create the chain file for irods.example.org:
134-
135-
~~~
136-
irods@hostname:~/ $ cat irods.crt PositiveSSLCA2.crt AddTrustExternalCARoot.crt > chain.pem
137-
~~~
138-
139-
#### Generate OpenSSL parameters
140-
141-
Generate some Diffie-Hellman parameters for OpenSSL:
142-
143-
~~~
144-
irods@hostname:~/ $ openssl dhparam -2 -out dhparams.pem 2048
145-
~~~
146-
147-
#### Place files within accessible area
148-
149-
Put the dhparams.pem, server.key and chain.pem files somewhere that the iRODS server can access them (e.g. in /etc/irods). Make sure that the irods unix user can read the files (although you also want to make sure that the key file is only readable by the irods user).
150-
151-
#### Set the iRODS SSL environment
152-
153-
The server expects to have the following irods service account's `irods_environment.json` properties set on startup:
154-
155-
~~~
156-
"irods_ssl_certificate_chain_file": "/etc/irods/chain.pem",
157-
"irods_ssl_certificate_key_file": "/etc/irods/server.key",
158-
"irods_ssl_dh_params_file": "/etc/irods/dhparams.pem",
159-
~~~
160-
161-
#### Restart iRODS
162-
163-
Restart the server:
164-
165-
~~~
166-
irods@hostname:~/ $ ./irodsctl restart
167-
~~~
168-
169-
### Client SSL Setup
170-
171-
The client may or may not require configuration at the SSL level, but there are a few parameters that can be set via `irods_environment.json` properties to customize the client SSL interaction if necessary. In many cases, if the server's certificate comes from a common CA, your system might already be configured to accept certificates from that CA, and you will not have to adjust the client configuration at all. For example, on an Ubuntu12 (Precise) system, the /etc/ssl/certs directory is used as a repository for system trusted certificates installed via an Ubuntu package. Many of the commercial certificate vendors such as VeriSign and AddTrust have their certificates already installed.
172-
173-
After setting up SSL on the server side, test SSL by using the PAM authentication (which requires an SSL connection) and running ``iinit`` with the log level set to LOG_NOTICE. If you see messages as follows, you need to set up trust for the server's certificate, or you need to turn off server verification.
174-
175-
Error from non-trusted self-signed certificate:
176-
177-
~~~
178-
irods@hostname:~/ $ IRODS_LOG_LEVEL=LOG_NOTICE iinit
179-
NOTICE: environment variable set, irods_log_level(input)=LOG_NOTICE, value=5
180-
NOTICE: created irods_home=/dn/home/irods
181-
NOTICE: created irods_cwd=/dn/home/irods
182-
Enter your current PAM (system) password:
183-
NOTICE: sslVerifyCallback: problem with certificate at depth: 0
184-
NOTICE: sslVerifyCallback: issuer = /C=US/ST=North Carolina/L=Chapel Hill/O=RENCI/CN=irods.example.org
185-
NOTICE: sslVerifyCallback: subject = /C=US/ST=North Carolina/L=Chapel Hill/O=RENCI/CN=irods.example.org
186-
NOTICE: sslVerifyCallback: err 18:self signed certificate
187-
ERROR: sslStart: error in SSL_connect. SSL error: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
188-
sslStart failed with error -2103000 SSL_HANDSHAKE_ERROR
189-
~~~
190-
191-
Error from untrusted CA that signed the server certificate:
192-
193-
~~~
194-
irods@hostname:~/ $ IRODS_LOG_LEVEL=LOG_NOTICE iinit
195-
NOTICE: environment variable set, irods_log_level(input)=LOG_NOTICE, value=5
196-
NOTICE: created irods_home=/dn/home/irods
197-
NOTICE: created irods_cwd=/dn/home/irods
198-
Enter your current PAM (system) password:
199-
NOTICE: sslVerifyCallback: problem with certificate at depth: 1
200-
NOTICE: sslVerifyCallback: issuer = /C=US/ST=North Carolina/O=example.org/CN=irods.example.org Certificate Authority
201-
NOTICE: sslVerifyCallback: subject = /C=US/ST=North Carolina/O=example.org/CN=irods.example.org Certificate Authority
202-
NOTICE: sslVerifyCallback: err 19:self signed certificate in certificate chain
203-
ERROR: sslStart: error in SSL_connect. SSL error: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
204-
sslStart failed with error -2103000 SSL_HANDSHAKE_ERROR
205-
~~~
206-
207-
Server verification can be turned off using the irods_ssl_verify_server `irods_environment.json` property. If this variable is set to 'none', then any certificate (or none) is accepted by the client. This means that your connection will be encrypted, but you cannot be sure to what server (i.e. there is no server authentication). For that reason, this mode is discouraged.
208-
209-
It is much better to set up trust for the server's certificate, even if it is a self-signed certificate. The easiest way is to use the irods_ssl_ca_certificate_file `irods_environment.json` property to contain all the certificates of either hosts or CAs that you trust. If you configured the server as described above, you could just set the following property in your `irods_environment.json`:
210-
211-
~~~
212-
"irods_ssl_ca_certificate_file": "/etc/irods/chain.pem"
213-
~~~
214-
215-
216-
Or this file could just contain the root CA certificate for a CA-signed server certificate. Another potential issue is that the server certificate does not contain the proper FQDN (in either the Common Name field or the subjectAltName field) to match the client's 'irods_host' property. If this situation cannot be corrected on the server side, the client can set:
217-
218-
~~~
219-
"irods_ssl_verify_server": "cert"
220-
~~~
221-
222-
Then, the client library will only require certificate validation, but will not check that the hostname of the iRODS server matches the hostname(s) embedded within the certificate.
223-
224-
### Encryption Settings
225-
226-
The following SSL encryption settings are required in `irods_environment.json` on both sides of the connection (client and server) and the values must match:
227-
228-
- `irods_encryption_algorithm` (required) - EVP-supplied encryption algorithm for parallel transfer encryption
229-
- `irods_encryption_key_size` (required) - Key size for parallel transfer encryption
230-
- `irods_encryption_num_hash_rounds` (required) - Number of hash rounds for parallel transfer encryption
231-
- `irods_encryption_salt_size` (required) - Salt size for parallel transfer encryption
232-
233-
### Environment Variables
234-
235-
All the `irods_environment.json` properties used by the SSL support (both server and client side) are listed below:
236-
237-
irods_ssl_certificate_chain_file (server)
238-
: The file containing the server's certificate chain. The certificates must be in PEM format and must be sorted starting with the subject's certificate (actual client or server certificate), followed by intermediate CA certificates if applicable, and ending at the highest level (root) CA.
239-
240-
irods_ssl_certificate_key_file (server)
241-
: Private key corresponding to the server's certificate in the certificate chain file.
242-
243-
irods_ssl_dh_params_file (server)
244-
: The Diffie-Hellman parameter file location.
245-
246-
irods_ssl_verify_server (client)
247-
: What level of server certificate based authentication to perform. 'none' means not to perform any authentication at all. 'cert' means to verify the certificate validity (i.e. that it was signed by a trusted CA). 'hostname' means to validate the certificate and to verify that the irods_host's FQDN matches either the common name or one of the subjectAltNames of the certificate. 'hostname' is the default setting.
248-
249-
irods_ssl_ca_certificate_file (client)
250-
: Location of a file of trusted CA certificates in PEM format. Note that the certificates in this file are used in conjunction with the system default trusted certificates.
251-
252-
irods_ssl_ca_certificate_path (client)
253-
: Location of a directory containing CA certificates in PEM format. The files each contain one CA certificate. The files are looked up by the CA subject name hash value, which must be available. If more than one CA certificate with the same name hash value exist, the extension must be different (e.g. 9d66eef0.0, 9d66eef0.1, etc.). The search is performed based on the ordering of the extension number, regardless of other properties of the certificates. Use the 'c_rehash' utility to create the necessary links.
254-
255-
85+
In order to use the iRODS PAM support, you also need to have SSL working between the iRODS client and server.
25686

87+
See [SSL/TLS Documentation](../../system_overview/ssl_and_tls) for instructions to set up SSL/TLS communications between iRODS clients and servers.

docs/system_overview/configuration.md

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,24 @@ This file defines the behavior of the server Agent that answers individual reque
406406
// This must be the same across all iRODS servers in a Zone.
407407
"server_port_range_end": 20199,
408408

409+
// (Optional)
410+
// Defines server-side TLS configurations. Although the "tls" object itself is optional,
411+
// all sub-properties are required if "tls" is defined.
412+
"tls": {
413+
// Absolute path to the file containing the server's certificate chain.
414+
// The certificates must be in PEM format and must be sorted starting with the subject's
415+
// certificate (actual client or server certificate), followed by intermediate CA certificates
416+
// if applicable, and ending at the highest level (root) CA.
417+
"certificate_chain_file": "",
418+
419+
// Absolute path to the file containing the private key corresponding to the server's
420+
// certificate in the certificate chain file.
421+
"certificate_key_file": "",
422+
423+
// Absolute path to the Diffie-Hellman parameter file.
424+
"dh_params_file": ""
425+
},
426+
409427
// The authentication scheme used by the zone_user: native or pam_password.
410428
"zone_auth_scheme": "native",
411429

@@ -639,21 +657,6 @@ This is the main iRODS configuration file defining the iRODS environment. Any ch
639657
// certificates. Use the ‘c_rehash’ utility to create the necessary links.
640658
"irods_ssl_ca_certificate_path": "",
641659

642-
// (Optional)
643-
// The file containing the server's certificate chain.
644-
// The certificates must be in PEM format and must be sorted starting with the subject's
645-
// certificate (actual client or server certificate), followed by intermediate CA certificates
646-
// if applicable, and ending at the highest level (root) CA.
647-
"irods_ssl_certificate_chain_file": "",
648-
649-
// (Optional)
650-
// The private key corresponding to the server's certificate in the certificate chain file.
651-
"irods_ssl_certificate_key_file": "",
652-
653-
// (Optional)
654-
// The Diffie-Hellman parameter file location.
655-
"irods_ssl_dh_params_file": "",
656-
657660
// (Optional)
658661
// The number of seconds between TCP keep-alive probes. The default value in the TCP specification is 75. For more
659662
// details, see:

docs/system_overview/ssl.md

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)