Skip to content
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

Updates to Hostname Verification [24.0.0.9, PH58796] #7472

Closed
1 of 2 tasks
adriankalafut opened this issue Aug 16, 2024 · 15 comments · Fixed by #7556
Closed
1 of 2 tasks

Updates to Hostname Verification [24.0.0.9, PH58796] #7472

adriankalafut opened this issue Aug 16, 2024 · 15 comments · Fixed by #7556
Assignees
Labels
Milestone

Comments

@adriankalafut
Copy link

Feature epic details

  • For the title of this issue, type: Documentation, Development epic name
  • Link to development epic:
  • Target GA release:

Operating systems

Does the documentation apply to all operating systems?

  • Yes
  • No; specify operating systems: ______

Summary

Provide a concise summary of your feature. What is the update, why does it matter, and to whom? What do 80% of target users need to know to be most easily productive using your runtime update?

Configuration

List any new or changed properties, parameters, elements, attributes, etc. Include default values and configuration examples where relevant:

Updates to existing topics

To update existing topics, specify a link to the topics that are affected. Include a copy of the current text and the exact text to which it will change. For example: Change ABC to XYZ

Create a new topic

To create a topic, specify a first draft of the topic that you want added and the section in the navigation where the topic should go.

@dmuelle
Copy link
Member

dmuelle commented Aug 19, 2024

from @Zech-Hein

FYI - There is an open liberty doc page for trouble shooting security-SSL we could add info to
https://openliberty.io/docs/latest/troubleshooting.html#Troubleshooting_SSL

@adriankalafut
Copy link
Author

We can add a Hostname verification subsection to the Transport Security
1.0
and mention:
WebSphere Liberty performs hostname verification on SSL certificates. If users want to disable hostname verification functionality, the verifyHostname attribute within the ssl tag must be initialized to false.

e.g. <ssl id="defaultSSLConfig"   keyStoreRef="defaultKeyStore"   trustStoreRef="defaultTrustStore"  verifyHostname=“true”/>

ramkumar-k-9286 added a commit that referenced this issue Aug 23, 2024
7472-Hostname verification-1

#7472
@ramkumar-k-9286
Copy link
Contributor

Hi Adrian @adriankalafut

The suggested changes have been made to the Transport security page.

Draft Link: https://docs-draft-openlibertyio.mqj6zf7jocq.us-south.codeengine.appdomain.cloud/docs/latest/reference/feature/transportSecurity-1.0.html

Please review the same.
Also, Please let me know if we need to make additional changes for this issue.

Regards,
Ramkumar.

CC @dmuelle

@Zech-Hein
Copy link

Zech-Hein commented Aug 27, 2024

@ramkumar-k-9286 The quotes are a different symbol that will cause problems if customers try to copy/paste. can you update them?
you can see the difference below

trustStoreRef="defaultTrustStore"  verifyHostname=“true”

they should match what is used for trustStoreRef

ramkumar-k-9286 added a commit that referenced this issue Aug 28, 2024
7472-Hostname verification-2

#7472
@ramkumar-k-9286
Copy link
Contributor

Hi Zech @Zech-Hein

The suggested correction is done.

Draft Link: https://docs-draft-openlibertyio.mqj6zf7jocq.us-south.codeengine.appdomain.cloud/docs/latest/reference/feature/transportSecurity-1.0.html

Please review the same.
Also, Please let me know if we need to make additional changes for this issue.

Regards,
Ramkumar.

CC @dmuelle

@Zech-Hein
Copy link

@ramkumar-k-9286 That looks good.

One other update we would like to include in that same section is the following below...

to be:
Hostname verification
Hostname and IP address verification are enabled by default. The verification is enforced for target servers in all SSL connections using Open Liberty socket factories. However, you can specify a list of hostnames, IP addresses, or both to skip for verification.

Hostname verification can be disabled by setting the verifyHostname attribute within the ssl tag to false.
When Hostname verification is enabled, verification can be skipped/disabled for hostnames specified in the skipHostnameVerificationForHosts attribute within the ssl tag.

<ssl id="defaultSSLConfig" keyStoreRef="defaultKeyStore" trustStoreRef="defaultTrustStore" verifyHostname="true" skipHostnameVerificationForHosts="myHost.com" />

Hostname verification is also configurable for only HTTP connections by using the httpHostNameVerification attribute within the sslDefault tag. If httpHostNameVerification is set to true, and verifyHostname is set to false, hostname verification will still be enforced on HTTP connections, but not other connections.

ramkumar-k-9286 added a commit that referenced this issue Aug 29, 2024
7472-Hostname verification-3

#7472
@ramkumar-k-9286
Copy link
Contributor

Hi Zech @Zech-Hein

The suggested changes have been made to the document.

Draft Link: https://docs-draft-openlibertyio.mqj6zf7jocq.us-south.codeengine.appdomain.cloud/docs/latest/reference/feature/transportSecurity-1.0.html

Please review the same.
Also, Please let me know if we need to make additional changes for this issue.

Regards,
Ramkumar.

CC @dmuelle

@utle
Copy link
Member

utle commented Aug 29, 2024

