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

Handle CWE name #116

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

Handle CWE name #116

wants to merge 10 commits into from

Conversation

TristanCacqueray
Copy link
Collaborator

This PR enables using CWE names instead of their number to improve advisory visibility.

@TristanCacqueray
Copy link
Collaborator Author

If that looks good to you, I'll update the other advisories.

code/cwe/cwe.cabal Outdated Show resolved Hide resolved
code/cwe/cwe.cabal Outdated Show resolved Hide resolved
code/cwe/RenderCsvData.hs Outdated Show resolved Hide resolved
Comment on lines 20 to 26
-- | A map to lookup CWE names.
cweNames :: Map CWEID Text
cweNames = Map.fromList (coerce cweData)

-- | A map to lookup CWEID.
cweIds :: Map Text CWEID
cweIds = Map.fromList $ (\(k, v) -> (v, k)) <$> (coerce cweData)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Eventually I would like to add all the parent / child / category membership data as well. But this is good for now.

code/cwe/src/CWE.hs Outdated Show resolved Hide resolved
code/cwe/cwe.cabal Outdated Show resolved Hide resolved
@TristanCacqueray
Copy link
Collaborator Author

Thank you for the review @frasertweedale! I'll address the rest of the comments tomorrow.

code/hsec-tools/cabal.project Outdated Show resolved Hide resolved
Comment on lines +1 to +4
#!/usr/bin/env cabal
{- cabal:
build-depends: base, xml
-}
Copy link
Collaborator

Choose a reason for hiding this comment

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

That's unusual

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Since it's just for one-shot codegen I figured it was not necessary to add this to the cabal file.

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.

3 participants