GUI editor to tame mod_security rules

⌈⌋ ⎇ branch:  modseccfg


Check-in [2660ee756b]

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

Overview
Comment:Change `fn` to select with existing vhost/conf files
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 2660ee756b9f64e1e8fbeb5921e5dd91fbf4d0c4ecdb1462a782ea31bd7bbe91
User & Date: mario 2020-11-24 18:24:39
Context
2020-11-24
18:24
"Save To" option to update self.fn check-in: 29354e22ba user: mario tags: trunk
18:24
Change `fn` to select with existing vhost/conf files check-in: 2660ee756b user: mario tags: trunk
2020-11-23
18:56
add WrapDirective detection, and SecRuleUpdate* collection check-in: fbaa7c8587 user: mario tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to modseccfg/crsoptions.py.

46
47
48
49
50
51
52
53
54

55
56
57
58
59
60
61
        "900999": "900999"
    }
}
setvar['fn'] = {
    "id": "5998",
    "name": "fn",
    "description": "Which *.conf file to write back to.",
    "type": "str",
    "value": "/etc/modsecurty/crs/crs-setup.conf",

    "help": "Which *.conf file to write back to.\nIf you want to read out rules from crs-setup.conf, but then\nwrite to a custom location; use this option. Start the dialog\n(File\u2192CRS option) whilst crs-setup.conf is selected, then\nchange the target filename here."
}
setvar['tx.paranoia_level'] = {
    "id": "900000",
    "name": "tx.paranoia_level",
    "description": "The Paranoia Level (PL) setting allows you to choose the desired level",
    "type": "select",







|

>







46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
        "900999": "900999"
    }
}
setvar['fn'] = {
    "id": "5998",
    "name": "fn",
    "description": "Which *.conf file to write back to.",
    "type": "select", ## dev/update might reset this ##
    "value": "/etc/modsecurty/crs/crs-setup.conf",
    "select": {},
    "help": "Which *.conf file to write back to.\nIf you want to read out rules from crs-setup.conf, but then\nwrite to a custom location; use this option. Start the dialog\n(File\u2192CRS option) whilst crs-setup.conf is selected, then\nchange the target filename here."
}
setvar['tx.paranoia_level'] = {
    "id": "900000",
    "name": "tx.paranoia_level",
    "description": "The Paranoia Level (PL) setting allows you to choose the desired level",
    "type": "select",
481
482
483
484
485
486
487

488
489
490
491
492
493
494

def window(confn):

    # prepare config list
    plugins = mk_groups()
    setvar["id"]["value"] = "5999" if not re.search("crs/crs-setup", confn) else "900999"
    setvar["fn"]["value"] = confn

    plugins["global"]["description"] += confn
    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":







>







482
483
484
485
486
487
488
489
490
491
492
493
494
495
496

def window(confn):

    # prepare config list
    plugins = mk_groups()
    setvar["id"]["value"] = "5999" if not re.search("crs/crs-setup", confn) else "900999"
    setvar["fn"]["value"] = confn
    setvar["fn"]["select"] = {v:v for v in vhosts.list_vhosts()}
    plugins["global"]["description"] += confn
    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":