Skip to content

proxy_protocol_filter: Add configuration to match only specific proxy protocol versions, new stats#32861

Merged
yanavlasov merged 36 commits intoenvoyproxy:mainfrom
nareddyt:pp-allowed-versions-stats
Mar 29, 2024
Merged

proxy_protocol_filter: Add configuration to match only specific proxy protocol versions, new stats#32861
yanavlasov merged 36 commits intoenvoyproxy:mainfrom
nareddyt:pp-allowed-versions-stats

Conversation

@nareddyt
Copy link
Contributor

@nareddyt nareddyt commented Mar 12, 2024

Commit Message:
proxy_protocol_filter: Configuration to match only specific proxy protocol versions, new stats

Additional Description:
Currently the Proxy Protocol Listener filter will try to match incoming connections against both proxy protocol v1 and v2 signatures. While this is convenient, it:

  • Increases the attack surface of the filter.
  • (when allow_requests_without_proxy_protocol is enabled) Increases the chance of signature conflicts between proxy protocol v1 requests and non-proxy protocol requests.

This change adds a new config option disallowed_versions that scopes down the set of proxy protocol versions that the filter matches. The configuration is optional and defaults to current behavior when not specified.

This change also adds new statistics per matched proxy protocol version. See doc update for details.

downstream_cx_proxy_proto.not_found_disallowed
downstream_cx_proxy_proto.not_found_allowed
downstream_cx_proxy_proto.v1.found
downstream_cx_proxy_proto.v1.disallowed
downstream_cx_proxy_proto.v1.error
downstream_cx_proxy_proto.v2.found
downstream_cx_proxy_proto.v2.disallowed
downstream_cx_proxy_proto.v2.error

Pre-existing stat downstream_cx_proxy_proto_error is kept at it's own scope for backwards-compatibility.

Risk Level: Low

  • All client-facing behavior changes are guarded by new filter config field.
  • Only default behavior change is incrementing new counters.

Testing:

  • Extensive unit tests
  • Some integration tests

Docs Changes:
Updated proto and filter docs

Release Notes:
Updated

Platform Specific Features:
N/A

Fixes #32425

Signed-off-by: Teju Nareddy <tnareddy@confluent.io>
Signed-off-by: Teju Nareddy <tnareddy@confluent.io>
Signed-off-by: Teju Nareddy <tnareddy@confluent.io>
Signed-off-by: Teju Nareddy <tnareddy@confluent.io>
Signed-off-by: Teju Nareddy <tnareddy@confluent.io>
@repokitteh-read-only
Copy link

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/).
envoyproxy/api-shepherds assignee is @markdroth
CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/).

🐱

Caused by: #32861 was opened by nareddyt.

see: more, trace.

Signed-off-by: Teju Nareddy <tnareddy@confluent.io>
Signed-off-by: Teju Nareddy <tnareddy@confluent.io>
@nareddyt
Copy link
Contributor Author

/review @fzhong-connect

@repokitteh-read-only
Copy link

nareddyt is not a collaborator, thus allowed to assign users.

🐱

Caused by: a #32861 (comment) was created by @nareddyt.

see: more, trace.

@nareddyt
Copy link
Contributor Author

cc @fzhong-connect @jaysonjdmello

Signed-off-by: Teju Nareddy <tnareddy@confluent.io>
Signed-off-by: Teju Nareddy <tnareddy@confluent.io>
@nareddyt nareddyt requested a review from ggreenway March 13, 2024 15:26
Signed-off-by: Teju Nareddy <tnareddy@confluent.io>
Signed-off-by: Teju Nareddy <tnareddy@confluent.io>
Signed-off-by: Teju Nareddy <tnareddy@confluent.io>
@nareddyt
Copy link
Contributor Author

@markdroth or @envoyproxy/api-shepherds PTAL, we have a question for you in the comments.

@nareddyt nareddyt requested review from ggreenway and soulxu March 18, 2024 15:45
@nareddyt
Copy link
Contributor Author

PTAL

@nareddyt
Copy link
Contributor Author

/retest

Copy link
Member

@ggreenway ggreenway left a comment

Choose a reason for hiding this comment

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

/wait

Signed-off-by: Teju Nareddy <tnareddy@confluent.io>
@nareddyt
Copy link
Contributor Author

/retest

