-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API ML enablers fail when some SSL configuration has keyring without keyAlias #2034
Comments
The keyring can have one default certificate that should be used when no alias is specified. However, this is quite tricky to implement and requires calling a native service. https://www.ibm.com/docs/en/zos/2.5.0?topic=services-r-datalib-irrsdl00-irrsdl64-callable-service |
@JirkaAichler yes default key should be chosen when keyAlias is not specified. I believe it will be great to have functionality built into a common infrastructure like apiml than requiring keyAlias from every onboarding api. One possible workaround could be to request security admin to enlist default label(s) into apiml configurations; that way keyAlias would not be needed for many. Also it would be great to see // instead of //// being allowed as part of keyring url.. |
It is not just a simpler configuration. It also allows the simpler renewal of certificates that are going to expire. Securite admin adds a new certificate into a keyring making it default. Once the service is recycled it automatically uses the new certificate without any need to touch the configuration. |
Currently, there is no code in api-layer repo that is responsible for loading private key by keyAlias. All is done by tomcat configured from application.yaml
Java API used for accessing keyrings does not provide any information about which private key is 'default' . This can be done by implementing native callable service as Jirka described in his comment.
Possible next steps:
From the point of view of renewal, there is no difference, just remove the expired certificate as there is no reason for it to be in the keyring. |
@recaph What is your opinion? Would it help if we remove the validation for now and just use the certificate that is available in keyring? |
@achmelo it would definitely help to remove validation. I agree that we could have WARN log message to indicate that recommended keyAlias was not supplied. Will the changes also allow just the '//' in the safkeyring string instead of needing '////'. On topic of native dependency, I guess it would be something internal to apiml enablers / apiml and will not require additional requirements on the apis calling enablers. |
@recaph code updates were merged, they are included in 1.27.6-SNAPSHOT . Requirements for 4 slashes were removed, however, I was not able to confirm that 2 slashes would work within java application. Please verify and reopen if needed. |
@achmelo I tried the changes. Its passed the key store keyAlias with below warning as expected
but now its stucks here
|
api-layer/certificate-analyser/src/main/java/org/zowe/apiml/Stores.java Lines 144 to 148 in a7315a1
|
Describe the bug
The API ML enablers fail when some SSL properties misses keyAlias even if it is not necessary for creation of keyring. The same keyring works with other applications or same application with apiml discovery disabled.
keyAlias is should only be mandatory if multiple certificates are defined in the keyring i.e. there are multiple aliases in the keyring.
Steps to Reproduce
Use API ML enabler in an API service and specify for example these settings:
server:
ssl:
keyAlias:
keyStore: safkeyring:////SDKSERV/SDKRING
keyStoreType: JCERACFKS
trustStore: safkeyring:////SDKSERV/SDKRING
trustStoreType: JCERACFKS
verifySslCertificatesOfServices: true
protocol: TLSv1.2
Start the service
The message is displayed: SSL parameters are missing or were not replaced by the system properties.
Expected behavior
Should only through this error if there are multiple keyAlias defined in the keyring or choose the only entry defined in the keyring by default.
Also, validations should match the required and optional behaviors of both certificates and keyrings.
Details
Version and build number: 1.27.5
Test environment: 60004
The text was updated successfully, but these errors were encountered: