Git Product home page Git Product logo

Comments (5)

b1v1r avatar b1v1r commented on September 24, 2024

Yes, this is out of date and should probably be removed. We shifted focus from lua modules to lua rules. Take a look at:

lua/ironbee-api.lua
tests/test_module_rules_lua.lua

In addition, I updated the lates docs with some basic info:

https://www.ironbee.com/docs/manual/ironbee-reference-manual.html#N100C2

from ironbee.

ngo avatar ngo commented on September 24, 2024

Lua rules don't seem to provide enough extensibility, as compared to modules. We wanted to use Ironbee as a framework to build specific "intelligent" sensors, because it seemed to allow quick module prototyping via lua modules coupled with ability to rewrite them into c to gain performance.

What are the plans for lua modules support? Will it be dropped in favor of rules and C modules?

from ironbee.

b1v1r avatar b1v1r commented on September 24, 2024

It is our plan to support lua modules again. We learned quite a bit about integrating lua with the rules, so we need to rewrite lua modules using these lessons learned. One item I will drop is the fixed "onSomeEvent" handlers and go with having to register them like C. We will also be continuing to build lua api wrappers (lua/ironbee-api.lua) and be able to use those in modules as well as rules. I'll take a look at it this week and see how much of this we can get done as I want to use this myself.

from ironbee.

b1v1r avatar b1v1r commented on September 24, 2024

Lua modules are working again!

See the updated example here:
https://github.com/ironbee/ironbee/blob/master/lua/example.lua

And the Lua wrapper API (which we will be expanding as needed) here:
https://github.com/ironbee/ironbee/blob/master/lua/ironbee-api.lua

And the C API (Foreign Function Interface - FFI) exposed to lua here:
https://github.com/ironbee/ironbee/blob/master/lua/ironbee-ffi.lua

from ironbee.

b1v1r avatar b1v1r commented on September 24, 2024

Quick example config loading example.lua:

### Logging
Log debug.log
LogLevel info

### Sensor Info
SensorId E4F68B09-3D08-40A9-8B80-78879708AD01

### Load Modules
LoadModule "ibmod_htp.so"
LoadModule "ibmod_lua.so"
LoadModule "ibmod_pcre.so"
LoadModule "ibmod_ac.so"
LoadModule "ibmod_rules.so"

# Load a lua module
LuaLoadModule "example.lua"

# This directive is defined in the lua module and context aware
LuaExampleDirective "Value in MAIN"

# Enable audit engine
AuditEngine RelevantOnly
AuditLogBaseDir /tmp/ironbee
AuditLogSubDirFormat "%Y%m%d-%H%M"
AuditLogDirMode 0755
AuditLogFileMode 0644
AuditLogParts all

### Buffering
RequestBuffering On
ResponseBuffering On

### Rule diagnostics
# What data to log
RuleEngineLogData all
# What level to log the data
RuleEngineLogLevel info

### Sites
# Default
<Site default>
    SiteId C6D2A3E6-88DD-4185-AC2B-FC662D59F514
    Service *:*
    Hostname *

    # This directive is defined in the lua module and context aware
    LuaExampleDirective "Value in DEFAULT SITE"
</Site>

from ironbee.

Related Issues (20)

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.