Skip to content

Add support for Sysdig Secure compliance tasks #77

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Feb 20, 2019
Merged

Add support for Sysdig Secure compliance tasks #77

merged 7 commits into from
Feb 20, 2019

Conversation

meskio
Copy link
Contributor

@meskio meskio commented Feb 15, 2019

As well as adding support to fetch policy events by id.

Copy link
Contributor

@figarocorso figarocorso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM besides a couple of comments. Nice work, thank you for the refactor.

if scope is not None:
task["scope"] = scope
if enabled is not None:
task["enabled"] = enabled
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've seen this a couple of times at the code. Would this be worthy?

options = {
    'name': name,
    'moduleName': module_name,
...
}

for key, value in options.items():
    if value is not None:
        task[key] = value

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how readable are dict completions, but this is a try: 33e82b2

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, totally right. Wasn't sure at all, but wanted to know your opinion ;-)

@davideschiera davideschiera merged commit b6f5abc into sysdiglabs:master Feb 20, 2019
@davideschiera
Copy link
Contributor

@meskio unfortunately this time the build was failing for real:

+/home/travis/build/draios/python-sdc-client/test/../examples/set_secure_user_falco_rules.py [secure] /tmp/test_apis_user_rules.yaml
user falco rules set successfully
+/home/travis/build/draios/python-sdc-client/test/../examples/get_secure_user_falco_rules.py [secure]
+diff /tmp/falco_rules.yaml /tmp/test_apis_user_rules.yaml
+/home/travis/build/draios/python-sdc-client/test/../examples/delete_all_policies.py [secure]
++/home/travis/build/draios/python-sdc-client/test/../examples/list_policies.py [secure]
Traceback (most recent call last):
  File "/home/travis/build/draios/python-sdc-client/test/../examples/list_policies.py", line 49, in <module>
    res[1] = res[1]['priorities']['policyIds']
TypeError: 'tuple' object does not support item assignment
+OUT=
The command "bash test/test_secure_apis.sh" exited with 1.

Would you mind taking a look and see if you can file another PR to fix the test (or code)? Let me know if you need any help.

Thanks!

@meskio
Copy link
Contributor Author

meskio commented Feb 20, 2019

Ouch, I thought I tested. I'm looking into that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants