GithubHelp home page GithubHelp logo

fge2016 / lua-resty-t1k Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chaitin/lua-resty-t1k

0.0 1.0 0.0 29 KB

Lua implementation of the T1K protocol for Chaitin/SafeLine WAF

License: Apache License 2.0

Perl 69.58% Lua 30.11% Dockerfile 0.31%

lua-resty-t1k's Introduction

lua-resty-t1k

LuaRocks Releases License

Name

Lua implementation of the T1K protocol for Chaitin/SafeLine Web Application Firewall.

Status

Production ready.

Test

Installation

luarocks install lua-resty-t1k

If you are in Mainland China

luarocks install lua-resty-t1k --server https://luarocks.cn

Synopsis

 location / {
     access_by_lua_block {
         local t1k = require "resty.t1k"

         local t = {
             mode = "block",                            -- block or monitor or off, default off
             host = "unix:/workdir/snserver.sock",      -- required, SafeLine WAF detection service host, unix domain socket, IP, or domain is supported, string
             port = 8000,                               -- required when the host is an IP or domain, SafeLine WAF detection service port, integer
             connect_timeout = 1000,                    -- connect timeout, in milliseconds, integer, default 1s (1000ms)
             send_timeout = 1000,                       -- send timeout, in milliseconds, integer, default 1s (1000ms)
             read_timeout = 1000,                       -- read timeout, in milliseconds, integer, default 1s (1000ms)
             req_body_size = 1024,                      -- request body size, in KB, integer, default 1MB (1024KB)
             keepalive_size = 256,                      -- maximum concurrent idle connections to the SafeLine WAF detection service, integer, default 256
             keepalive_timeout = 60000,                 -- idle connection timeout, in milliseconds, integer, default 60s (60000ms)
             remote_addr = "http_x_forwarded_for: 1",   -- remote address from ngx.var.VARIABLE, string, default from ngx.var.remote_addr
         }

         local ok, err, _ = t1k.do_access(t, true)
         if not ok then
             ngx.log(ngx.ERR, err)
         end
     }

     header_filter_by_lua_block {
        local t1k = require "resty.t1k"
        t1k.do_header_filter()
     }
 }

lua-resty-t1k's People

Contributors

blaisewang avatar monkeydluffy6017 avatar

Watchers

 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.