mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-19 19:15:22 +00:00
(ids) add reloadRules action to api
This commit is contained in:
parent
1e1aae8b57
commit
54f0787c23
@ -205,6 +205,28 @@ class ServiceController extends ApiControllerBase
|
||||
return array("status" => $status);
|
||||
}
|
||||
|
||||
/**
|
||||
* flush rule configuration to config and reload suricata ruleset (graceful restart)
|
||||
* @return array
|
||||
*/
|
||||
public function reloadRulesAction()
|
||||
{
|
||||
$status = "failed";
|
||||
if ($this->request->isPost()) {
|
||||
// close session for long running action
|
||||
$this->sessionClose();
|
||||
$backend = new Backend();
|
||||
// flush rule configuration
|
||||
$bckresult = trim($backend->configdRun("template reload OPNsense.IDS"));
|
||||
if ($bckresult == "OK") {
|
||||
$status = $backend->configdRun("ids reload", $detach);
|
||||
} else {
|
||||
$status = "template error";
|
||||
}
|
||||
}
|
||||
return array("status" => $status);
|
||||
}
|
||||
|
||||
/**
|
||||
* query suricata alerts
|
||||
* @return array
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user