Skip to content

Commit

Permalink
bug fix: modsec default rules #1186
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Jan 20, 2024
1 parent 0aba8a3 commit 679ce3d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions firewall/firewallManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ def fetchModSecRules(self, userID = None, data = None):

if modSecInstalled:
command = "sudo cat " + rulesPath
currentModSecRules = ProcessUtilities.outputExecutioner(command).split('\n')
currentModSecRules = ProcessUtilities.outputExecutioner(command)

final_dic = {'modSecInstalled': 1,
'currentModSecRules': currentModSecRules}
Expand All @@ -908,7 +908,7 @@ def fetchModSecRules(self, userID = None, data = None):
rulesPath = os.path.join(virtualHostUtilities.Server_root + "/conf/rules.conf")

command = "sudo cat " + rulesPath
currentModSecRules = ProcessUtilities.outputExecutioner(command).split('\n')
currentModSecRules = ProcessUtilities.outputExecutioner(command)

final_dic = {'modSecInstalled': 1,
'currentModSecRules': currentModSecRules}
Expand Down
9 changes: 7 additions & 2 deletions websiteFunctions/website.py
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,12 @@ def CreateNewDomain(self, request=None, userID=None, data=None):
except:
pass

admin = Administrator.objects.get(pk=userID)

try:
admin = Administrator.objects.get(pk=userID)
defaultDomain = Websites.objects.get(pk=admin.defaultSite).domain
except:
defaultDomain = 'NONE'

url = "https://platform.cyberpersons.com/CyberpanelAdOns/Adonpermission"
data = {
Expand All @@ -725,7 +730,7 @@ def CreateNewDomain(self, request=None, userID=None, data=None):
rnpss = randomPassword.generate_pass(10)
proc = httpProc(request, 'websiteFunctions/createDomain.html',
{'websiteList': websitesName, 'phps': PHPManager.findPHPVersions(), 'Randam_String': rnpss,
'test_domain_data': test_domain_status, 'defaultSite': admin.defaultSite})
'test_domain_data': test_domain_status, 'defaultSite': defaultDomain})
return proc.render()

def siteState(self, request=None, userID=None, data=None):
Expand Down

0 comments on commit 679ce3d

Please sign in to comment.