Come for answers. Stay for best practices. All we’re missing is you.
This document is about how to install and configure IBM Business Automation Workflow (BAW) 23.0.2 on premise with PostgreSQL using client certificate authentication.
To configure the PostgreSQL database to use encrypted communications and export the server certificate, see Using SSL.
To configure your PostgreSQL database server uses certificate authentication, make sure that the database server is configured as described in Using Client Certificates.
The following steps are a configuration example.
login as root.
cd /var/lib/pgsql/15/data
Create root crt of PostgreSQL.
openssl req -new -nodes -text -out root.csr -keyout root.key -subj "/CN=TAPALLINONE"
CN must be host name of the PostgreSQL machine.
chmod og-rwx root.key
openssl x509 -req -in root.csr -text -days 3650 -extfile /etc/pki/tls/openssl.cnf -extensions v3_ca -signkey root.key -out root.crt
openssl x509 -in root.crt -out rootnew.crt
modify format of root.crt, make sure it’s a correct X.509 certificate, refer to https://stackoverflow.com/questions/9889669/error-importing-ssl-certificate-not-an-x-509-certificate
mv root.crt root.crt.bak2
mv rootnew.crt root.crt
Create server.crt of PostgreSQL
openssl req -new -nodes -text -out server.csr -keyout server.key -subj "/CN=TAPALLINONE"
chmod og-rwx server.key
openssl x509 -req -in server.csr -text -days 3650 -CA root.crt -CAkey root.key -CAcreateserial -out server.crt
Create client crt for BPM
openssl req -new -nodes -text -config /etc/pki/tls/openssl.cnf -out postgresql.csr -keyout postgresql.key -subj "/CN=postgres"
CN must be the db user, that is, bpm.de.authenticationAlias.2.user from BPMConfig property file.
create a client certificate signed by the new root certificate authority.
openssl x509 -req -in postgresql.csr -text -days 3650 -CA root.crt -CAkey root.key -CAcreateserial -out postgresql.crt
convert PEM key to DER format
openssl pkcs8 -topk8 -inform PEM -in postgresql.key -outform DER -out postgresql.pk8 -v1 PBE-MD5-DES -nocrypt
chown postgres:postgres root.*
chown postgres:postgres server.*
chown postgres:postgres postgresql.pk8
chown postgres:postgres postgresql.crt
chown postgres:postgres postgresql.csr
chown postgres:postgres postgresql.key
Modify /var/lib/pgsql/15/data/postgresql.conf as below.
ssl = on
ssl_ca_file = '/var/lib/pgsql/15/data/root.crt'
ssl_cert_file = '/var/lib/pgsql/15/data/server.crt'
ssl_key_file = '/var/lib/pgsql/15/data/server.key'
modify /var/lib/pgsql/15/data/pg_hba.conf, add following contents in section # IPv4 local connections:
hostssl all all 0.0.0.0/0 cert
hostssl all all 0.0.0.0/0 md5 clientcert=verify-full
hostnossl all all 0.0.0.0/0 reject
Comment out “host all all 127.0.0.1/32 trust”.
systemctl restart postgresql-15.service
systemctl status postgresql-15.service
Check if SSL is enabled.
[postgres@TAPALLINONE ~]$ psql -c 'show ssl'
ssl
-----
on
(1 row)
[root@TAPALLINONE data]# lsof -i:5432
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
postmaste 26841 postgres 6u IPv4 319973 0t0 TCP *:postgres (LISTEN)
postmaste 26841 postgres 7u IPv6 319974 0t0 TCP *:postgres (LISTEN)
You may install BAW according to document https://www.ibm.com/docs/en/baw/23.x?topic=workflow-installing-configuring-business-automation.
You may configure BAW according to document https://www.ibm.com/docs/en/baw/23.x?topic=workflow-installing-configuring-business-automation.
Copy PostgreSQL JDBC driver to BAW machine.
Prepare property file of BPMConfig, make sure bpm.de.deferSchemaCreation=true.
create an empty directory on BAW machine for bpm.de.messagingEngine.fileStoreDirectory. Sample ommands are as below.
cd /opt/bpm/BPMAutomationROOT/
mkdir mestore
Generate DB scripts, sample command is: /opt/ibm/bpm/bin/BPMConfig.sh -create -sqlfiles /root/Downloads/bpmconfig.properties -outputDir /opt/ibm/bpm/dbscripts
For bpmdb, run generated DB script. Sample commands are as below.
su - postgres
cd /opt/ibm/bpm/dbscripts/TAPALLINONECell01.BPM/PostgreSQL/bpmdb
psql -U postgres -f dropDatabase.sql
psql -U postgres -f createDatabase.sql
psql -U postgres -f createSchema.sql
modify createSchema_Standard.sql and createProcedure_Standard.sql, add following lines at the beginning of the file.
-- Connect to db
\c bpmdb
SET ROLE postgres;
psql -U postgres -f createSchema_Standard.sql
psql -U postgres -f createProcedure_Standard.sql
For pdwdb, run generated DB script. Sample commands are as below.
cd /opt/ibm/bpm/dbscripts/TAPALLINONECell01.BPM/PostgreSQL/pdwdb
vi createSchema_Standard.sql, add following lines at the beginning of the file.
\c pdwdb
For icndb, run generated DB script. Sample commands are as below.
use root user or the user you used to install BAW.
mkdir /opt/bpm/BPMAutomationROOT/postgresql/
cd /opt/bpm/BPMAutomationROOT/postgresql/
mkdir icndb
chown -R postgres:postgres icndb/
cd /opt/ibm/bpm/dbscripts/TAPALLINONECell01.BPM/PostgreSQL/icndb
vi dropTablespace.sql
file content is as below:
DROP TABLESPACE IF EXISTS POSTGRESDOSDATA;DROP TABLESPACE IF EXISTS POSTGRESTOSDATA;
psql -U postgres -f dropTablespace.sql
./createDatabase_ECM.sh
psql -U postgres -f "./createSchema_ICN.sql"
psql -U postgres -f createTablespace_Standard.sql
\c icndb
create DE. Sample command is as below.
/opt/ibm/bpm/bin/BPMConfig.sh -create -de /root/Downloads/bpmconfig.properties
start dmgr.
start node agent.
Update properties of all datasources.
WAS admin console -> Resources -> JDBC -> data sources -> select a datasource -> Custom Properties -> URL
Change URL to URLs like below, modify it according to your environment:
jdbc:postgresql://TAPALLINONE:5432/bpmdb?sslmode=verify-full&sslrootcert=/var/lib/pgsql/15/data/root.crt&sslcert=/var/lib/pgsql/15/data/postgresql.crt&sslkey=/var/lib/pgsql/15/data/postgresql.pk8
jdbc:postgresql://TAPALLINONE:5432/pdwdb?sslmode=verify-full&sslrootcert=/var/lib/pgsql/15/data/root.crt&sslcert=/var/lib/pgsql/15/data/postgresql.crt&sslkey=/var/lib/pgsql/15/data/postgresql.pk8
jdbc:postgresql://TAPALLINONE:5432/icndb?sslmode=verify-full&sslrootcert=/var/lib/pgsql/15/data/root.crt&sslcert=/var/lib/pgsql/15/data/postgresql.crt&sslkey=/var/lib/pgsql/15/data/postgresql.pk8
After changes are saved, click “test connection“ to make sure connection to DB is successful.
Import certificates into WAS.
Stop BAW.
Import the certificate to /jre/lib/security/cacerts key store
/opt/ibm/bpm/java/bin/keytool -import -file /var/lib/pgsql/15/data/root.crt -keystore /opt/ibm/bpm/java/jre/lib/security/cacerts -alias psqlssl
Enter keystore password, default password is changeit
If you are using Java's default mechanism (not LibPQFactory) to create the SSL connection you will need to make the server certificate available to Java, the first step is to convert it to a form Java understands.
openssl x509 -in server.crt -out server.crt.der -outform der
/opt/ibm/bpm/java/bin/keytool -keystore $JAVA_HOME/lib/security/cacerts -alias postgresql -import -file /var/lib/pgsql/15/data/server.crt.der
Enter keystore password: changeitRe-enter new password: changeit
Run bootstrapProcessServerData. Sample commands are as below.
/opt/ibm/bpm/profiles/Dmgr01/bin/bootstrapProcessServerData.sh -clusterName BPM.AppCluster
Now you've finished configuring BAW functions except case management functions, and you can start BAW to verify your environment. You can verify BAW according to document https://www.ibm.com/docs/en/baw/23.x?topic=workflow-starting-your-environment-verifying-installation.
If you need to use case management functions, you may continue configuring it according to document https://www.ibm.com/docs/en/baw/23.x?topic=workflow-configuring-your-system-case-management. If you don't need to use case management functions, you don't need to do it.
Now you've finished configuring BAW case management functions, and you can verify your environment.
Restart BAW, including dmgr, node agent and application servers.
Verify case management functions. If your environment is production environment, you may refer to document https://www.ibm.com/docs/en/baw/23.x?topic=cpecm-verifying-business-automation-workflow-applications-in-production-environment. If your environment is development environment, you may refer to document https://www.ibm.com/docs/en/baw/23.x?topic=management-verifying-case-applications-in-development-environment.
Copy