Giter Site home page Giter Site logo

firewall's Introduction

Hi there ๐Ÿ‘‹

  • ๐Ÿ˜€ My name is Dustin...
  • โŒจ๏ธ I code in C#, F# and Go
  • ๐Ÿ‘Œ A little bit of JavaScript and frontend languages too
  • ๐Ÿš€ I maintain a few OSS projects which you can see below...
  • ๐Ÿ’ป I also love blogging on โžก๏ธ dusted.codes โฌ…๏ธ
  • โ˜• I'm massively addicted to coffee
  • ๐Ÿฎ And stopped eating meat in 2๏ธโƒฃ0๏ธโƒฃ1๏ธโƒฃ8๏ธโƒฃ
  • ๐Ÿ  But I still eat the occasional fish
  • ๐Ÿ… My Chinese star sign is tiger ๐Ÿฏ
  • ๐ŸŒ And I love our beautiful planet and wish we'd treat it better
  • ๐Ÿ’บ This was a list of completely random stuff, just like this seat
  • ๐Ÿ“ซ You can reach me via my blog

Some of the web stuff I build:

firewall's People

Contributors

dustinmoris avatar user135711 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

firewall's Issues

Possible to block specific methods/controllers?

Thanks for a nice nuget!

Is it possible to configure it so that it is not on an application leven but more detailed, like having specific IP requirements for a controller/method?

Thanks.

Question

is it possible to protect a specific api's using filter ? also all the requests are coming from cloudflare too

X-Forwarded-For HTTP Header isn't used

I think that the value of X-Forwarded-For is not set in the RemoteIpAddress as stated in the doc. A custom rule is required for load balancers forwarding this header.

Logging?

It would be great if we could log the request from a blocked IP. This is great for analytics, forensics and also to see if perhaps there are some other IPs we should consider allowing (through log analysis). Perhaps ILogger can be injected into the middleware constructor.

Perhaps pass an options via an Action<> param.... i.e.

app.UserFirewall(opts => opts.EnableLogging = true);

and/or

var opts = new FirewallOptions(); app.UserFirewall(opts);

Only deny certain IP addresses

Hi,

I looked through the documentation and source codes, I could not find a built-in way to only block certain IP addresses.

Is it the best way to implement a custom rule by inheriting IFirewallRule and add the logic there?

Block Specific Hosts

Would be great to allow an exclusion style lists as well. Say something like:

DontAllow(List<CIDRs>);
DontAllow(List<IPAddress>);
DontAllow(List<CountryCode>);

Right now, if I want to allow every country, say, except for Micronesia I have to list EVERY country but Micronesia. Same thing if I want to only block a few IPs... That said - great library!!! Thanks for your work!

Except From Localhost not allowing requests from "::1"

I might be missing something but it seems when I hit my service from localhost the remote Ip address is set to "::1" which is not allowed (see screenshot below)

image

Is this not supposed to be allowed as part of the localhost rule?

MVC sample

@dustinmoris,
Please can you upload a MVC sample to this repository?
If country or IP address is not allowed show blocked error page.
if allowed IP continue to home page ๐Ÿ‘

Add support for async rules

I need to support dynamic rules loaded from a DB. Could we get an IAsyncFirewallRule interface where IsAllowed returns ValueTask<bool>?

ExceptFromCloudflare seems to have no effect

 app.UseFirewall(FirewallRulesEngine.DenyAllAccess()
                                            .ExceptFromCloudflare("https://www.cloudflare.com/ips-v4", "https://www.cloudflare.com/ips-v6")
                                            .ExceptFromLocalhost());

Following this example from the documentation in my experience resulted in all requests through Cloudflare being denied. What I am missing?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.