wls-eng / arm-oraclelinux-wls

Microsoft Azure ARM Templates to create Oracle Linux VM with pre-installed Weblogic Server
Apache License 2.0
0 stars 7 forks source link

Dynamic Cluster: even with correctly formatted and filled out certificates, TLS/SSL blade prevents cluster formation #289

Closed edburns closed 3 years ago

edburns commented 3 years ago

Using Dynamic Cluster offer version 1.0.32 2021-03-05 13:52 EST

https://ms.portal.azure.com/#create/oracle.20210202-test-01-previewarm-oraclelinux-wls-dynamic-cluster

With the following options filled out

Basics

TLS/SSL

keytool -genkey -keyalg RSA -alias servercert -keystore keyStoreIdentity.jks -storepass Gumby12340987 -validity 360 -keysize 2048 -keypass Gumby12340987 -storetype jks

keytool -genkey -keyalg RSA -alias servercert -keystore keyStoreTrust.jks -storepass Gumby12340987 -validity 360 -keysize 2048 -keypass Gumby12340987 -storetype jks

OHS

keytool -genkey -keyalg RSA -alias servercert -keystore keyStoreOhs.jks -storepass Gumby12340987 -validity 360 -keysize 2048 -keypass Gumby12340987 -storetype jks

DNS -> Create+Review

Deploying the cluster in this way causes the managed servers to not run.

gnsuryan commented 3 years ago

Hi Ed @edburns,

I tested using the keystore commands provided in the issue. Though the deployment went through, the SSL setup is not working as expected due to wrong trust.jks file being used.

Below are the correct keystore commands that needs to be used to create the identity.jks and trust.jks files.

Create identity.jks File: keytool -genkey -alias servercert -keyalg RSA -keysize 2048 -sigalg SHA256withRSA -validity 365 -keystore identity.jks -keypass Gumby12340987 -storepass Gumby12340987

Export identity.jks File and generate root cert file: keytool -export -alias servercert -noprompt -file root.cert -keystore identity.jks -storepass Gumby12340987

Import root.cert and create trust.jks file keytool -import -alias servercert -noprompt -file root.cert -keystore trust.jks -storepass Gumby12340987

gnsuryan commented 3 years ago

The identity and trust keystore files are related to each other and we cannot use independently created keystores and use it as identity and trust keystores.

I am working on including few validations in the script to check if the provided files is a valid keystore file. I will also try to find out if there is a way to validate, if the identity and trust keystores provided are related.

gnsuryan commented 3 years ago

The following commands can be used to validate the identity & trust.jks keystore files:

Validate Identity Keystore keytool -list -v -keystore identity.jks -storepass Gumby12340987 -storetype JKS |grep "Entry type:"|grep 'PrivateKeyEntry' Returns 0 on successful validation and 1 on validation failure

Validate Trust Keystore keytool -list -v -keystore trust.jks -storepass Gumby12340987 -storetype JKS |grep "Entry type:"|grep 'trustedCertEntry' Returns 0 on successful validation and 1 on validation failure

These validations will be added to the SSL Configuration logic in Domain Setup scripts for all the three offers.

gnsuryan commented 3 years ago

Implemented validation for SSL Keystores during deployment and add node features.

Created pull requests for all the three offers.

https://github.com/wls-eng/arm-oraclelinux-wls-admin/pull/96

https://github.com/wls-eng/arm-oraclelinux-wls-cluster/pull/136

https://github.com/wls-eng/arm-oraclelinux-wls-dynamic-cluster/pull/123

gnsuryan commented 3 years ago

Hi @edburns,

Thanks for identifying the issue. The issue occurred due to a typo issue in configuring SSL parameters in nodemanager.properties for the Managed Servers.

The reason I couldn't identity this issue during my testing, is because, I was using the same passphrase for all the required passphrases.

I have made the fix, tested and found them working fine for Cluster & Dynamic Cluster offers. I have created the following Pull Requests for merging the fix.

https://github.com/wls-eng/arm-oraclelinux-wls-cluster/pull/139 https://github.com/wls-eng/arm-oraclelinux-wls-dynamic-cluster/pull/125

edburns commented 3 years ago