Help with new intrusion prevention rule selector tab - not saving

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Help with new intrusion prevention rule selector tab - not saving

Roadrunnere42
Hi
I am tiring to add another tab to the intrusion prevention window which allow the user to select which snort rule to use, these are then written to a config file which I then use bash to sort out which rules need to be downloaded.

I have already added the tab and selection field with firefox and tick box, I can’t seem to find how to write this to it’s own config file /etc/config/snort1. I think it's got something to do with this
s = m:section(NamedSection, "snort1")

The code below I have stripped all tabs out except the snort rule selector one just for ease of viewing

Any help would be appreciate

Roadrunnere43

--[[

LuCI Snort module

Copyright (C) 2015, Itus Networks, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

Author: Luka Perkov <[email protected]>

]]--

local fs = require "nixio.fs"
local sys = require "luci.sys"
require "ubus"

m = Map("snort", translate("Intrusion Prevention"), translate("Changes may take up to 90 seconds to take effect, service may be interrupted during that time. The IPS engine will restart each time you click the Save & Apply or On/Off button."))

m.on_init = function()
        luci.sys.call("sed '1!G;h$!d' /tmp/snort/alert > /tmp/snort/alert2")
end

m.reset = false
m.submit = false

s = m:section(NamedSection, "snort")
s.anonymous = true
s.addremove = false

s:tab("tab_basic", translate("Basic Settings"))
s:tab("tab_snort7", translate("Snort7 Config"))
s:tab("tab_snort8", translate("Snort8 Config"))
s:tab("tab_threshold", translate("Threshold Config"))
s:tab("tab_custom", translate("Custom Rules"))
s:tab("tab_rules", translate("Exclude Rules"))
s:tab("tab_logs", translate("IPS Logs"))
s:tab("tab_counter", translate("Rule Counter"))
s:tab("tab_snort1", translate("Snort Rules Selector"))


       
        --------------------- snort rule selector Tab ------------------------
s = m:section(NamedSection, "snort1")
s.anonymous = true
s.addremove = false

firefox = s:taboption("tab_snort1", Flag, "content_firefox", translate("Firefox"))
firefox.default=firefox.disabled
firefox.rmempty = false



return m