.Net Core module install

IMPORTANT

This guide only applies to Next-Gen WAF customers with access to the Next-Gen WAF control panel. If you have access to the Next-Gen WAF product in the Fastly control panel, you can only deploy the Next-Gen WAF with the Edge WAF deployment method.

Requirements

  • .NET Core 2.1 or later.
  • Verify you have installed the Next-Gen WAF agent for your platform (e.g., Linux or Windows). Check out our Getting started with the agent guide.

Installation

  1. Download the latest Signal Sciences HTTP middleware using one these methods:

  2. Add the Signal Sciences HTTP middleware to your project. Replace <packagePath> with the path to SignalSciences.HttpMiddleware.<version>.nupkg and <sourcePath> with the folder-based package source to which the package will be added:

    nuget add <packagePath> -Source <sourcePath> -Expand
    dotnet add package SignalSciences.HttpMiddleware -s <sourcePath>
  3. Add the following sections to your application's appsettings.json file:

    1{
    2 "SigsciOptions": {
    3 "AgentEndPoint": "127.0.0.1:2345"
    4 }
    5}
  4. Configure the HTTP request pipeline with Configure:

    1Configure(IApplicationBuilder app, IHostingEnvironment env) {
    2 var sigsciOptions = Configuration.GetSection("SigsciOptions").Get<SigSciOptions>();
    3 app.UseSigSciHandler(sigsciOptions);
    4}
  5. Restart the web site service.

NOTE

Ensure the AgentEndPoint value is set to the same IP and port configured with the Next-Gen WAF agent's rpc-address value. See the Windows agent installation documentation for additional information about Windows agent configuration options.

.NET Core module configuration

OptionDefaultDescription
AgentEndPointrequired, no defaultThe TCP endpoint (host:port) that the Agent is listening on. host can be either a hostname or an IPv4 or IPv6 address.
AgentRpcTimeoutMillisoptional, default: 200Maximum number of milliseconds allowed for each RPC call to the Agent.
MaxPostSizeoptional, default: 100000A request body above this size will not be sent to the Agent.
AnomalySizeoptional, default: 524288If the HTTP response is this size or larger, log it with the Agent.
AnomalyDurationMillisoptional, default: 1000If the response took longer than this number of milliseconds, log it with the Agent.
ExpectedContentTypesoptional, no defaultAdds custom types that allow inspection to the conditional content-type list.

Sample advanced .NET Core module configuration

1{
2 "SigsciOptions": {
3 "AnomalySize": 200000,
4 "AgentRPCTimeoutMillis": 200,
5 "MaxPostSize": 50000,
6 "AnomalyDurationMillis": 1000,
7 "AgentEndPoint": "127.0.0.1:2345",
8 "ExpectedContentTypes": "application/custom-abc application/hal-test"
9 }
10}
Was this guide helpful?

Do not use this form to send sensitive information. If you need assistance, contact support. This form is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.