Skip to content

Commit 8d7b93c

Browse files
authored
Merge pull request #11 from bunkerity/dev
Remove "order" key from coraza plugin & fix discord and slack
2 parents 545226e + 0aa84c5 commit 8d7b93c

File tree

3 files changed

+78
-80
lines changed

3 files changed

+78
-80
lines changed

coraza/plugin.json

+62-64
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,65 @@
11
{
2-
"id": "coraza",
3-
"order": 999,
4-
"name": "Coraza",
5-
"description": "Use Coraza as a library to inspect client request",
6-
"version": "0.1",
7-
"stream":"no",
8-
"settings": {
9-
"USE_CORAZA": {
10-
"context": "multisite",
11-
"default": "no",
12-
"help": "Activate Coraza library",
13-
"id": "use coraza library",
14-
"label": "Coraza",
15-
"regex": "^(no|yes)$",
16-
"type": "check"
17-
},
18-
"CORAZA_API": {
19-
"context": "global",
20-
"default": "http://bunkerweb-golang-1:8090",
21-
"help": "Address of the CORAZA API.",
22-
"id": "coraza-api",
23-
"label": "Coraza Api",
24-
"regex": "^.*$",
25-
"type": "text"
26-
},
27-
"USE_OWASP_CRS":{
28-
"context":"global",
29-
"default":"yes",
30-
"help":"Enable OWASP Core Rule Set.",
31-
"id":"OWASP_coreruleset",
32-
"label":"Coreruleset",
33-
"regex": "^(no|yes)$",
34-
"type": "check"
35-
},
36-
"CORAZA_SEC_AUDIT_ENGINE": {
37-
"context": "multisite",
38-
"default": "On",
39-
"help": "SecAuditEngine directive of coraza.",
40-
"id": "coraza-sec-audit-engine",
41-
"label": "SecAuditEngine",
42-
"regex": "^(On|RelevantOnly|Off)$",
43-
"type": "select",
44-
"select": ["On", "RelevantOnly", "Off"]
45-
},
46-
"CORAZA_SEC_RULE_ENGINE": {
47-
"context": "multisite",
48-
"default": "On",
49-
"help": "SecRuleEngine directive of coraza.",
50-
"id": "coraza-sec-rule-engine",
51-
"label": "SecRuleEngine",
52-
"regex": "^(On|DetectionOnly|Off)$",
53-
"type": "select",
2+
"id": "coraza",
3+
"name": "Coraza",
4+
"description": "Use Coraza as a library to inspect client request",
5+
"version": "0.1",
6+
"stream": "no",
7+
"settings": {
8+
"USE_CORAZA": {
9+
"context": "multisite",
10+
"default": "no",
11+
"help": "Activate Coraza library",
12+
"id": "use coraza library",
13+
"label": "Coraza",
14+
"regex": "^(no|yes)$",
15+
"type": "check"
16+
},
17+
"CORAZA_API": {
18+
"context": "global",
19+
"default": "http://bunkerweb-golang-1:8090",
20+
"help": "Address of the CORAZA API.",
21+
"id": "coraza-api",
22+
"label": "Coraza Api",
23+
"regex": "^.*$",
24+
"type": "text"
25+
},
26+
"USE_OWASP_CRS": {
27+
"context": "global",
28+
"default": "yes",
29+
"help": "Enable OWASP Core Rule Set.",
30+
"id": "OWASP_coreruleset",
31+
"label": "Coreruleset",
32+
"regex": "^(no|yes)$",
33+
"type": "check"
34+
},
35+
"CORAZA_SEC_AUDIT_ENGINE": {
36+
"context": "multisite",
37+
"default": "On",
38+
"help": "SecAuditEngine directive of coraza.",
39+
"id": "coraza-sec-audit-engine",
40+
"label": "SecAuditEngine",
41+
"regex": "^(On|RelevantOnly|Off)$",
42+
"type": "select",
43+
"select": ["On", "RelevantOnly", "Off"]
44+
},
45+
"CORAZA_SEC_RULE_ENGINE": {
46+
"context": "multisite",
47+
"default": "On",
48+
"help": "SecRuleEngine directive of coraza.",
49+
"id": "coraza-sec-rule-engine",
50+
"label": "SecRuleEngine",
51+
"regex": "^(On|DetectionOnly|Off)$",
52+
"type": "select",
5453
"select": ["On", "DetectionOnly", "Off"]
55-
},
56-
"CORAZA_SEC_AUDIT_LOG_PARTS": {
57-
"context": "multisite",
58-
"default": "ABCFHZ",
59-
"help": "SecAuditLogParts directive of coraza.",
60-
"id": "coraza-sec-audit-log-parts",
61-
"label": "SecAuditLogParts",
62-
"regex": "^A(([B-K])(?!.*\\2))+Z$",
63-
"type": "text"
64-
}
65-
66-
}
54+
},
55+
"CORAZA_SEC_AUDIT_LOG_PARTS": {
56+
"context": "multisite",
57+
"default": "ABCFHZ",
58+
"help": "SecAuditLogParts directive of coraza.",
59+
"id": "coraza-sec-audit-log-parts",
60+
"label": "SecAuditLogParts",
61+
"regex": "^A(([B-K])(?!.*\\2))+Z$",
62+
"type": "text"
63+
}
64+
}
6765
}

discord/discord.lua

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
local class = require "middleclass"
2-
local plugin = require "bunkerweb.plugin"
3-
local utils = require "bunkerweb.utils"
4-
local cjson = require "cjson"
5-
local http = require "resty.http"
1+
local class = require "middleclass"
2+
local plugin = require "bunkerweb.plugin"
3+
local utils = require "bunkerweb.utils"
4+
local cjson = require "cjson"
5+
local http = require "resty.http"
66

7-
local discord = class("discord", plugin)
7+
local discord = class("discord", plugin)
88

99
function discord:initialize()
1010
-- Call parent initialize
@@ -43,7 +43,7 @@ function discord:log(bypass_use_discord)
4343
end
4444
end
4545

46-
function discord:send(premature, data)
46+
function discord:send(self, data)
4747
local httpc, err = http.new()
4848
if not httpc then
4949
self.logger:log(ngx.ERR, "can't instantiate http object : " .. err)
@@ -97,4 +97,4 @@ function discord:log_default()
9797
return self:log(true)
9898
end
9999

100-
return discord
100+
return discord

slack/slack.lua

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
local class = require "middleclass"
2-
local plugin = require "bunkerweb.plugin"
3-
local utils = require "bunkerweb.utils"
4-
local cjson = require "cjson"
5-
local http = require "resty.http"
1+
local class = require "middleclass"
2+
local plugin = require "bunkerweb.plugin"
3+
local utils = require "bunkerweb.utils"
4+
local cjson = require "cjson"
5+
local http = require "resty.http"
66

7-
local slack = class("slack", plugin)
7+
local slack = class("slack", plugin)
88

99
function slack:initialize()
1010
-- Call parent initialize
@@ -43,7 +43,7 @@ function slack:log(bypass_use_slack)
4343
end
4444
end
4545

46-
function slack:send(premature, data)
46+
function slack:send(self, data)
4747
local httpc, err = http.new()
4848
if not httpc then
4949
self.logger:log(ngx.ERR, "can't instantiate http object : " .. err)
@@ -97,4 +97,4 @@ function slack:log_default()
9797
return self:log(true)
9898
end
9999

100-
return slack
100+
return slack

0 commit comments

Comments
 (0)