openscap-daemon icon indicating copy to clipboard operation
openscap-daemon copied to clipboard

Provide a REST API

Open mpreisler opened this issue 10 years ago • 14 comments

We already provide a dbus API but some prospective users would strongly prefer a REST API. We should refactor the System and DBusDaemon classes so that we can run one service that exposes 2 APIs at the same time.

mpreisler avatar Jan 19 '16 14:01 mpreisler

Hi!,

I've written a Python API using flask on top of your daemon, maybe it can be integrated somehow.

https://github.com/mvazquezc/oscap-daemon-api

mvazquezc avatar May 18 '16 10:05 mvazquezc

Hi @mvazquezc. Your project looks great, would you be interested in refactoring it and submitting it as a pull request here? I think we could refactor the code so that dbus and REST APIs can be used in any combination, depending on config.ini.

Could you please relicense your code as LGPL? I can't change the license of this project.

mpreisler avatar May 19 '16 14:05 mpreisler

Sure! It will take me some time but I'll send a PR as soon as I have the new implementation coded.

mvazquezc avatar May 21 '16 14:05 mvazquezc

Hey guys. Is providing a REST API still planned, or has it been put to rest?

I wasn't aware of the dbus API, so I'll take a look at that. Having a REST API would be awesome, though. Also, I'm taking a look at @mvazquezc's oscap-daemon-api. Pretty nifty. I'll have to test that at some point.

naltun avatar Jul 12 '18 15:07 naltun

@naltun I agree that a REST API would be awesome. However, I think it is still just an idea.

jan-cerny avatar Jul 12 '18 16:07 jan-cerny

@jan-cerny I've never hacked onto OpenSCAP (nor OpenSCAP Daemon), but if I can help out with the REST API, I'd be happy to help.

naltun avatar Jul 12 '18 17:07 naltun

I have been using @mvazquezc openscap api, and its great. It seems to have all the requisite features and the report and guide are awesome.

rshade avatar Aug 22 '18 13:08 rshade

Can OpenSCAP fork and test the project, and manage their own version? Is this a potential option?

naltun avatar Aug 22 '18 14:08 naltun

Can OpenSCAP fork and test the project, and manage their own version? Is this a potential option?

Definitely an option. We all have time constraints though. If you want to make it very likely that we will integrate this into openscap-daemon please feel free to submit a PR yourself. Waiting for somebody else might also sometimes work but it has been two years :-)

mpreisler avatar Aug 29 '18 21:08 mpreisler

@mpreisler would you be willing to make us a feature branch to work off of, so we can sync many disparate forks?

rshade avatar Aug 31 '18 14:08 rshade

Also can we setup a wiki for design ideas. My first initial move would be to dump @mvazquezc code in there once he changes the license out and approves it, but we would need to discuss how openscap-daemon will serve http requests.

rshade avatar Aug 31 '18 14:08 rshade

I've changed the license to use the same licenses as OpenScap Daemon.

I just took a look at this a few days ago. I've done some changes to the daemon to read the API config from the config file.

We can migrate the main class and just use the method defined on the OpenScap daemon (there is no need to talk with the DBUS daemon anymore, correct me if I'm wrong though.)

I'm willing to help with this feature, if you set up a new branch I could commit my changes there.

mvazquezc avatar Aug 31 '18 19:08 mvazquezc

We can migrate the main class and just use the method defined on the OpenScap daemon (there is no need to talk with the DBUS daemon anymore, correct me if I'm wrong though.)

Agreed, there shouldn't be any need to talk REST to dbus to daemon API, REST can talk directly to the API.

mpreisler avatar Sep 02 '18 00:09 mpreisler

I'm willing to help with this feature, if you set up a new branch I could commit my changes there.

just for public record, I gave @mvazquezc write access to the repo. I think doing those changes in a separate branch and then merging into master after things stabilize is the way to go.

mpreisler avatar Sep 05 '18 19:09 mpreisler