-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
[FLORA-61] Start the data model for security advisories #762
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this, perhaps we can continue on it later :)
@MangoIV The standalone syntax for NFData does not work if the type does not implement Generic |
c98b332
to
3623a55
Compare
I mistook that for granted. |
83ebac9
to
7f19d24
Compare
@TristanCacqueray @blackheaven @frasertweedale Please let me know what you think of this. For the moment I'm filing advisories of the GHC components (haddock included) in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had expected some place to asynchronously propagate a package to be affected to all its reverse dependencies, am I missing where that happens? Or is that a futurework?
I think the data model is fine etc. though.
With regards to actually using this, here's what I imagine:
- a new internal endpoint (or whatever mechanism you use) to invoke the download of the advisories)
- this spawns a process that starts to go through the advisories and for each of them, fetches the reverse deps which each gets a process itself that goes through their reverse deps
- to make sure that not too many processes are spawned, you can use a
QSem
(quantity semaphore) which the processes block on if there's already enough of them chewing.
3087f97
to
6be5f6a
Compare
@MangoIV yes, the propagation of the information is the next PR, I just wanted to focus on the data model here. :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're very tightly coupled to hsec
, but, aside of that, it seems coherent.
src/advisories/Advisories/Import.hs
Outdated
Failure failures -> | ||
throwError failures | ||
Success advisories -> | ||
forM_ advisories $ \advisory -> processAdvisory advisory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
forM_ advisories $ \advisory -> processAdvisory advisory | |
mapM_ processAdvisory advisories |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@blackheaven I'm interested in how I could become less coupled to hsec
! :)
ed708a5
to
97426f4
Compare
676a8c3
to
3e40540
Compare
3e40540
to
29cd72d
Compare
Proposed changes
This PR introduces the initial data model for security advisories.
The database components are as follow:
security_advisories
, which encode most of the metadata, and to where affected packages referaffected_packages
represent the packages affected by an advisory, pointing to the advisory. Affected packages have one or multiple affected version ranges associated.affected_version_ranges
represent a link between an affected package, and the releases where the vulnerability is introduced and fixed.Linked
Contributor checklist
./docs/docs
if a public feature has a behaviour change