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

[v1.14] fqdn: Add Protocol to DNS Proxy Cache #31801

Commits on Apr 5, 2024

  1. fqdn: Update DNS Restore to Index to PortProto

    [ upstream commit 1941679 ]
    
    DNS Proxy needs to account for protocol when indexing
    L7 DNS rules that it needs to adhere to, otherwise
    L7 rules with differing port-protocols can override
    each other (nondeterministically) and create overly
    restrictive, and incorrect DNS rules. The problem with
    accounting for protocol is that Endpoint restoration
    logic uses DNS rules that index to port-only as JSON
    saved to disk. Adding an additional protocol index to
    a map structure changes the JSON structure and breaks
    restoration logic between Cilium versions.
    
    This change makes the map index backwards compatible,
    since it changes the index from a uint16 to a uint32,
    both of which marshal the same into a JSON structure.
    The endpoint restoration logic will succeed between
    versions, because the older version will be
    automatically differentiated with a lack of a 1-bit
    at bit position 24. Version 2 will save a 1 bit at the
    24th bit going forward to differentiate when protocol
    is indexed or not present.
    
    Signed-off-by: Nate Sweet <nathanjsweet@pm.me>
    nathanjsweet committed Apr 5, 2024
    Configuration menu
    Copy the full SHA
    3297bec View commit details
    Browse the repository at this point in the history

Commits on Apr 8, 2024

  1. fqdn: Add Protocol to DNS Proxy Cache

    [ upstream commit bc7fbf3 ]
    
    DNS Proxy indexes domain selectors by port
    only. In cases where protocols collide on port
    the DNS proxy may have a more restrictive selector
    than it should because it does not merge port
    protocols for L7 policies (only ports).
    
    All callers of the DNS Proxy are updated
    to add protocol to any DNS Proxy entries, and all
    tests are updated to test for port-protocol
    merge errors.
    
    Signed-off-by: Nate Sweet <nathanjsweet@pm.me>
    nathanjsweet committed Apr 8, 2024
    Configuration menu
    Copy the full SHA
    a72e6ae View commit details
    Browse the repository at this point in the history
  2. endpoint: Create a New Restore Field for DNS

    [ upstream commit 6baab36 ]
    
    DNSRulesV2 accounts for protocol and DNSRules does not.
    DNSProxy needs to account for both, and endpoint needs
    to be able to restore from a downgrade. DNSRulesV2 is used
    by default now, but DNSRules is maintained in case of a
    downgrade.
    
    Signed-off-by: Nate Sweet <nathanjsweet@pm.me>
    nathanjsweet committed Apr 8, 2024
    Configuration menu
    Copy the full SHA
    1d8729a View commit details
    Browse the repository at this point in the history
  3. fqdn: Fallback to Version 1 Port Lookups

    [ upstream commit abd7c6e ]
    
    In cases where a port-protocol is not present
    in an restored port protocol, look up
    up the Version 1 version of the PortoProto
    in case a Version 1 PortProto was restored.
    
    Signed-off-by: Nate Sweet <nathanjsweet@pm.me>
    nathanjsweet committed Apr 8, 2024
    Configuration menu
    Copy the full SHA
    edf95d8 View commit details
    Browse the repository at this point in the history
  4. testing: Update Restore Sort Method Signatrues

    [ upstream commit 5185252 ]
    
    The Sort methods are updated to take an unused
    testing.T structure to indicate to all callers
    that they are only for testing purposes.
    
    Signed-off-by: Nate Sweet <nathanjsweet@pm.me>
    nathanjsweet committed Apr 8, 2024
    Configuration menu
    Copy the full SHA
    3546693 View commit details
    Browse the repository at this point in the history