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

Inject reverse DNS info when accepting socket connection #540

Draft
wants to merge 5 commits into
base: palantir-cassandra-2.2.18
Choose a base branch
from

Conversation

rhuffy
Copy link
Contributor

@rhuffy rhuffy commented Sep 3, 2024

Currently, when accepting a socket connection, the server is only able to verify the IP Address of the client. The IP Address that it can verify is the physical interface address used by the client, which may not be present in the certificate SANs. We could instead check if the client hostname is present in SANs.

This PR uses a HostnameResolver to execute a reverse DNS lookup. Since reverse DNS is unsupported in Kubernetes, it uses the local hostname and the predefined formula for Pod hostnames in a StatefulSet to find the mapping of IP Address to Pod Hostname.

We then use reflection to inject this hostname into the InetAddress object returned by the Socket.

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

Successfully merging this pull request may close these issues.

1 participant