Git Product home page Git Product logo

rebuff's Introduction

Firewall as a Service

Packet inspection for:

  • SQL injections
  • ??? Mitigation of DoS and DDoS attacks Deny common attacks

What's needed?

  • DNS roundrobin in front of...
  • ?x servers
  • iptables for control
  • something to inspect every packet?

Anatomy of a SecRule

Every request is checked by and returns:

  • part of the request (REQUEST_FILENAME|ARGS_NAMES|ARGS|XML)
  • log of attack blocked
  • severity

class Rebuff

def call(env) request = Rack::Request.new(env) headers = Rack::Utils::HeaderHash.new customer = Customer.find(env.headers.customer_id)

if customer.bad_requests.include?(/request.body/)
  [500, {}, []]
end

env.each do |key, value|
  if key =~ /HTTP_(.*)/
    headers[$1] = value
  end
end

result = Net::HTTP.start(@host, @port) do |http|
  method = rack_request.request_method
  case method
  when "GET", "HEAD", "DELETE", "OPTIONS", "TRACE"
    req = Net::HTTP.const_get(method.capitalize).new(request.fullpath, headers)
  when "PUT", "POST"
    req = Net::HTTP.const_get(method.capitalize).new(request.fullpath, headers)
  else
    raise "Method not supported: #{method}"
  end
  
  http.request(result)
end

[result.code, Rack::Utils::HeaderHash.new(result.to_hash), [result.body]]

end end

Issues

  • Bandwidth. Who pays for it?
  • let's say that Jimmy User does a promotion of some sort that suddenly gets hella hits. all that shit coming from a couple of IPs is so gonna get flagged and ACL'd as a DoS. logic dictates that you're going to be the one that gets the support call.
  • How is ssl encryption/decryption handled?

rebuff's People

Watchers

Dennis Walters avatar Ian Morgan avatar James Cloos avatar

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.