policy path moved to globals
This commit is contained in:
parent
1f96171f62
commit
c6c7319b0c
1 changed files with 1 additions and 4 deletions
|
@ -219,14 +219,11 @@ const internalNginxOpenappsec = {
|
|||
return;
|
||||
}
|
||||
let ports = constants.PORTS;
|
||||
console.log(`Notifying openappsec to apply the policy on ports ${ports}`);
|
||||
let lastError = null;
|
||||
|
||||
for (let port of ports) {
|
||||
try {
|
||||
const data = '{"policy_path":"/etc/cp/conf/local_policy.yaml"}';
|
||||
const data = `{"policy_path":"${constants.POLICY_PATH}"}`;
|
||||
const command = `curl -s -o /dev/null -w "%{http_code}" --data '${data}' ${constants.HOSTURL}:${port}/set-apply-policy`;
|
||||
console.log(`command: ${command}`);
|
||||
let { stdout } = await execPromise(command);
|
||||
if (stdout === '200') {
|
||||
console.log(`Policy applied successfully on port ${port}`);
|
||||
|
|
Loading…
Reference in a new issue