Update curl command for setting policy

This commit is contained in:
Rami Winestock
2023-12-19 20:23:56 +02:00
parent a49e2bcaad
commit 1f96171f62

View File

@@ -224,7 +224,8 @@ const internalNginxOpenappsec = {
for (let port of ports) { for (let port of ports) {
try { try {
const command = `curl -s -o /dev/null -w "%{http_code}" ${constants.HOSTURL}:${port}/openappsec/set-apply-policy`; const data = '{"policy_path":"/etc/cp/conf/local_policy.yaml"}';
const command = `curl -s -o /dev/null -w "%{http_code}" --data '${data}' ${constants.HOSTURL}:${port}/set-apply-policy`;
console.log(`command: ${command}`); console.log(`command: ${command}`);
let { stdout } = await execPromise(command); let { stdout } = await execPromise(command);
if (stdout === '200') { if (stdout === '200') {