We need to update this article how can handle virtual host with HNV enabled by default.
https://www.ibm.com/docs/en/was-liberty/nd?topic=liberty-using-virtual-hosts
https://www.openliberty.io/docs/latest/virtual-hosts.html

@utle
Copy link
Member

utle commented Aug 29, 2024

https://docs-draft-openlibertyio.mqj6zf7jocq.us-south.codeengine.appdomain.cloud/docs/latest/reference/feature/transportSecurity-1.0.html#hostverify

Hostname verification
In this article, sub-section hostname verify:

Replace the sub-section to:

Hostname and IP address verification
In Open Liberty, hostname and IP address verification are enabled by default. This verification is enforced for target servers in all SSL connections by using the Open Liberty socket factories. However, you can specify a list of hostnames, IP addresses, or both to skip verification.

The verification makes sure that the hostname or IP address in the URL matches the Subject Alternative Name (SAN) in the SSL certificate of the server. If the SAN is not found, the property makes sure that the hostname in the URL matches the common name (CN). If a mismatch exists, the SSL connection is rejected.

Typically, during hostname verification, when the hostname is used in the request, it checks against the DNSName entry in the SAN. If the SAN does not contain a DNSName entry, hostname verification uses the certificate owner's common name (CN). When an IP address is used in the request, hostname verification relies on the IP address information in the SAN only.

See host name verification troubleshoot for this issue - link to
https://openliberty.io/docs/latest/troubleshooting.html#Troubleshooting_SSL
Troubleshooting SSL and TLS

@dmuelle dmuelle added this to the 24.0.0.9 milestone Aug 29, 2024
@utle
Copy link
Member

utle commented Aug 29, 2024

https://www.openliberty.io/docs/latest/virtual-hosts.html
In this article we need to have a link to the sub-section Hostname and IP address verification

@utle
Copy link
Member

utle commented Aug 29, 2024

https://openliberty.io/docs/latest/troubleshooting.html#Troubleshooting_SSL
Troubleshooting SSL and TLS
Add the following:
You receive the CWPKI0824E: SSL HANDSHAKE FAILURE: message that the Host name verification error
If you try to access an URL, you might see the following message
CWPKI0824E: SSL HANDSHAKE FAILURE: Host name verification error while connecting to host [testServer.com]. The host name used to access the server does not match the server certificate's [Subject Alternative Name [dnsName:server1.com, ipAddress:11.22.33.444]]. The extended error message from the SSL handshake exception is: [No subject alternative names matching host name testServer.com].

Hostname and IP address verification is a critical security check that prevents man-in-the-middle attacks by making sure that the client connects to the correct server. However, hostname verification can fail during an SSL handshake.

The following list provides common reasons that hostname verification fails.

Mismatched hostnames
The hostname that is specified in the client’s URL does not match the Common Name (CN) or Subject Alternative Name (SAN) in the server’s SSL certificate.
Incorrect SSL configuration
The SSL configuration on the server might be set up with a certificate that doesn’t include the correct hostname.
Configuration error in client
The client might be configured with an incorrect URL or might be using a deprecated hostname.

You can resolve the hostname verification failure by addressing the following areas.

  • Verify the hostname or IP address.
    Check that the hostname or IP address in the URL that you are using matches the SAN or CN in the server's SSL certificate. If the URL is incorrect, update it with the correct hostname.

  • Review your SSL configuration.
    Make sure that the server SSL certificate is configured correctly. The SSL certificate must contain the SAN or CN of the hostname that the client is connecting to.

  • If the security of your environment is not impacted, you can skip hostname verification for specific hostnames, IP addresses, or both.
    Set the skipHostnameVerificationForHosts attribute in the ssl config to the specific hostnames, IP addresses, or both that you want to skip verification for. Separate multiple entries with commas.

  • Disable hostname verification temporarily when this security check is not a concern, such as in nonproduction environments, by setting the SSL config element with the attribute verifyHostname to false.
    The following message is then displayed:

CWPKI0063W: Hostname verification is disabled for [mySSLConfig]. TLS/SSL connections do not check server identities to verify that the client is communicating with the correct server.

Avoid trouble: Avoid disabling hostname verification for production environments, as it can compromise security.

@utle
Copy link
Member

utle commented Aug 30, 2024

ramkumar-k-9286 added a commit that referenced this issue Sep 2, 2024
7472-Hostname verification-ut-cmts-1

#7472
ramkumar-k-9286 added a commit that referenced this issue Sep 3, 2024
7472-Hostname verification-ut-cmts-2

#7472
@utle
Copy link
Member

utle commented Sep 3, 2024

ramkumar-k-9286 added a commit that referenced this issue Sep 6, 2024
7472-Hostname verification-Dvd-cmts-1

#7472
ramkumar-k-9286 added a commit that referenced this issue Sep 6, 2024
7472-Hostname verification-Dvd-cmts-2

#7472
ramkumar-k-9286 added a commit that referenced this issue Sep 6, 2024
7472-Hostname verification-Dvd-cmts-3

#7472
ramkumar-k-9286 added a commit that referenced this issue Sep 9, 2024
7472-Hostname verification-Dvd-cmts-4

#7472
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants