OpenSCAP / openscap-daemon

Manages continuous scans of your infrastructure
https://www.open-scap.org/tools/openscap-daemon
GNU Lesser General Public License v2.1
106 stars 32 forks source link

Merge oscap-daemon-api into openscap-daemon #144

Closed mvazquezc closed 5 years ago

mvazquezc commented 5 years ago

Some discussion topics:

My opinion:

openscap-ci commented 5 years ago

Can one of the admins verify this patch?

pep8speaks commented 5 years ago

Hello @mvazquezc! Thanks for updating the PR.

Comment last updated on November 06, 2018 at 11:53 Hours UTC
mpreisler commented 5 years ago

@openscap-ci add to whitelist

jan-cerny commented 5 years ago

@mvazquezc

IMO Flask should be an optional dependency and the Daemon should be able to start without that, because I can imagine there can be people who do not plan to use REST API, and they would like to install Daemon without dependencies they will not necesarily need.

Regarding the second question, I would personally add 2 CLI or config file options:

  1. to enable or disable REST API
  2. to enable or disable DBus API

But I have no idea if that's possible or how difficult would it be to implement.

mvazquezc commented 5 years ago

@mvazquezc

IMO Flask should be an optional dependency and the Daemon should be able to start without that, because I can imagine there can be people who do not plan to use REST API, and they would like to install Daemon without dependencies they will not necesarily need.

Regarding the second question, I would personally add 2 CLI or config file options:

  1. to enable or disable REST API
  2. to enable or disable DBus API

But I have no idea if that's possible or how difficult would it be to implement.

I don't know the implications of starting oscapd without dbus daemon enabled, as a first move, I will implement the logic to use the flask dependency only if rest api is enabled in config.

jan-cerny commented 5 years ago

I don't know the implications of starting oscapd without dbus daemon enabled, as a first move, I will implement the logic to use the flask dependency only if rest api is enabled in config.

Great! Thanks. That will be fine.

mpreisler commented 5 years ago

Hi @mvazquezc , this code looks very good. I added a few comments with suggestions.

In the longer term future it would be very nice to refactor the code to instantiate the system, then instantiate the dbus and REST "interfaces" if it's enabled in the config file. These interfaces would reference the system and would be instantiated if and only if all dependencies are met and it's enabled in the config file.

mvazquezc commented 5 years ago

@mpreisler In this PR I would like to handle only things related to the rest api implementation. Would you mind if we open an issue in order to handle the dbus daemon changes?

mpreisler commented 5 years ago

@mpreisler In this PR I would like to handle only things related to the rest api implementation. Would you mind if we open an issue in order to handle the dbus daemon changes?

That works for me.

mvazquezc commented 5 years ago

@mpreisler I've added your suggestions. Please, review the changes and let me know if further changes are needed.

mpreisler commented 5 years ago

@matejak @jan-cerny Could you please take over the review here?

jan-cerny commented 5 years ago

@mpreisler Yes, I can.

jan-cerny commented 5 years ago

@mvazquezc Apart from the comment regarding ssgs endpoint it looks good to me.

jan-cerny commented 5 years ago

I have checked the code once again, I have tried to run the daemon on my F29 VM and contacting the endpoints. Everything works OK. @mvazquezc Thank you very much. Great job!