示例#1
0
def removeCSF(request):
    try:
        userID = request.session['userID']
        fm = FirewallManager(request)
        return fm.removeCSF()
    except KeyError:
        return redirect(loadLoginPage)
示例#2
0
def securityHome(request):
    try:
        userID = request.session['userID']
        fm = FirewallManager()
        return fm.securityHome(request, userID)
    except KeyError:
        return redirect(loadLoginPage)
示例#3
0
def fetchCSFSettings(request):
    try:
        userID = request.session['userID']
        fm = FirewallManager(request)
        return fm.fetchCSFSettings()
    except KeyError:
        return redirect(loadLoginPage)
示例#4
0
def fetchModSecRules(request):
    try:
        userID = request.session['userID']
        fm = FirewallManager()
        return fm.fetchModSecRules(userID, json.loads(request.body))
    except KeyError:
        return redirect(loadLoginPage)
示例#5
0
def getCurrentRules(request):
    try:
        userID = request.session['userID']
        fm = FirewallManager()
        return fm.getCurrentRules(userID)
    except KeyError:
        return redirect(loadLoginPage)
示例#6
0
def installStatusModSec(request):
    try:
        userID = request.session['userID']
        fm = FirewallManager()
        return fm.installStatusModSec(userID)
    except KeyError:
        return redirect(loadLoginPage)
示例#7
0
def getSSHConfigs(request):
    try:
        userID = request.session['userID']
        fm = FirewallManager()
        return fm.getSSHConfigs(userID, json.loads(request.body))
    except KeyError:
        return redirect(loadLoginPage)
示例#8
0
def deleteSSHKey(request):
    try:
        userID = request.session['userID']
        result = pluginManager.preDeleteSSHKey(request)

        if result != 200:
            return result
        fm = FirewallManager()
        coreResult = fm.deleteSSHKey(userID, json.loads(request.body))

        result = pluginManager.postDeleteSSHKey(request, coreResult)
        if result != 200:
            return result

        return coreResult
    except KeyError:
        return redirect(loadLoginPage)
示例#9
0
def firewallHome(request):
    try:
        userID = request.session['userID']

        result = pluginManager.preFirewallHome(request)
        if result != 200:
            return result
        fm = FirewallManager()
        coreResult = fm.firewallHome(request, userID)

        result = pluginManager.postFirewallHome(request, coreResult)
        if result != 200:
            return result

        return coreResult
    except KeyError:
        return redirect(loadLoginPage)
示例#10
0
def modifyIPs(request):
    try:
        userID = request.session['userID']

        result = pluginManager.preModifyIPs(request)
        if result != 200:
            return result

        fm = FirewallManager(request)
        coreResult = fm.modifyIPs()

        result = pluginManager.postModifyIPs(request, coreResult)
        if result != 200:
            return result

        return coreResult
    except KeyError:
        return redirect(loadLoginPage)
示例#11
0
def enableDisableRuleFile(request):
    try:
        userID = request.session['userID']

        result = pluginManager.preEnableDisableRuleFile(request)
        if result != 200:
            return result

        fm = FirewallManager()
        coreResult = fm.enableDisableRuleFile(userID, json.loads(request.body))

        result = pluginManager.postEnableDisableRuleFile(request, coreResult)
        if result != 200:
            return result

        return coreResult
    except KeyError:
        return redirect(loadLoginPage)
示例#12
0
def saveModSecRules(request):
    try:
        userID = request.session['userID']

        result = pluginManager.preSaveModSecRules(request)
        if result != 200:
            return result

        fm = FirewallManager()
        coreResult = fm.saveModSecRules(userID, json.loads(request.body))

        result = pluginManager.postSaveModSecRules(request, coreResult)
        if result != 200:
            return result

        return coreResult
    except KeyError:
        return redirect(loadLoginPage)
示例#13
0
def getOWASPAndComodoStatus(request):
    try:
        userID = request.session['userID']

        result = pluginManager.preGetOWASPAndComodoStatus(request)
        if result != 200:
            return result

        fm = FirewallManager()
        coreResult = fm.getOWASPAndComodoStatus(userID,
                                                json.loads(request.body))

        result = pluginManager.postGetOWASPAndComodoStatus(request, coreResult)
        if result != 200:
            return result

        return coreResult
    except KeyError:
        return redirect(loadLoginPage)