-
Notifications
You must be signed in to change notification settings - Fork 5
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
enrich network neighbors with DNS data #144
Conversation
Signed-off-by: Daniel-GrunbergerCA <[email protected]>
Signed-off-by: Daniel-GrunbergerCA <[email protected]>
Signed-off-by: Daniel-GrunbergerCA <[email protected]>
Signed-off-by: Daniel-GrunbergerCA <[email protected]>
Signed-off-by: Daniel-GrunbergerCA <[email protected]>
Signed-off-by: Daniel-GrunbergerCA <[email protected]>
Signed-off-by: Daniel-GrunbergerCA <[email protected]>
Signed-off-by: Daniel-GrunbergerCA <[email protected]>
PR Analysis
PR Feedback
How to use
|
Summary:
|
Signed-off-by: Daniel-GrunbergerCA <[email protected]>
|
||
// DNSManager is used to manage DNS events and save IP resolutions. It exposes an API to resolve IP address to domain name. | ||
type DNSManager struct { | ||
addressToDomainMap maps.SafeMap[string, string] // this map is used to resolve IP address to domain name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to support TTL? in case DNS records change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't it is needed here. Every time I get a new query, it will override the entry on the map. The query will be performed a short time before we handle the network events, so the addresses will be always up-to-date
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks mostly good, feel free to address my comments in a different PR
Summary:
|
PR Type:
Enhancement
PR Description:
This PR introduces the integration of a DNS tracer into the Network Manager. The main changes include:
NetworkNeighbors
with DNS data.network_manager_test.go
file to include tests for the DNS enrichment.container_watcher.go
file to include the DNS manager client.main.go
file to create the DNS manager and pass it to the container watcher.PR Main Files Walkthrough:
files:
pkg/networkmanager/network_manager.go
: Integrated the DNS resolver client into the Network Manager and added logic to enrich network neighbors with DNS data.pkg/containerwatcher/v1/container_watcher.go
: Included the DNS manager client in the container watcher.pkg/containerwatcher/v1/dns.go
: Created a new file to handle DNS tracing, including starting and stopping the tracer.pkg/containerwatcher/v1/container_watcher_private.go
: Added logic to start DNS tracing and Kubernetes resolution.pkg/containerwatcher/dnsmanager/dns_manager.go
: Created a new file for the DNS manager, which handles saving network events.pkg/containerwatcher/dnsmanager/dns_manager_mock.go
: Created a mock version of the DNS manager for testing purposes.pkg/networkmanager/network_manager_test.go
: Refactored the tests to include DNS enrichment.main.go
: Created the DNS manager and passed it to the container watcher during initialization.pkg/containerwatcher/v1/network.go
: Moved the initialization of Kubernetes resolution to a separate function.pkg/containerwatcher/v1/open_test.go
: Adjusted the creation of the container watcher in the test to include the DNS manager.User Description:
This PR adds a DNS tracer and supports the logic for enriching the
NetworkNeighbors
with its data