Validate DNS monitoring port range and harden empty-list fallback#51842
Draft
jmw51798 wants to merge 1 commit into
Draft
Validate DNS monitoring port range and harden empty-list fallback#51842jmw51798 wants to merge 1 commit into
jmw51798 wants to merge 1 commit into
Conversation
Builds on the generic string-to-numeric-slice env-var parsing (EnableStringUnmarshal) by adding DNS-port-specific sanitization in config.New(): - Reject out-of-range ports (must be 1-65535) in addition to the existing HTTP-port (80/443) removal. Out-of-range values corrupt the eBPF LOAD_CONSTANT slot encoding and silently disable the filter. - Sanitize first, then fall back to [53]. Previously the fallback ran before HTTP removal, so a config of only invalid/HTTP ports (e.g. "80 443") left the list empty — disabling DNS monitoring on the eBPF path and capturing all traffic on the classic-BPF path. Expands TestDNSMonitoringPorts with out-of-range, all-invalid, and fallback cases. A single malformed token now fails the whole env-var parse (the generic converter is all-or-nothing, not per-element zero coercion) and falls back to the default. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
Contributor
Files inventory check summaryFile checks results against ancestor 8c345ccd: Results for datadog-agent_7.81.0~devel.git.437.ba05917.pipeline.117221930-1_amd64.deb:No change detected |
Contributor
Static quality checks✅ Please find below the results from static quality gates Successful checksInfo
5 successful checks with minimal change (< 2 KiB)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds on the generic string-to-numeric-slice env-var parsing (EnableStringUnmarshal) by adding DNS-port-specific sanitization in config.New():
Expands TestDNSMonitoringPorts with out-of-range, all-invalid, and fallback cases. A single malformed token now fails the whole env-var parse (the generic converter is all-or-nothing, not per-element zero coercion) and falls back to the default.
What does this PR do?
Motivation
Describe how you validated your changes
Additional Notes