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

Cvss4.0 support #208

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Cvss4.0 support #208

wants to merge 8 commits into from

Conversation

unorsk
Copy link

@unorsk unorsk commented Jun 12, 2024

@frasertweedale
Copy link
Collaborator

Thanks for the updates @unorsk. I'll try and review them this weekend.

@unorsk
Copy link
Author

unorsk commented Jul 26, 2024

Thanks for the updates @unorsk. I'll try and review them this weekend.

@frasertweedale You can take a look at it if you want, but this isn't ready yet :) There is one thing I commented out in the tests that I am going to fix and lots of other places in the code that need some love. One of the reasons it took me so long is that I made a rewrite of the reference implementation in TypeScript which I used as a reference for my Haskell implementation, that (not surprisingly) isn't very idiomatic.
And then there is a new metric Urgency that can have values 'Red / Amber / Green / Clear' 🙈 in contrast to the rest of the metrics which can only have single character values – haven't solved this one yet.

@@ -0,0 +1,325 @@
{-# LANGUAGE OverloadedStrings #-}

module Security.CVSS40Lookup (lookupScore, maxComposed, maxComposedEQ3, maxSeverityeq3eq6, maxSeverity) where
Copy link
Collaborator

Choose a reason for hiding this comment

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

(just a code organisation thing) - I would like this module to be beneath Security.CVSS, e.g. Security.CVSS.V4_0.

Copy link
Author

Choose a reason for hiding this comment

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

@unorsk unorsk marked this pull request as ready for review July 29, 2024 19:02
@unorsk
Copy link
Author

unorsk commented Jul 29, 2024

@frasertweedale, it's kind of ready 🙈

@frasertweedale
Copy link
Collaborator

@frasertweedale, it's kind of ready 🙈

Thanks @unorsk. I've had a quick look; I'll need to set aside some time to understand the implementation - perhaps (hopefully!) this weekend.

@frasertweedale
Copy link
Collaborator

So, I've had a look and it's a solid start - thanks @unorsk! I'm working on some improvements using sum types for the MicroVectors and a total function for the score lookup, rather than the maps and lookup tables.

It seems that the scoring function is underspecified in the spec doc. There are some behaviours in the reference implementation that, from what I can see, aren't explained in the spec but rather fill in gaps or resolve ambiguities. I might be missing something but the spec seems rather poor or at least incomplete. Sigh...

@frasertweedale frasertweedale self-assigned this Aug 5, 2024
@unorsk
Copy link
Author

unorsk commented Aug 5, 2024

So, I've had a look and it's a solid start - thanks @unorsk! I'm working on some improvements using sum types for the MicroVectors and a total function for the score lookup, rather than the maps and lookup tables.

Yeah, sure.

It seems that the scoring function is underspecified in the spec doc. There are some behaviours in the reference implementation that, from what I can see, aren't explained in the spec but rather fill in gaps or resolve ambiguities. I might be missing something but the spec seems rather poor or at least incomplete. Sigh...

The spec isn't great 😅

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.

2 participants