.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
    3
    4
    5
    {
    "SigsciOptions": {
    "AgentEndPoint": "127.0.0.1:2345"
    }
    }
  4. Configure the HTTP request pipeline with Configure:

    1
    2
    3
    4
    Configure(IApplicationBuilder app, IHostingEnvironment env) {
    var sigsciOptions = Configuration.GetSection("SigsciOptions").Get<SigSciOptions>();
    app.UseSigSciHandler(sigsciOptions);
    }
  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
3
4
5
6
7
8
9
10
{
"SigsciOptions": {
"AnomalySize": 200000,
"AgentRPCTimeoutMillis": 200,
"MaxPostSize": 50000,
"AnomalyDurationMillis": 1000,
"AgentEndPoint": "127.0.0.1:2345",
"ExpectedContentTypes": "application/custom-abc application/hal-test"
}
}
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.