Closed tzumby closed 7 years ago
Hey @tzumby,
Lua tables can act both like arrays, and like hashes/dictionaries as you have referenced. The add_ruleset
option can be called as the former (an integer-indexed or array type); this might look like the following:
waf:set_option("add_ruleset", { "foo", "bar" })
Does this help?
FWIW this add_ruleset
options will be deprecated and removed in the future (though the concept of calling set_option
taking an array will likely remain).
Thanks, that makes sense. I saw your other ticket about load_secrules, I'll take that discussion there so it's in the right place.
Great, thanks! :)
Hi @p0pr0ck5,
First off, thanks for working on such a cool open source project!
I'm following the documentation about adding custom rules: https://github.com/p0pr0ck5/lua-resty-waf/blob/428242a97f78eb6b373be07f32df6729a0616bb6/README.md#add_ruleset
How does the lua table that I would have to pass to set_option look? I'm new to Lua but from what I can read online, a table is like a Python dictionary or a Ruby Hash right. What should the keys be in this case.
Thanks,