Walter.Web.FireWall
HeaderConfig Class
Members  Example 
Walter.Web.FireWall Assembly > Walter.Web.FireWall.Configurations Namespace : HeaderConfig Class
This allows you to manages header configurations for those headers that are generated and used by the firewall
Object Model
HeaderConfig ClassP3POptions ClassISecurityHeadersBuilder Interface
Syntax
public sealed class HeaderConfig : Walter.Web.FireWall.Headers.ISecurityHeadersBuilder  
Example
Bellow sample shows longer sample of code that configures the firewall as well as enabled CSP and XSS browser based security
services.AddFireWall("Your Token", "Domain Key", domainName: new Uri("https://www.test.dll", UriKind.Absolute), options => {
                 options.JoinCustomerImprovementProgramWithEmail = "mail@test.dll";
                 options.Cypher.ApplicationPassword = "123456Seven";
                 options.ApplicationName = "www.test.dll";
                 options.ApplicationTag = "WS3";
                 options.Rules.AllowWhiteListing = false;
                 //view located in ~/Views/Shared
                 options.Reporting.HealthReportView = "_healthReport";
                 options.Reporting.EmailReportView = "_EmailReport";
            
                 options.WebServices.IsUserApiUrl = new Uri(Links.IsUserEndpoint, UriKind.Relative);
                 options.WebServices.RegisterLinksApiUrl = new Uri(Links.SiteMapEndPoint, UriKind.Relative);
                 options.WebServices.BeaconApiUrl = new Uri(Links.BeaconPoint, UriKind.Relative);
                 options.WebServices.CSPReportUrl = new Uri(Links.CSPViolation, UriKind.Relative);
            
                 options.Cashing.GeoLocation.SlidingExpiration = TimeSpan.FromMinutes(20);
            
                 options.Rules.BlockRequest.BlockDuration.SlideExpiration = true;
                 options.Rules.BlockRequest.BlockDuration.Expires = TimeSpan.FromSeconds(10);
                 options.Rules.AllowWhiteListing = false;
                 options.Rules.Headers.AddDefaultSecurePolicy()
                                       .AddStrictTransportSecurityNoCache()
                                       .AddXssProtectionBlockAndReport()
                                       .AddContentSecurityPolicyButTrust(trustingSites: TrustingSites.Jquery | TrustingSites.Google
                                                 , allowInline: true
                                                 , framesPolicy: FramesPolicy.Self);
            
             //continue configuring add-ons for the firewall
               }).UseGeography(new System.IO.DirectoryInfo("D:\\MaxMind"))
                .UseDiskLogging(options => { options.Directory = @"D:\Firewall"; })
                .UserDatabase(DatabaseConnections.FireWallState)
                .UseFireWallReportingDatabase(DatabaseConnections.FireWall)
                .UseSMTPReportingDatabase(DatabaseConnections.FireWallMail, options =>
                 {
                     options.Archive = TimeSpan.FromDays(180);
                     options.Server = "mail.asp-waf.com";
                     options.UserName = "noreply@test.dll";
                     options.Password = "Jhagga$ki82#@test.dll";
                     options.Port = 25;
                     options.From = "noreply@@test.dll";
                     options.IgnoreServerCertificateErrors = true;
                     options.DefaultEmail = "owner@@test.dll";
                     options.Archive = TimeSpan.FromDays(60);
                     options.MailingList.AddRange(new[] {
                      new EMailAddress("Security Admin","security@@test.dll") {
                          Frequency= TimeSpan.FromHours(1),
                          Roles= EMailRoles.FireWallAdministrationViolations | EMailRoles.UnauthorizedPhysicalFilesViolation } ,
                      new EMailAddress("Website Admin","WebMaster@@test.dll"){
                          Frequency= TimeSpan.FromHours(1),
                          Roles= EMailRoles.ProductUpdates | EMailRoles.OwnAccountRelatedViolations } ,
                       });
               });
             //use filter on each request instead of middleware
             services.AddMvc(options =>  options.Filters.Add<Walter.Web.FireWall.Filters.FireWallFilter>());
Inheritance Hierarchy

System.Object
   Walter.Web.FireWall.Configurations.HeaderConfig

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

HeaderConfig Members
Walter.Web.FireWall.Configurations Namespace