mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2026-04-26 06:27:50 +02:00
Resolves #4765
This commit is contained in:
@@ -35,6 +35,7 @@ def showUsage(options, args):
|
|||||||
print('')
|
print('')
|
||||||
print(' General commands:')
|
print(' General commands:')
|
||||||
print(' help - Prints this usage information.')
|
print(' help - Prints this usage information.')
|
||||||
|
print(' apply - Apply the firewall state.')
|
||||||
print('')
|
print('')
|
||||||
print(' Host commands:')
|
print(' Host commands:')
|
||||||
print(' listhostgroups - Lists the known host groups.')
|
print(' listhostgroups - Lists the known host groups.')
|
||||||
@@ -66,7 +67,7 @@ def checkDefaultPortsOption(options):
|
|||||||
|
|
||||||
def checkApplyOption(options):
|
def checkApplyOption(options):
|
||||||
if "--apply" in options:
|
if "--apply" in options:
|
||||||
return apply()
|
return apply(None, None)
|
||||||
|
|
||||||
def loadYaml(filename):
|
def loadYaml(filename):
|
||||||
file = open(filename, "r")
|
file = open(filename, "r")
|
||||||
@@ -328,7 +329,7 @@ def removehost(options, args):
|
|||||||
code = checkApplyOption(options)
|
code = checkApplyOption(options)
|
||||||
return code
|
return code
|
||||||
|
|
||||||
def apply():
|
def apply(options, args):
|
||||||
proc = subprocess.run(['salt-call', 'state.apply', 'firewall', 'queue=True'])
|
proc = subprocess.run(['salt-call', 'state.apply', 'firewall', 'queue=True'])
|
||||||
return proc.returncode
|
return proc.returncode
|
||||||
|
|
||||||
@@ -356,7 +357,8 @@ def main():
|
|||||||
"addport": addport,
|
"addport": addport,
|
||||||
"removeport": removeport,
|
"removeport": removeport,
|
||||||
"addhostgroup": addhostgroup,
|
"addhostgroup": addhostgroup,
|
||||||
"addportgroup": addportgroup
|
"addportgroup": addportgroup,
|
||||||
|
"apply": apply
|
||||||
}
|
}
|
||||||
|
|
||||||
code=1
|
code=1
|
||||||
|
|||||||
Reference in New Issue
Block a user