mirror of
https://github.com/potats0/lua-resty-coraza.git
synced 2025-06-28 17:41:00 +03:00
update readme
This commit is contained in:
parent
25a5ea7815
commit
8e56e86b5d
1
dist.ini
1
dist.ini
@ -7,5 +7,6 @@ lib_dir = lib
|
|||||||
doc_dir = lib
|
doc_dir = lib
|
||||||
repo_link = https://github.com/potats0/lua-resty-coraza
|
repo_link = https://github.com/potats0/lua-resty-coraza
|
||||||
main_module = lib/resty/coraza.lua
|
main_module = lib/resty/coraza.lua
|
||||||
|
version = "1.0.1"
|
||||||
requires = luajit
|
requires = luajit
|
||||||
exclude_files=*.rockspec
|
exclude_files=*.rockspec
|
@ -7,28 +7,8 @@ Lua implementation of the [libcoraza](https://github.com/corazawaf/libcoraza) fo
|
|||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
### dependence
|
|
||||||
#### 1. libcoraza-nginx
|
|
||||||
1. clone the repository
|
|
||||||
`git clone https://github.com/potats0/coraza.git`
|
|
||||||
|
|
||||||
2. Build the source && Installation
|
|
||||||
```
|
|
||||||
cd coraza
|
|
||||||
./build.sh
|
|
||||||
./configure
|
|
||||||
make
|
|
||||||
sudo make install
|
|
||||||
```
|
|
||||||
`libcoraza.so` will be installed at `/usr/local/lib`
|
|
||||||
|
|
||||||
#### 2. Coreruleset
|
|
||||||
1. clone the repository
|
|
||||||
`git clone https://github.com/coreruleset/coreruleset`
|
|
||||||
|
|
||||||
### lua-resty-coraza
|
|
||||||
```bash
|
```bash
|
||||||
opm get potats0/lua-resty-coraza
|
luarocks install lua-resty-t1k
|
||||||
```
|
```
|
||||||
|
|
||||||
## Synopsis
|
## Synopsis
|
||||||
@ -38,10 +18,10 @@ opm get potats0/lua-resty-coraza
|
|||||||
init_worker_by_lua_block{
|
init_worker_by_lua_block{
|
||||||
coraza = require "resty.coraza"
|
coraza = require "resty.coraza"
|
||||||
waf = coraza.create_waf()
|
waf = coraza.create_waf()
|
||||||
-- add custom rule based on modsecurity from file,
|
-- add rule from file
|
||||||
coraza.rules_add_file(waf, "%s/t/coraza.conf")
|
coraza.rules_add_file(waf, "%s/t/coraza.conf")
|
||||||
|
|
||||||
-- your Coreruleset, add rule from directive
|
-- your corerule set, add rule from directive
|
||||||
coraza.rules_add(waf, "Include %s/t/coreruleset/crs-setup.conf.example")
|
coraza.rules_add(waf, "Include %s/t/coreruleset/crs-setup.conf.example")
|
||||||
coraza.rules_add(waf, "Include %s/t/coreruleset/rules/*.conf")
|
coraza.rules_add(waf, "Include %s/t/coreruleset/rules/*.conf")
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user