envoy icon indicating copy to clipboard operation
envoy copied to clipboard

external authorization: set the SNI value from server name if it isn't available on the connection/socket

Open marc-barry opened this issue 9 months ago • 2 comments

This is my first commit to the Envoy project and I haven't written C++ in many years. I'm still navigating the types and hierarchy and best practices for obtaining the data I need to complete this pull request. I have started in draft first to see the CI processes and look at how the tests run and if my changes cause any issues with current tests.

Commit Message: external authorization: set the SNI value from server name if it isn't available on the connection/socket Additional Description: Leverages the TLS inspectors server name value, if one was set. Risk Level: low Testing: TBD Docs Changes: N/A Release Notes: exterbal authorization Platform Specific Features: N/A [Optional Runtime guard:] Fixes https://github.com/envoyproxy/envoy/issues/34002 [Optional Fixes commit #PR or SHA] [Optional Deprecated:] [Optional API Considerations:]

marc-barry avatar May 12 '24 03:05 marc-barry

Hi @marc-barry, welcome and thank you for your contribution.

We will try to review your Pull Request as quickly as possible.

In the meantime, please take a look at the contribution guidelines if you have not done so already.

:cat:

Caused by: https://github.com/envoyproxy/envoy/pull/34100 was opened by marc-barry.

see: more, trace.

As a reminder, PRs marked as draft will not be automatically assigned reviewers, or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

:cat:

Caused by: https://github.com/envoyproxy/envoy/pull/34100 was opened by marc-barry.

see: more, trace.

I'm unable to determine which of the unit tests in envoy/test/extensions/filters/common/ext_authz/check_request_utils_test.cc is failing. I know that is the location that CI reports to me but I don't know the Envoy CI system well enough to know how to determine which tests is the issue.

marc-barry avatar May 13 '24 19:05 marc-barry

I'm unable to determine which of the unit tests in envoy/test/extensions/filters/common/ext_authz/check_request_utils_test.cc is failing. I know that is the location that CI reports to me but I don't know the Envoy CI system well enough to know how to determine which tests is the issue.

A passing by comment:

In the envoy-presubmit Azure Pipelines, click on View more details on Azure Pipelines at the bottom. That'll bring you to the Azure Devops Pipelines and simply click on the error.

This is the actual error: https://dev.azure.com/cncf/envoy/_build/results?buildId=170326&view=logs&j=8c169225-0ae8-53bd-947f-07cb81846cb5&t=d1a98671-b7ba-5fbf-f06c-ff337c010df4&l=249

fredyw avatar May 13 '24 19:05 fredyw

I'm working on tests now. Both for the new functionality and addressing the tests that this new functionality is causing to fail.

marc-barry avatar May 14 '24 16:05 marc-barry

@ggreenway I addressed all you comments. I added a new unit test for TCP and then adapted callHttpCheckAndValidateRequestAttributes, which is called by the HTTP tests, to conditionally perform a check using the correct source of the SNI value for comparison. I also adapted the existing CheckAttrContextPeerTLSSession test to have some additional checks that certain functions are called a certain number of times, such as requestedServerName().

marc-barry avatar May 15 '24 13:05 marc-barry

@ggreenway is there anything I need to do for that failing check? It does look to me that it might be CI flakiness but perhaps there is an underlying issue that needs my attention.

marc-barry avatar May 15 '24 20:05 marc-barry

That's a weird error; pretty sure you didn't cause it. I'm re-running the failing job to see if it passes.

ggreenway avatar May 15 '24 20:05 ggreenway