sysdiglabs/sysdig-sdk-python

Secure add_policy.py creates a policy without a priority, which will not execute

StuartBridger opened this issue · 1 comments

add_policy.py successfully creates a policy, but doesn't set the priority.
This means that the policy doesn't execute.
Ideally this script needs to also allow specification of a priority, so that a working policy can be added in a single step.

As a side effect, It also causes script list_policies.py to fail

Traceback (most recent call last):
File "./list_policies.py", line 55, in
res[1]['policies'].sort(key=lambda p: priorities.index(p['id']))
File "./list_policies.py", line 55, in
res[1]['policies'].sort(key=lambda p: priorities.index(p['id']))
ValueError: 37 is not in list

(value error 37 is the ID of the newly created policy)

Note FR SMPROD-1442 has been created to improve the API call

Closing this issue as the related Jira ticket was marked as Done and it is related to the old version of the Policies.
The new Policies do not have priorities.

If you find any other bug, don't hesitate to open a new ticket.
Thanks!