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

Backport of ext-authz Envoy extension: support localhost as a valid target URI. into release/1.16.x #17837

Conversation

hc-github-team-consul-core
Copy link
Collaborator

Backport

This PR is auto-generated from #17821 to be assessed for backporting due to the inclusion of the label backport/1.16.

The below text is copied from the body of the original PR.


Description

This PR fixes a bug in the builtin/ext-authz extension when using localhost as the target URI. When using an upstream on the localhost network we configure a STATIC cluster type that requires using an IP address. The extension was configuring the cluster with the localhost hostname, which caused Envoy to reject the xDS configuration update with an error similar to:

2023-06-20T16:27:39.907Z [ERROR] agent.envoy.xds: got error response from envoy proxy: service_id=default/default/api-5f54fbf97-vkpgr-api-sidecar-proxy typeUrl=type.googleapis.com/envoy.config.cluster.v3.Cluster xdsVersion=v3 nonce=00000006 error="rpc error: code = Internal desc = Error adding/updating cluster(s) local_ext_authz: malformed IP address: localhost. Consider setting resolver_name or setting cluster type to 'STRICT_DNS' or 'LOGICAL_DNS'"

Testing & Reproduction steps

  • I found this testing the ext_authz extension using Consul on k8s.
    • I tested the fix successfully in this same environment
  • I've updated the agent/xds golden tests to ensure that IP addresses result in a STATIC cluster type and that localhost results in a STRICT_DNS cluster type, when creating the cluster definition.
  • Added some additional unit tests to the ext-authz extension to cover some additional error cases.

PR Checklist

  • updated test coverage
  • external facing docs updated
  • appropriate backport labels added
  • not a security concern

Overview of commits

@hc-github-team-consul-core hc-github-team-consul-core requested a review from a team as a code owner June 21, 2023 20:43
@hc-github-team-consul-core hc-github-team-consul-core force-pushed the backport/cthain/net-4631/translate-localhost-to-ip/preferably-quiet-snail branch from 8b0e043 to 5c2e32d Compare June 21, 2023 20:43
@hc-github-team-consul-core hc-github-team-consul-core force-pushed the backport/cthain/net-4631/translate-localhost-to-ip/preferably-quiet-snail branch 2 times, most recently from 042c8ac to 1f11586 Compare June 21, 2023 20:43
@hc-github-team-consul-core hc-github-team-consul-core enabled auto-merge (squash) June 21, 2023 20:43
@github-actions github-actions bot added type/docs Documentation needs to be created/updated/clarified theme/envoy/xds Related to Envoy support labels Jun 21, 2023
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto approved Consul Bot automated PR

@hc-github-team-consul-core hc-github-team-consul-core merged commit 7b2bb33 into release/1.16.x Jun 21, 2023
@hc-github-team-consul-core hc-github-team-consul-core deleted the backport/cthain/net-4631/translate-localhost-to-ip/preferably-quiet-snail branch June 21, 2023 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/envoy/xds Related to Envoy support type/docs Documentation needs to be created/updated/clarified
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants