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

Proxy is hardened so it can directly face the internet #16

Open
analogrelay opened this issue Mar 12, 2020 · 5 comments
Open

Proxy is hardened so it can directly face the internet #16

analogrelay opened this issue Mar 12, 2020 · 5 comments
Labels
Deployment cookbook Base capability is there, but documentation on how to achieve the scenario is required. Priority:0 Used for divisional .NET planning User Story Used for divisional .NET planning
Milestone

Comments

@analogrelay
Copy link
Contributor

analogrelay commented Mar 12, 2020

We expect several features to be add-ins that plug in as connection middleware. Add a connection middleware to the sample in this repo.

Here's one example from Http2:
https://github.com/dotnet/aspnetcore/blob/09bb7b4ca5a4fbde0283c294c35fac8b485c0074/src/Servers/Kestrel/samples/Http2SampleApp/Program.cs#L41-L54

Other things we expect to need to plug into here:

  • Sniff SNI and rate limit
  • Rate limit SSL handshakes by IP

We don't have to write those components as part of this task, just demonstrate that a connection middleware has access to the necessary inputs and controls (e.g. IPs, sniffing the data stream, drop connections, etc.).

Specifically, this involves being able to filter connections based on information contained in the ClientHello TLS frame. Examples include:

  • Cipher Suite selection
  • Protocol Version
  • Server Name Indication (SNI)
  • Application-Level Protocol Negotiation (ALPN; used for HTTP/2 and HTTP/3)
@analogrelay analogrelay added the Type: Enhancement New feature or request label Mar 12, 2020
@analogrelay analogrelay added this to the 1.0.0 milestone Apr 23, 2020
@karelz karelz changed the title Add connection filtering middleware to the sample Add connection filtering (DoS prevention) middleware to the sample Jun 15, 2020
@Tratcher
Copy link
Member

I did a similar connection middleware component here that we should be able to model this on.

@samsp-msft samsp-msft changed the title Add connection filtering (DoS prevention) middleware to the sample Proxy is hardened so it can directly face the internet Oct 21, 2020
@samsp-msft samsp-msft added the User Story Used for divisional .NET planning label Oct 21, 2020
@mguinness
Copy link

mguinness commented Jan 19, 2021

I know that this is outside the scope of the issue, but it would be great to have some middleware to block traffic. Some simple ones being blocking user agents like curl and GeoIP2 country lookup using MaxMind DB Reader. Not looking to build an IDS/IPS, but some simple tools would be nice. Created Web Application Firewall discussion as suggested.

@Tratcher
Copy link
Member

@mguinness I'd suggest moving that question to https://github.com/microsoft/reverse-proxy/discussions.

Blocking like that would be applied at the connection, server, or middleware layer before reaching any of the YARP logic at the routing layer or proxying layers. These scenarios are highly custom and I don't expect we'd be building them as part of the YARP project.

@samsp-msft samsp-msft added the Priority:0 Used for divisional .NET planning label Jan 20, 2021
@karelz karelz added Deployment cookbook Base capability is there, but documentation on how to achieve the scenario is required. and removed Type: Enhancement New feature or request labels Mar 24, 2021
@karelz karelz modified the milestones: YARP 1.0.0, Backlog Mar 24, 2021
@karelz
Copy link
Member

karelz commented Mar 24, 2021

Triage: All is possible using TlsFrameHelper: https://github.com/microsoft/reverse-proxy/blob/main/src/ReverseProxy/Utilities/TlsFrameHelper.cs
We should work with users to create deployment cookbook / how tos.

@karelz karelz modified the milestones: Backlog, YARP 2.0.0 May 24, 2022
@samsp-msft samsp-msft moved this to 📋 Backlog in YARP 2.x Jun 9, 2022
@karelz
Copy link
Member

karelz commented Jun 16, 2022

Triage: Review AppService list to identify things that may be general purpose.

@karelz karelz moved this from 📋 Backlog to 🔖 Ready in YARP 2.x Jun 16, 2022
@samsp-msft samsp-msft moved this from 🔖 Ready to 📋 Backlog in YARP 2.x Jan 9, 2023
@karelz karelz modified the milestones: YARP 2.0.0, Backlog Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deployment cookbook Base capability is there, but documentation on how to achieve the scenario is required. Priority:0 Used for divisional .NET planning User Story Used for divisional .NET planning
Projects
None yet
Development

No branches or pull requests

5 participants