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

vsock_proxy: Perform DNS resolution after the expiration of the TTL #606

Merged
merged 10 commits into from
Apr 11, 2024

Conversation

meerd
Copy link
Contributor

@meerd meerd commented Apr 11, 2024

Description of changes: This PR addresses the wrong assumption that domain names are resolved to fixed static IP addresses. With these changes, vsock-proxy periodically refreshes the resolved IP address of the remote host after the Time-To-Live (TTL) expires, ensuring that the most up-to-date IP address is used.

Relevant issues: #553

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Note: This new PR replaces #593 which was merged to another branch by mistake.

meerd added 10 commits April 11, 2024 19:23
Use an enumeration type (IpAddrType) instead of boolean variables
to represent different IP address types.

Signed-off-by: Erdem Meydanli <[email protected]>
- Create a new module 'dns.rs' to encapsulate DNS-related operations.
- Move existing DNS-related functionality into the new 'dns.rs' module.
- Rename 'parse_addr' function to 'resolve' for better semantic clarity.

Signed-off-by: Erdem Meydanli <[email protected]>
Rename starter.rs module to proxy.rs to better reflect its purpose.

Signed-off-by: Erdem Meydanli <[email protected]>
Perform allowlisted hosts' check before creating a Proxy instance and
terminate the application if necessary.

Signed-off-by: Erdem Meydanli <[email protected]>
The proxy used to resolve the server hostname only once during its
startup. This behavior was creating issues where the DNS addresses changed
frequently. This commit changes the behavior to resolve DNS each time after
the TTL expires.

Signed-off-by: Erdem Meydanli <[email protected]>
This commit resolves all errors and warnings that surfaced
after upgrading from rustc v1.60 to v1.68.2.

Signed-off-by: Erdem Meydanli <[email protected]>
Modify the signature of `dns::resolve` function to return a `DnsResolveResult`
struct instead of a plain vector of IP addresses.

Signed-off-by: Erdem Meydanli <[email protected]>
Add tests for the dns module to improve coverage.

Signed-off-by: Erdem Meydanli <[email protected]>
Replace DnsResolveResult with DnsResolutionInfo. The new type includes
utility methods and provides a better interface for DNS resolution
information, encapsulating resolved IP address, TTL value, and last
resolution time.

Signed-off-by: Erdem Meydanli <[email protected]>
This commit marks the new release of the vsock_proxy, setting the
version to 1.0.0.

Signed-off-by: Erdem Meydanli <[email protected]>
@meerd meerd self-assigned this Apr 11, 2024
@meerd meerd merged commit 8c50ffd into aws:main Apr 11, 2024
9 checks passed
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