Skip to content

[meta]: authority issues #4717

@easwars

Description

@easwars

This is a meta-issue to track all the things that we need to fix (or add new functionality) with respect to how :authority is used in gRPC-Go.

  • Determining :authority from the target URI must be the responsibility of the name resolver. See: HTTP2 authority header is not set to resolver.Address.ServerName (?) #4516

    • Add an optional interface, to be implemented by name resolvers or their builders, that contains a single method to return the channel’s authority.
      • This method must not perform any I/O, be non-blocking and the return value must not change over time.
      • This value will be used to populate the :authority pseudo-header, and serverName for TLS handshake by default.
      • gRPC will provide an implementation which conforms to RFC 3986 and returns the path portion of the target, after stripping query parameters. This will be used if the scheme’s name resolver does not provide a custom one.
      • This parsed target will be passed to load balancers in their BuildOptions, with the correct authority set.
  • Add a call option to override the :authority header on a per-RPC basis. client: Add CallOption for setting authority; allow even without WithInsecure #3444

    • An optional interface will be added, to be implemented by AuthInfo implementations, to validate this override.
      • Implementations will need to perform a hostname validation check on the peer certificate, received during the handshake, to validate this override.
      • RPCs will fail if this call option is set, but:
        • AuthInfo for the subChannel does not implement this interface
        • validation by AuthInfo fails
      • Existing TLS based credentials implementations will be enhanced to support this.
      • Insecure credentials will allow for any authority value.
  • Continue to support the per-address serverName override in the addresses returned by the name resolver.

    • This field represents a security risk, since an attacker can specify both the addresses and the serverName to be used and can direct traffic to balancers/hosts controlled by them. This is addressed by the use of the WithAuthority dial option.
    • This override should affect both the :authority header sent in the HEADERS frame and the serverName used for the TLS handshake.
  • Make the WithAuthority dial option work for secure credentials as well.

    • Currently this is supported only for insecure credentials.
    • This needs to influence both, the :authority header and the serverName.
    • This override also disables any per-address overrides specified by the name resolver above.
  • Deprecate the OverrideServerName() method on credentials.TransportCredentials interface.

#RouteLookupService

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions