openappsec icon indicating copy to clipboard operation
openappsec copied to clipboard

Applying Policy error: code line 1667 [: Illegal number: in Declarative mode

Open epaphrasmakoko opened this issue 9 months ago • 7 comments

Applying Policy error code line 1667 in Declarative mode, first of all this happens in two scenarios when you try to apply policy and after you terminate it during the process even though not most of the time. second scenario is just by default after installation in some cases which i eventually don't know exactly. The Bad thing when this error occurs in my experience i just have to reinstall the open-appsec again otherwise, one won't be able to apply policy again in declarative mode.

open-appsec-ctl -ap /usr/sbin/open-appsec-ctl: 1667: [: Illegal number: Policy didn’t changed. Policy path: /etc/cp/conf/local_policy.yaml root@kobe-vault:/tmp#

1000107857

epaphrasmakoko avatar May 07 '24 15:05 epaphrasmakoko

i have the same problem ... without any additional error information .. and during te applying the original version of the policy mode : declarative mode

AndyAdm avatar May 08 '24 08:05 AndyAdm

Hi,

we've managed to recreate it and are looking into it, I'll update here on our progress

orianelou avatar May 08 '24 08:05 orianelou

Hi @epaphrasmakoko @AndyAdm,

Could you please share the full details of the flow, both the policy file and the command you've used to update the policy? you can send it to [email protected] as well.

Thank you!

orianelou avatar May 09 '24 12:05 orianelou

i have the whole file from debug command, i have the whole dump of the agent, so i should provide the the policy file only ? and in case of the command is up above in picture

epaphrasmakoko avatar May 09 '24 17:05 epaphrasmakoko

i am using the default

epaphrasmakoko avatar Jun 14 '24 19:06 epaphrasmakoko

Hi @epaphrasmakoko The following change in /usr/sbin/open-appsec-ctl , in is_apply_policy_needed(), have allowed policy to be updated (after a file modification) in my environment.

Change the following line: if [ "${local_policy_modification_time}" -eq "${last_local_policy_modification_time}" ] || [ -z ${last_local_policy_modification_time} ]; then To: if [ "${local_policy_modification_time}" == "${last_local_policy_modification_time}" ]; then

chkp-nadavd avatar Jul 15 '24 13:07 chkp-nadavd

Let me check it now

epaphrasmakoko avatar Jul 15 '24 13:07 epaphrasmakoko