Skip to content

Commit ca97c96

Browse files
authored
Apply suggestions from code review
1 parent a183043 commit ca97c96

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

src/content/docs/bff/fundamentals/options.md

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -201,16 +201,14 @@ The following options are available:
201201
ms.
202202

203203

204-
# XForward header configuration
204+
# Proxy Servers and Load Balancers :badge[v4.0]
205205

206-
Added in V4
206+
When your BFF is hosted behind another reverse proxy or load balancer, you'll want to use `X-Forwarded-*` headers.
207207

208-
Should BFF run behind another proxy, then you'll want to use X-Forwarded headers.
209-
210-
BFF automatically registers the XForward header middleware in the pipeline. However,
211-
it doesn't do anything without configuration. Below is an example on how you can confiugre this.
208+
BFF automatically registers the `ForwardedHeaders` middleware in the pipeline, without any additional configuration. You will need to configure which headers should be considered by the middleware, typically the `X-Forwarded-For` and `X-Forwarded-Proto` headers. Here's an example of how you can configure this.
212209

213210
```csharp
211+
// Program.cs
214212
builder.Services.Configure<ForwardedHeadersOptions>(options =>
215213
{
216214
// Consider configuring the 'KnownProxies' and the 'AllowedHosts' to prevent IP spoofing attacks
@@ -219,12 +217,11 @@ builder.Services.Configure<ForwardedHeadersOptions>(options =>
219217
});
220218
```
221219

222-
See [proxy-load-balancer](https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/proxy-load-balancer?view=aspnetcore-9.0) in the microsoft documentation
223-
for more information.
220+
See [proxy servers and load balancers](https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/proxy-load-balancer?view=aspnetcore-9.0) in the Microsoft documentation for more information.
224221

225222
:::note
226-
Be careful with XForward headers from untrusted sources. This can leave you vulnerable to IP Spoofing attacks.
227-
See [Microsoft Security Advisory CVE-2018-0787](https://github.com/aspnet/Announcements/issues/295) for information
228-
on an elevation-of-privileges vulnerability that affects systems where the proxy doesn't validate or restrict Host headers to known good values.
223+
Be careful processing `X-Forwarded-*` headers from untrusted sources. Accepting these headers without validating the proxy IP address or network origin may leave you vulnerable to IP Spoofing attacks.
229224

225+
See [Microsoft Security Advisory CVE-2018-0787](https://github.com/aspnet/Announcements/issues/295) for information
226+
on an elevation-of-privileges vulnerability that affects systems where the proxy doesn't validate or restrict `Host` headers to known good values.
230227
:::

0 commit comments

Comments
 (0)