IBM WebSphere Automation Think 2021 Lab instructions
- Once you login you will see 10 VMs (virtual machines)
- 3 are for lab infrastructure
- 3 for OCP (OpenShift) controllers
- 3 for OCP workers
- 1 for the lab (Student VM)
- WebSphere Automation is pre-installed in the OCP cluster hosted on the VMs.
- You will be working on the Student VM only.
- This VM is installed with OCP client (oc) and all thee scripts and files you need for the lab.
Once you login into the Student VM you will see the Desktop which contains all the programs that you will be using (browsers, terminal etc) need to add a screen shot here (??) You can always come to the desktop view by clicking ?? The best way to copy and paste is by using the clipboard at the top middle Keyboard keys (like Ctrl ^C, Ctrl ^V) are not supported so have to highlight the text to copy and paste. You can use either use the instructions from these slides for the lab or from the text file on the desktop. If using the text file from the VM for lab instructions, it is recommended that you open 2 terminals to make copy and paste easier. Anything else ??
Step 1: Login into WebSphere Automation GUI and configure your email to receive vulnerability notifications. Step 2: Login as root on the Student VM and also to OpenShift client (oc) Step 3: Get the usageMetering configuration parameters (api-key, URL, server cert). Step 4: Register Liberty Server version 200012 to WebSphere Automation. Step 5: Register Liberty Server version 20009 to WebSphere Automation. Step 6: Register tWAS server version 9056 to WebSphere Automation. Step 7: Register tWAS server version 9057 to WebSphere Automation. Step 8: Update Liberty server version 20009 to get rid of the vulnerabilities. Step 9: Update tWAS server version 9057 to get rid of vulnerabilities Step 10: Update tWAS server version 9057 to introduce the vulnerability back (optional)
WebSphere Automation is pre-installed on an OCP cluster. Each of you have access to your individual WebSphere Automation install Click on the Student VM. Open a browser and enter the following URL https://cpd-websphere-automation.apps.ocp.ibm.edu Accept all the warnings and certificates. Depending on your browser you might have to scroll down to permit accesss. This is the initial landing page for IBM automation Under Log in to IBM Automation -> Select your authentication type: click on OpenShift authentication Enter the following credentials UserName : ocadmin Password :
Click on the Navigation/Hamburger Menu on the left. Expand Operate. You should now see Application Runtimes. Click on that. It will take you to the WebSphere Automation GUI. There should be no data since no WebSphere servers are registered/configured yet. On the console, go to Notification Configuration and enter your email address where you want to be notified about CVEs by clicking on add email address button The mail server is pre-configured for this lab. You only need to enter your email address to get notified.
Open 2 terminals and login as root in both. The terminal window will be on the desktop. If you can’t see it, try minimizing the windows (browser etc). su root Password : 1bm2021rhjb Login to the OCP cluster (in each terminal) oc login --username=ocadmin --password=ibmocp46 --insecure-skip-tls-verify=true --server=https://api.ocp.ibm.edu:6443 Make sure that project you are working in is websphere-automation oc project websphere-automation Copy to clipboard instructions Use the clipboard icon to help with copy and paste in VM.
Get the URL for usage-metering and save it in a file. echo https://$(oc get route cpd -n websphere-automation -o jsonpath='{.spec.host}')/websphereauto/meteringapi > /opt/IBM/WebSphere/metering-url.txt Get the api-key and store it in a file. oc -n websphere-automation get secret automation-secure-metering-apis-encrypted-tokens -o jsonpath='{.data.automation-secure-metering-apis-sa}' | base64 -d > /opt/IBM/WebSphere/api-key.txt; echo >> /opt/IBM/WebSphere/api-key.txt Get the Server certificate oc get secret external-tls-secret -n websphere-automation -o jsonpath='{.data.cert.crt}' | base64 -d > /opt/IBM/WebSphere/cacert.pem
Create the Liberty server version 200012 /opt/IBM/WebSphere/Liberty200012/bin/server create Liberty_200012_server Configure the server to use TLS/SSL using the provided server_tls.xml file. Press Yes (Y) to overwrite the existing file. cp /home/ibmuser/Desktop/lab_backup/liberty200012/server_tls.xml /opt/IBM/WebSphere/Liberty200012/usr/servers/Liberty_200012_server/server.xml Start the Liberty server /opt/IBM/WebSphere/Liberty200012/bin/server start Liberty_200012_server Update the DefaultKeyStore with the server certificate to trust the server for https connections keytool -import -trustcacerts -file /opt/IBM/WebSphere/cacert.pem -keystore /opt/IBM/WebSphere/Liberty200012/usr/servers/Liberty_200012_server/resources/security/key.p12 -storetype PKCS12 -storepass th1nkpassword -noprompt Edit the server.xml file (using vi, vim, or gedit) to configure the usageMetering feature. vi /opt/IBM/WebSphere/Liberty200012/usr/servers/Liberty_200012_server/server.xml usageMetering-1.0
Add the usageMetering element and replace the url and the api-key values as shown below <usageMetering url="" apiKey="" sslRef="defaultSSL”/> Replace above with the output of the following cat command cat /opt/IBM/WebSphere/metering-url.txt Replace above with the output of the following cat command cat /opt/IBM/WebSphere/api-key.txt Confirm that the Liberty server is registered to WebSphere Automation https://cpd-websphere-automation.apps.ocp.ibm.edu/websphereauto/secvul/ This version of Liberty server is not vulnerable to any known CVEs.
cpd-websphere-automation.apps.ocp.ibm.edu
ocadmin ibmocp46
su root 1bm2021rhjb
oc login --username=ocadmin --password=ibmocp46 --insecure-skip-tls-verify=true --server=https://api.ocp.ibm.edu:6443
oc project websphere-automation
/opt/IBM/WebSphere/Liberty200012/bin/server create Liberty_200012_server
?? Backup original server.xml
cp /home/ibmuser/Desktop/lab_backup/liberty200012/server_tls.xml /opt/IBM/WebSphere/Liberty200012/usr/servers/Liberty_200012_server/server.xml
/opt/IBM/WebSphere/Liberty200012/bin/server start Liberty_200012_server
echo https://$(oc get route cpd -n websphere-automation -o jsonpath='{.spec.host}')/websphereauto/meteringapi > /opt/IBM/WebSphere/metering-url.txt
oc -n websphere-automation get secret automation-secure-metering-apis-encrypted-tokens -o jsonpath='{.data.automation-secure-metering-apis-sa}' | base64 -d > /opt/IBM/WebSphere/api-key.txt; echo >> /opt/IBM/WebSphere/api-key.txt
oc get secret external-tls-secret -n websphere-automation -o jsonpath='{.data.cert.crt}' | base64 -d > /opt/IBM/WebSphere/cacert.pem
keytool -import -trustcacerts -file /opt/IBM/WebSphere/cacert.pem -keystore /opt/IBM/WebSphere/Liberty200012/usr/servers/Liberty_200012_server/resources/security/key.p12 -storetype PKCS12 -storepass th1nkpassword -noprompt
?? encoded password: {xor}KzduMTQvPiwsKDAtOw==
gedit /opt/IBM/WebSphere/Liberty200012/usr/servers/Liberty_200012_server/server.xml
usageMetering-1.0 jsp-2.3 transportSecurity-1.0cat /opt/IBM/WebSphere/metering-url.txt
cat /opt/IBM/WebSphere/api-key.txt
cpd-websphere-automation.apps.ocp.ibm.edu/websphereauto/secvul/
/opt/IBM/WebSphere/Liberty20009/bin/server create Liberty_20009_server
?? Backup original server.xml
cp /home/ibmuser/Desktop/lab_backup/liberty20009/server_tls.xml /opt/IBM/WebSphere/Liberty20009/usr/servers/Liberty_20009_server/server.xml
/opt/IBM/WebSphere/Liberty20009/bin/server start Liberty_20009_server
keytool -import -trustcacerts -file /opt/IBM/WebSphere/cacert.pem -keystore /opt/IBM/WebSphere/Liberty20009/usr/servers/Liberty_20009_server/resources/security/key.p12 -storetype PKCS12 -storepass th1nkpassword -noprompt
?? encoded password: {xor}KzduMTQvPiwsKDAtOw==
gedit /opt/IBM/WebSphere/Liberty20009/usr/servers/Liberty_20009_server/server.xml
usageMetering-1.0 jsp-2.3 transportSecurity-1.0cpd-websphere-automation.apps.ocp.ibm.edu/websphereauto/secvul/
/opt/IBM/WebSphere/AppServer9056/bin/startServer.sh tWAS_9056_server
/opt/IBM/WebSphere/AppServer9056/bin/wsadmin.sh -f /api-usagemetering/scripts/configuretWasUsageMetering.py url=$(cat /opt/IBM/WebSphere/metering-url.txt) apiKey=$(cat /opt/IBM/WebSphere/api-key.txt) trustStorePassword=th1nkpassword
cpd-websphere-automation.apps.ocp.ibm.edu/websphereauto/secvul/
/opt/IBM/WebSphere/AppServer9057/bin/startServer.sh tWAS_9057_server
/opt/IBM/WebSphere/AppServer9057/bin/wsadmin.sh -f /api-usagemetering/scripts/configuretWasUsageMetering.py url=$(cat /opt/IBM/WebSphere/metering-url.txt) apiKey=$(cat /opt/IBM/WebSphere/api-key.txt) trustStorePassword=password
Visit the console at the following url and you should see 2 Liberty Server entries and 2 tWAS entries
cpd-websphere-automation.apps.ocp.ibm.edu/websphereauto/secvul/
gedit /opt/IBM/WebSphere/Liberty20009/usr/servers/Liberty_20009_server/server.xml
beanValidation-2.0
Notice in the console there is 1 CVE (CVE-2021-26296) under the tWAS 9057 server, we are about to fix that.
/opt/IBM/WebSphere/AppServer9057/bin/stopServer.sh tWAS_9057_server
/iFix/PH34711/imcl_ifix_install.sh 9057
/opt/IBM/WebSphere/AppServer9057/bin/startServer.sh tWAS_9057_server
cpd-websphere-automation.apps.ocp.ibm.edu/websphereauto/secvul/
/opt/IBM/WebSphere/AppServer9057/bin/stopServer.sh tWAS_9057_server /iFix/PH34711/imcl_ifix_uninstall.sh 9057
/opt/IBM/WebSphere/AppServer9057/bin/startServer.sh tWAS_9057_server
cpd-websphere-automation.apps.ocp.ibm.edu/websphereauto/secvul/