GUI editor to tame mod_security rules

⌈⌋ branch:  modseccfg


Check-in [4f8b060eda]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:patch for PluginMeta() wrapper required in last pluginconf.gui.window()
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | trunk
Files: files | file ages | folders
SHA3-256: 4f8b060eda401f4fa3b65a789a4a6f6117e340456353a22960ccf4aed0105841
User & Date: mario 2023-10-26 17:36:42
Context
2023-10-26
17:36
patch for PluginMeta() wrapper required in last pluginconf.gui.window() Leaf check-in: 4f8b060eda user: mario tags: trunk
2022-11-01
23:27
accessible MenuInstance for newer PSG, migrate to pluginconf.bind interface (partly) check-in: 0993a0e78c user: mario tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to modseccfg/crsoptions.py.

499
500
501
502
503
504
505



506
507
508
509
510
511
512
    plugins["global"]["version"] = find_crs_version()
    plugin_states = {k:1 for k in plugins.keys()}
    
    # add declared options, if any
    pmd = pluginconf.plugin_meta(fn=srvroot.fn(confn))
    if pmd.get("title") and pmd.get("config") and pmd.get("type")=="config":
        plugins[pmd["id"]] = pmd




    # read config variables directly from file (using vhosts would be more work, since .ruledecl and .rules{} had to be searched for .setvar)
    conf = {}
    if srvroot.exists(confn):
        conf = read_setvars(confn)
    # unset defaults
    if not utils.conf.get("crsopt_defaults"):







>
>
>







499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
    plugins["global"]["version"] = find_crs_version()
    plugin_states = {k:1 for k in plugins.keys()}
    
    # add declared options, if any
    pmd = pluginconf.plugin_meta(fn=srvroot.fn(confn))
    if pmd.get("title") and pmd.get("config") and pmd.get("type")=="config":
        plugins[pmd["id"]] = pmd
    
    # stub for simpler property access
    plugins = {id: pluginconf.PluginMeta(pmd) for id,pmd in plugins.items()}

    # read config variables directly from file (using vhosts would be more work, since .ruledecl and .rules{} had to be searched for .setvar)
    conf = {}
    if srvroot.exists(confn):
        conf = read_setvars(confn)
    # unset defaults
    if not utils.conf.get("crsopt_defaults"):

Changes to modseccfg/secoptions.py.

711
712
713
714
715
716
717



718
719
720
721
722
723
724
    if vh.cfg:
        names = {k: k.lower() for k in options.keys()}
        for dir,id in names.items():
            if id in vh.cfg:
                conf[dir] = vh.cfg[id]
    prev = copy.copy(conf)




    # show
    #
    ## WARNING: NEEDS PATCHED PLUGINCONF.GUI (plugins= param)
    #
    save = pluginconf.gui.window(
        conf, plugin_states, files=[], plugins=plugins,
        title="mod_security option directives", icon=icons.apache,







>
>
>







711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
    if vh.cfg:
        names = {k: k.lower() for k in options.keys()}
        for dir,id in names.items():
            if id in vh.cfg:
                conf[dir] = vh.cfg[id]
    prev = copy.copy(conf)

    # stub for simpler property access
    plugins = {id: pluginconf.PluginMeta(pmd) for id,pmd in plugins.items()}

    # show
    #
    ## WARNING: NEEDS PATCHED PLUGINCONF.GUI (plugins= param)
    #
    save = pluginconf.gui.window(
        conf, plugin_states, files=[], plugins=plugins,
        title="mod_security option directives", icon=icons.apache,