@nareddyt
Copy link
Contributor Author

Ready for review @ggreenway . Not sure how to re-run the flaky CI failure

Copy link
Member

@ggreenway ggreenway left a comment

Choose a reason for hiding this comment

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

This mostly LGTM, aside from these small details.

I'm going to be out for awhile starting tomorrow, so one of the other maintainers will need to finish review of this and get it merged.

/wait

@ggreenway ggreenway removed their assignment Mar 27, 2024
Signed-off-by: Teju Nareddy <tnareddy@confluent.io>
Signed-off-by: Teju Nareddy <tnareddy@confluent.io>
Signed-off-by: Teju Nareddy <tnareddy@confluent.io>
@nareddyt
Copy link
Contributor Author

This mostly LGTM, aside from these small details.

I'm going to be out for awhile starting tomorrow, so one of the other maintainers will need to finish review of this and get it merged.

Thanks @ggreenway . If you have time, feel free to review today. Slightly worried Github may not let other reviewers merge as the status checks say:

1 review requesting changes by reviewers with write access. Merging can be performed automatically once the requested changes are addressed.

But no worries if you have taken off already, I can ping other reviewers tomorrow. Thanks for the thorough feedback!

@nareddyt
Copy link
Contributor Author

/retest

@yanavlasov yanavlasov dismissed ggreenway’s stale review March 29, 2024 23:05

Comments were addressed

@yanavlasov yanavlasov merged commit 113e997 into envoyproxy:main Mar 29, 2024
nareddyt added a commit to nareddyt/envoy that referenced this pull request Apr 1, 2024
… protocol versions, new stats (envoyproxy#32861)

---------

Signed-off-by: Teju Nareddy <tnareddy@confluent.io>
nareddyt added a commit to nareddyt/envoy that referenced this pull request Apr 11, 2024
… protocol versions, new stats (envoyproxy#32861)

---------

Signed-off-by: Teju Nareddy <tnareddy@confluent.io>
alyssawilk pushed a commit to alyssawilk/envoy that referenced this pull request Apr 29, 2024
… protocol versions, new stats (envoyproxy#32861)


---------

Signed-off-by: Teju Nareddy <tnareddy@confluent.io>
jmarantz pushed a commit that referenced this pull request Jun 10, 2024
…ation (#34414)

Commit Message:
proxy_protocol_filter: Add field stat_prefix to the filter configuration

Additional Description:
This field allows for differentiating statistics when multiple proxy protocol listener filters are configured.

This PR is a follow-up from previous conversation: #32861 (comment)

Risk Level: Low

All client-facing behavior changes are guarded by new filter config field.
Testing:

Stats unit tests
Proxy protocol listener filter integration tests
Docs Changes:
Done

Release Notes:
Done

Platform Specific Features:
None

Signed-off-by: Teju Nareddy <tnareddy@confluent.io>
nareddyt added a commit to nareddyt/envoy that referenced this pull request Jun 10, 2024
…ation (envoyproxy#34414)

Commit Message:
proxy_protocol_filter: Add field stat_prefix to the filter configuration

Additional Description:
This field allows for differentiating statistics when multiple proxy protocol listener filters are configured.

This PR is a follow-up from previous conversation: envoyproxy#32861 (comment)

Risk Level: Low

All client-facing behavior changes are guarded by new filter config field.
Testing:

Stats unit tests
Proxy protocol listener filter integration tests
Docs Changes:
Done

Release Notes:
Done

Platform Specific Features:
None

Signed-off-by: Teju Nareddy <tnareddy@confluent.io>
nareddyt added a commit to nareddyt/envoy that referenced this pull request Oct 14, 2024
…ation (envoyproxy#34414)

Commit Message:
proxy_protocol_filter: Add field stat_prefix to the filter configuration

Additional Description:
This field allows for differentiating statistics when multiple proxy protocol listener filters are configured.

This PR is a follow-up from previous conversation: envoyproxy#32861 (comment)

Risk Level: Low

All client-facing behavior changes are guarded by new filter config field.
Testing:

Stats unit tests
Proxy protocol listener filter integration tests
Docs Changes:
Done

Release Notes:
Done

Platform Specific Features:
None

Signed-off-by: Teju Nareddy <tnareddy@confluent.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

proxy_protocol listener filter: Allow configuration for specific proxy protocol version

6 participants