def removeCSF(request): try: userID = request.session['userID'] fm = FirewallManager(request) return fm.removeCSF() except KeyError: return redirect(loadLoginPage)
def securityHome(request): try: userID = request.session['userID'] fm = FirewallManager() return fm.securityHome(request, userID) except KeyError: return redirect(loadLoginPage)
def fetchCSFSettings(request): try: userID = request.session['userID'] fm = FirewallManager(request) return fm.fetchCSFSettings() except KeyError: return redirect(loadLoginPage)
def fetchModSecRules(request): try: userID = request.session['userID'] fm = FirewallManager() return fm.fetchModSecRules(userID, json.loads(request.body)) except KeyError: return redirect(loadLoginPage)
def getCurrentRules(request): try: userID = request.session['userID'] fm = FirewallManager() return fm.getCurrentRules(userID) except KeyError: return redirect(loadLoginPage)
def installStatusModSec(request): try: userID = request.session['userID'] fm = FirewallManager() return fm.installStatusModSec(userID) except KeyError: return redirect(loadLoginPage)
def getSSHConfigs(request): try: userID = request.session['userID'] fm = FirewallManager() return fm.getSSHConfigs(userID, json.loads(request.body)) except KeyError: return redirect(loadLoginPage)
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)
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)
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)
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)
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)
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)