Skip to content
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

offer API to request security advisories #166

Closed
MangoIV opened this issue Mar 17, 2024 · 14 comments · Fixed by #168
Closed

offer API to request security advisories #166

MangoIV opened this issue Mar 17, 2024 · 14 comments · Fixed by #168
Assignees

Comments

@MangoIV
Copy link
Contributor

MangoIV commented Mar 17, 2024

Summary

it would be nice if we could serve an api that gives back the advisories that is continuously deployed; currently the only way is cloning the repo or parsing the html of the website; neither is immensely efficient

@MangoIV MangoIV mentioned this issue Mar 17, 2024
8 tasks
@blackheaven blackheaven self-assigned this Mar 17, 2024
@blackheaven
Copy link
Collaborator

I will work on a library for that since other consummers (e.g. hackage/flora) will need such a mechanism

@MangoIV
Copy link
Contributor Author

MangoIV commented Mar 18, 2024

if you want to create the API I can do the server, if you want or vice versa...

@blackheaven
Copy link
Collaborator

Thanks, don't worry, I'll pack it into a library.

@blackheaven blackheaven linked a pull request Mar 19, 2024 that will close this issue
@MangoIV
Copy link
Contributor Author

MangoIV commented Mar 29, 2024

Where’s this hosted?

@frasertweedale
Copy link
Collaborator

I think this was closed by mistake.

@MangoIV
Copy link
Contributor Author

MangoIV commented Mar 29, 2024

@frasertweedale i unfortunately cannot reopen, would you do that for me? Thanks in advance!

@blackheaven blackheaven reopened this Mar 29, 2024
@MangoIV
Copy link
Contributor Author

MangoIV commented Mar 29, 2024

Perfect, thank you! ❤️

@blackheaven
Copy link
Collaborator

Actually I think it was fix with hsec-sync, but maybe I did not understood the problem correctly.

Do you need a way to have a synchronized local copy, or a list of the published advisories?

@MangoIV
Copy link
Contributor Author

MangoIV commented Mar 30, 2024

well; it would be good if we wouldn't require a user to git clone the repository but instead be able to just send a request to some API which can

  • give you an update on an advisory, given its ID
  • give you all of the advisories, independent of the repo

If you wish, I can build this, I have become very swift at building servant servers ;)

@blackheaven
Copy link
Collaborator

I see, yes, hsec-sync is currently not the best way to achieve that.

On another hand I'm quite worried about this approach for project check as it would end-up with a lot of back-and-forth with the server, moreover I'm reluctant to have the HF host a service (any managed static file hosting would be better).

I think it's better to:

  1. Ensure to have a local copy
  2. Query against it

I plan to tackle an archive format (without git, #170), tomorrow and/or on Monday, so it will remove a dependency.

@MangoIV
Copy link
Contributor Author

MangoIV commented Mar 30, 2024

On another hand I'm quite worried about this approach for project check as it would end-up with a lot of back-and-forth with the server, moreover I'm reluctant to have the HF host a service (any managed static file hosting would be better).

can you elaborate on that? I don’t understand why it would require a lot of back and forth.

I think it’s fair if the HF doesn’t want to host something like that, especially given that we’d probably have to think about the trust model of something like that but I would at least strive to get something like that.

@blackheaven
Copy link
Collaborator

can you elaborate on that? I don’t understand why it would require a lot of back and forth.

I mean, each time a cabal audit would be triggered may requests (or a big one) would be sent to the server, which will put a lot of pressure with hard-to-cache queries.

I think it’s fair if the HF doesn’t want to host something like that, especially given that we’d probably have to think about the trust model of something like that but I would at least strive to get something like that.

I speak only for myself, but running a service that sensitive does not seem to be a good idea.

It would take more effort to run it ourselves rather than using a static hosting solution (we would have a better availability and it would be easier to secure, not to mention distribution with CDNs).

@frasertweedale
Copy link
Collaborator

frasertweedale commented Mar 30, 2024

@blackheaven I think the ask here is an API for submitting new advisories to the database. For example, it could create a pull request that the SRT can then review and merge (or not).

I don't think this is about an API for querying the advisory DB.

edit no, I read the description more carefully, I think the ask is what Gautier thought it was.

In which case I pretty much agree - I don't think hosting an API for querying data is a priority for us. Rather, an archive format and a single artifact hosted somewhere is what we are aiming for, currently.

@MangoIV
Copy link
Contributor Author

MangoIV commented Mar 31, 2024

I mean I’d be fine with single artifact. But if that’s planned anyway, I think I can close this.

@MangoIV MangoIV closed this as completed Mar 31, 2024
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 a pull request may close this issue.

3 participants