Internet Security, Certificates, SSL
- 1 Introduction to Preparing Your Operational Environment
- 2 Using SSL for opentaps Internet Security
- 3 Caution and Warning about Security and Access
- 4 Introduction to Using SSL Certificates and Use Cases
- 5 Configuring Your opentaps Server with an SSL Certificate
- 5.1 Installing A Self Signed Certificate for the Default Linux Installation
- 5.2 Installing A Purchased CA-Signed Certificate for the Default Linux Installation
- 5.3 Example 1 Using a PKCS12 Certificate
- 5.4 Example 2 Using a PEM Certificate
- 5.5 Issues with Certificates and File Formats -- Tips
- 5.6 Installing the Certificate for a Combined httpd (Apache) and Tomcat Installation
Introduction to Preparing Your Operational Environment
Before you configure your opentaps system with any of your business data, or your company's confidential information, or your company employee's data, it will be prudent to consider the security of your opentaps system servers and the related internet network security. Best practices with respect to this topic suggest the following partial list of salient points:
- Your server should be protected by a properly configured firewall to allow only the required forms of network access, as defined by your management and their technical system administrative staff.
- Any internet access to the opentaps server should probably be limited to SSL (secure socket layer) internet transmission layer security, as determined by your management and their technical system administrative staff. Consider both the public internet and any in-house local internets in this topic.
- You should secure all of the opentaps IDs that are active on the system, using a strong and unique password having properly limited distribution to users with a business need for them, and you should disable all other IDs on opentaps.
- You should make sure that your technical system administrator has secured all of the opentaps host server software components and related ports of every kind, so that no unintended routes of access are possible on your system.
- You should make sure that your opentaps server has physical security that is practiced 100% of the time, and that is robust enough to meet your management's requirements.
- Before you put any of your opentaps system functions into a production mode of operation, you should develop, test, and deploy your methods for system data backup and for system data restoration. You should actually practice the system data restoration periodically to make sure that it actually does work.
- Consider whether you will need a server for testing data restoration, migration, or new software component releases that is separate from the production servers that you use. (Usually, production servers are off limits for testing purposes.)
- Included in this preparation, you should include a determination of when backup will be collected, by whom, and where it will be stored so that if your operational facility is breached or destroyed there will still be a copy of your system backup data available, somewhere else.
- Make your own list adding all items to this topic which your company deems essential to your own best practices, and complete working your list. When making your own complete list, you may wish to consider what you would do if the internet access suffers an outage, either on the public internet or on your own local internets, or if the physical opentaps server computer suffers an outage.
If you do not need to attach your server to the internets while you are doing preliminary configuration, and preparing your environment then you may be able to phase some of the steps to make progress while other steps are still being completed.
Using SSL for opentaps Internet Security
opentaps can be configured to permit access only by the secure internet protocols, thus reducing the opportunity for unauthorized access to your system. This means having your users log-in and use your opentaps system via the secure internet https protocol (rather than non-encrypted http), and using the SSL-enabled ports (default on opentaps is port 8443) rather than the non-encrypted ports such as 80 or 8080.
Then there is the question of what to do about the SSL Certificate. The certificate is simply your internet identification "papers", including an encryption key that is uniquely yours, and these items are kept in a unique secure, encrypted file which acts as a lock box. This certificate (identity document) can be one that you have created and signed yourself, or it can be one that you initiate and submit to a public "certificate authority" recognized by the industry at large. Such a certificate authority will validate your identity first, then sign your certificate and return it to you for installation on your server(s). Thus, a chain of trust is created that your end-users or the customers of your eCommerce operations can rely upon.
Caution and Warning about Security and Access
When opentaps is downloaded in the release package and installed it contains a certificate for one of the organizations which produce the opentaps system releases. So that certificate is not yours, and it is not unique since many people will download the release code and install it with that common certificate. While you could operate with this default certificate for non-critical testing (using no private information of any kind) you must install your own unique certificate for secure use of the opentaps system. Also, the opentaps system, when it is initially installed, has several user identities enabled with trivial passwords that everyone knows about. You should disable or change passwords on all the existing IDs.
Introduction to Using SSL Certificates and Use Cases
The kind of Certificate you need depends upon how your opentaps system will be used, and by whom. Web browser software on the end user's computer will react differently to a self signed certificate which carries your unverified identity and your encryption key, as compared to a Certificate Authority signed certificate which has verified your identity, and also carries your encryption key. This verification of your identity is the significant item of difference.
You have the choice of using either a do-it-yourself, self-signed certificate or of purchasing a Certificate Authority verified and signed SSL certificate. The end user's web browser (such as Firefox or Internet Explorer) comes equiped with its on list of Certificate Authorities and will usually accept your certificate signed by one of them, without raising any warning messages to the user.
- Typically, a self-signed certificate will be used when your users of opentaps are internal to your organization and operate mostly on the same internal network. They will have been trained in how to manage the web browser warning and permission messages that are produced when self-signed certificates are being used. (Refer to your web browser documentation for guidance on handling such messages.)
- A certificate purchased from a Certificate Authority, such as GeoTrust, GoDaddy, VeriSign and others would be required for communications with users who are unable or unwilling to work with an unverified company identity that is using a self-signed certificate. Their issue with self-signed certificates is that the user cannot tell whether or not your internet site is legitimate unless they have personal knowledge of your company.
- Thus, if opentaps will be used for eCommerce with a secure checkout procedure, a Certificate Authority issued certificate is likely the best option. This will give the user the required confidence in your legitimacy and also an error-free/warning-free user experience.
In opentaps configuration, whether using a self-signed or Certificate Authority signed and issued certificate, the same certificate is used for securely connecting to all parts of the opentaps system. Whether you are working in the various modules of the system, or your customers are shopping on your opentaps eCommerce site, the single certificate is controlling access and security for your user networks.
Configuring Your opentaps Server with an SSL Certificate
Information: The following sections are for Technical System Administrators using the Linux command line functions.
There are several possible operational configurations for the opentaps server software, and the one you choose to implement will determine how the secure socket layer (SSL) Certificate will need to be installed.
We will begin by describing how to install your unique Certificate for opentaps simplest installation, which involves using the imbedded web server supplied in opentaps' pre-compiled, downloadable form for Linux.
Then, we will discuss some tips about how to handle the Certificates obtained in various formats from the authorities who sell "signed" and verified certificates. Finally, we will consider other possible opentaps installations and related Certificate issues.
Installing A Self Signed Certificate for the Default Linux Installation
To Use a Self-Signed Certificate You can create your own self signed SSL Certificate and install it for use with opentaps. To do so, you will use the keytool command provided in Linux which will produce a DER certificate, a DER Key, and store them into a Java Key Store (JKS) file suitable for the default web server delivered with opentaps (Tomcat). Thus, in this example, no file format conversions are required.
The following five steps are described in detail below:
- Create a Self-Signed Certificate
- Modify opentaps
- Restart opentaps
- Testing Your Certificate
Create a Self-Signed Certificate
The following exercise will produce a unique encryption key required for using secure opentaps communications, a self-signed X-509 (standard) identity certificate suitable for your business, and a keystore file for safe storage of the key and certificate. Because the certificate is self-signed rather than signed by a trusted Certificate Authority, users of your opentaps web site will still see a browser warning message telling them it has a self-signed certificate. If they know and trust you, they can then approve further access to your web site and will not see the warning again after the first approval.
This exercise makes use of the Java "keytool" provided by Sun Microsystems, and supplied in the Java JDK software required to run opentaps. For more information about keytool, refer to the command summary located at keytool commands.
Note: In the following list of questions from the keytool command, the requested "first and last name" should be the name of your server host name, not your own name. * For example, if you access your server as http://localhost, or as http://localhost:8080 then the answer is localhost. * If you use http://opentaps.mycompany.com:port#, then put opentaps.mycompany.com as the answer to "first and last name"
Run the following command and answer the questions presented as appropriate for your own company. You will be asked for two passwords, the first one is for the keystore (lock-box) that contains your finished certificate, the second one is for the encryption key. You can use the same password for both of these (recommended for simplicity). This keytool command produces a new "opentaps.jks" file which is the keystore with encryption key required for your installation. Execute the steps as shown in the following example:
In your Linux system change the directory to the opentaps installation directory, so that your opentaps.jks will be stored in the correct place on the file system, $ CD /. . ./opentaps_home Enter this command line, for a one year (365 day) certificate life, $ keytool -genkey -alias opentaps -keyalg RSA - validity 365 -keystore framework/base/config/opentaps.jks Respond to all these questions, Enter keystore password: opentaps What is your first and last name? [Unknown]: localhost What is the name of your organizational unit? [Unknown]: Si Chen What is the name of your organization? [Unknown]: Open Source Strategies, Inc. What is the name of your City or Locality? [Unknown]: Los Angeles What is the name of your State or Province? [Unknown]: CA What is the two-letter country code for this unit? [Unknown]: US Is CN=localhost, OU=Si Chen, O="Open Source Strategies, Inc.", L=Los Angeles, ST=CA, C=US correct? [no]: yes
Enter key password for <opentaps>
(Press only RETURN key if same as keystore password): opentaps
Modify Opentaps File Names as follows
Now you must point opentaps to your new keystore file, opentaps.jks.
Modify the file framework/base/config/ofbiz-containers.xml under <property name="https-connector" value="connector">
From the original installation values which follow:
<property name="keystoreFile" value="framework/base/config/ofbizssl.jks"/>
<property name="keystorePass" value="changeit"/>
Enter these new values instead: <property name="keystoreFile" value="framework/base/config/opentaps.jks"/> <property name="keystorePass" value="opentaps"/>
Restart Opentaps Server
Stop the opentaps server and then restart it using the commands described in your installation instructions. On the Linux command line and in the opentaps installation directory:
./stopofbiz.sh then, wait until the stopping process is completed ./startofbiz.sh to restart the opentaps server.
Testing your Certificate Installation
Open a connection to your opentaps server using your own URL similar to https://URL:8443. (Do not connect using http://URL:8080 as this is the non-secured connection to the server). You will likely receive a certificate warning message. This is because your browser does not have a client certificate that recognizes your self-signed server certificate. If required by your browser, approve the exception and connect to your server. Regardless of the warning, your connection should be a secure SSL connection and your web browser should display its small "lock" symbol indicating this fact.
Note: To facilitate future configuration for your company server, you can put the keystore or JKS file (opentaps.jks in this exercise) in the hot-deploy/ component for your own company, instead of framework/base/config/ folder.
Installing A Purchased CA-Signed Certificate for the Default Linux Installation
The default opentaps installation is facilitated in the pre-compiled download package, which runs on the Tomcat web server included in the package. Installation of this default option is very simple. One of the examples that follow will explain the simplest CA-signed certificate installation method for it, using PKCS12 format.
This discussion assumes that you need to purchase your verified and signed certificate from a Certificate Authority (CA) that is well known to the industry, specifically the web browser software providers should have your chosen CA listed in their browser certificate configuration file. Then, when your CA-signed certificate is properly installed in opentaps it will produce a user experience free of any warning messages regarding your web site or your identity.
To obtain such a certificate, you will choose a Certificate Authority to provide it, and follow their directions for submitting your request, which will include unique company information, and a private key that you will need to generate using tools available on Linux or supplied by your CA.
Because you may encounter a variety of file formats, and procedures for installing your certificate, depending upon which CA you choose to work with, and which tool set they recommend, we will provide two examples for how this process flows:
- Example 1 -- Installing a certificate using PKCS12 format from the CA
- Example 2 -- Installing a certificate using PEM format from the CA with format conversion and a keystore import step using a 3rd party tool.
Example 1 Using a PKCS12 Certificate
Example 2 Using a PEM Certificate
Submitting Your Request File
As an example only, the command for generating your own private encryption key using the openssl command for linux, might look like this:
openssl genrsa -out ssl.key
This produces a pair of keys in the file ssl.key which is stored in your current directory. You will also need to produce the certificate request file that goes to the Certificate Authority:
openssl req -new-x509 -key ssl.key -out ssl.crt
This produces a certificate request (.crt file) using your newly created ssl.key file as one input, plus other information you must provide. In the case of a specific Certificate Authority you have chosen, you will follow their directions carefully for these last two steps.
Warning: If you need to open and view the files produced here for any reason, use only basic text editors, never us an advanced work processor -- which may insert invisible characters or changes to your files rendering them corrupted, and unusable.
When your certificate comes back from the CA it may be in PEM format, or possibly another format. A PEM certificate file looks something like this and it includes the Begin line and the End line as part of the content:
MIIDVzCCAsCgAwIBAgIDD96eMA0GCSqGSIb3DQEBBQUAME4xCzAJBgNVBAYTAlVT WjCB4zEpMCcGA1UEBRMgbTc1VVk4QzNPMXhabnYtNkhNLTMwTDZWTXg2QnVuRVkx CzAJBgNVBAYTAlVTMRMwEQYDVQQKEwpjdnJ1cHMuY29tMRMwEQYDVQQLEwpHVDYy ODAxNzcwMTEwLwYDVQQLEyhTZWUgd3d3Lmdlb3RydXN0LmNvbS9yZXNvdXJjZXMv MRAwDgYDVQQKEwdFcXVpZmF4MS0wKwYDVQQLEyRFcXVpZmF4IFNlY3VyZSBDZXJ0 aWZpY2F0ZSBBdXRob3JpdHkwHhcNMTAwMzE1MDQwNDI0WhcNMTEwMzE3MTM1OTU1 MRAwDgYDVQQKEwdFcXVpZmF4MS0wKwYDVQQLEyRFcXVpZmF4IFNlY3VyZSBDZXJ0 aWZpY2F0ZSBBdXRob3JpdHkwHhcNMTAwMzE1MDQwNDI0WhcNMTEwMzE3MTM1OTU1 MRAwDgYDVQQKEwdFcXVpZmF4MS0wKwYDVQQLEyRFcXVpZmF4IFNlY3VyZSBDZXJ0 aWZpY2F0ZSBBdXRob3JpdHkwHhcNMTAwMzE1MDQwNDI0WhcNMTEwMzE3MTM1OTU1 MRAwDgYDVQQKEwdFcXVpZmF4MS0wKwYDVQQLEyRFcXVpZmF4IFNlY3VyZSBDZXJ0 aWZpY2F0ZSBBdXRob3JpdHkwHhcNMTAwMzE1MDQwNDI0WhcNMTEwMzE3MTM1OTU1
Installing Your Certificate *** THIS SECTION IS BEING TESTED AND EDITED ***
To actually use your certificate in opentaps you must load it into a Java Key Store (JKS) from which the opentaps web server will make use of it. The content of this JKS is required to be in DER format, which is the binary version of your certificate. Download your two files from the CA (a cert file and a key file) into your opentaps installation directory.
In case your certificate is in PEM format you will need to convert it to DER and then load it into your Java Key Store (lockbox) file. You may receive two files from the CA with names similar to these:
- key.pem which is the private key file in PEM format
- cert.pem which is the certificate file in PEM format
Run the following two commands to convert each of these two files into DER format:
$ openssl pkcs8 -topk8 -nocrypt -in key.pem -inform PEM -out key.der -outform DER $ openssl x509 -in cert.pem -inform PEM -out cert.der -outform DER
This produces the two files in the format (DER) required for your opentaps Java Key Store.
The final step is to import these two files into the Java Key Store file using a Java program called ImportKey. (See the footnote about where you can get the ImportKey program.) Run the following command:
$ java ImportKey key.der cert.der Using keystore-file : /home/user/keystore.ImportKey One certificate, no chain. Key and certificate stored. Alias:importkey Password:importkey
Change the password on the keystore to "opentaps" using this command:
$ keytool -keystore keystore.ImportKey -storepass Enter keystore password:importkey New keystore password:opentaps Re-enter new keystore password:opentaps