Walter.BOM Namespace
Walter.Web.FireWall Namespace
ASP-WAF | .Net API for WAF Systems

GeoBlockAttribute Class

This annotation allows for the granular control GEO blocking in the firewall if GEO blocking modules are registered in service configuration

Namespace:  Walter.Web.FireWall.Annotations
Assembly:  Walter.Web.FireWall (in Walter.Web.FireWall.dll)

Syntax


public sealed class GeoBlockAttribute : BaseFireWallAttribute

Remarks


Download any of the GEO blocking NuGet packages provided for the Firewall or write and register your own. Following NuGet packages are available but do require you to have your own data subscription:

Package NameAPIDatabaseFile
Walter.Web.FireWall.Geo.MaxMindX-X
Walter.Web.FireWall.Geo.IP2LocationXX-
Walter.Web.FireWall.Geo.GoogleX--

To create your own GEO provider implement one of these interfaces 1. ILatLongRepository (city and map coordinates), 2. IGeoAPIFactory (country code via API) 3. IGeoFactory (country code via database or file)

Examples


Register your own GEO blocking middleware
public static IServiceCollection AddGeoBlocking(this IServiceCollection serviceCollection, GeoMethod useMethod)
   {
   //update configuration and set the type of call it makes.
   serviceCollection.Configure<IFireWallConfig>(opt => opt.Geography.UseMethod = useMethod);
   serviceCollection.AddSingleton(typeof(IGeoFactory), typeof(MyGeoRepository));
   return serviceCollection;
   }

Inheritance Hierarchy


Walter.Web.FireWall.Annotations..::..BaseFireWallAttribute
  Walter.Web.FireWall.Annotations..::..GeoBlockAttribute