feat: add Hex advisory source#54
Conversation
|
Hi @dl-alexandre,
I’m not sure I understand the difference between those two sources. Our elixir-security-advisories repo is a copy of GitHub’s Advisory Database. Is there a usecase where one advisory would be in one source but not the other? |
|
Thanks, that is a fair question. I dug into the live data and tightened the implementation in The sources mostly overlap after alias normalization. Hex/OSV currently returns 94 raw advisory records, but several are duplicate aliases for the same vulnerability ( The concrete gap I found today is 3 Hex-only
So the intended use case is not to replace the Mirego/GitHub mirror, but to supplement it when Hex exposes package advisory metadata that has not landed in the mirror yet. I also changed the PR so the combined list is de-duplicated by |
|
@remi OSV.dev (currently the primary source of hex.pm) aggregates multiple sources, one of them is the EEF CNA. GitHub has longer delays since it propagates EEF CNA => CVE.org => NVD => GitHub and includes multiple manual steps. |
|
Thanks for the pointer to hex_core#188 and the group_for_display discussion. The change adds Hex (via hex_core/OSV) as a supplementary source alongside the existing Mirego/GitHub mirror. After alias normalization and de-dup by {package, id}, it fills specific gaps that haven't propagated yet (e.g. the three phoenix_storybook advisories that were in Hex but not the mirror at the time of the PR). Happy to adjust the merging logic, prefer hex_core's grouping, or make the hex source optional if preferred. Let me know the direction you'd like. |
|
Review thread from @maennchen noted from history. The Hex advisory source addition is ready (action_required is fork CI gate). Any additional feedback welcome. |
Summary
hex_coreas an advisory source alongside the existing Mirego YAML advisory repoMixAudit.Advisory{package, id}so Hex only supplements gaps in the mirrored advisory repoWhy this helps
The Mirego advisory repo mirrors GitHub Advisories, while Hex exposes package advisory metadata from Hex/OSV. Most current entries overlap after alias normalization, but live data currently includes Hex-only coverage for
phoenix_storybook(GHSA-mrhx-6pw9-q5fh,GHSA-55hg-8qxv-qj4p, andGHSA-833p-95jq-929q). This change keeps the existing YAML source as the primary source and uses Hex to fill those gaps without double-counting aliased records such asEEF-CVE-*+GHSA-*entries for the same vulnerability.Verification
MIX_ENV=prod mix testMIX_ENV=prod mix compile --warnings-as-errorsMIX_ENV=prod mix run -e 'advisories = MixAudit.Repo.advisories(); IO.inspect(length(advisories)); IO.inspect(Enum.filter(advisories, &(&1.package == "phoenix_storybook")) |> Enum.map(&{&1.id, &1.title}), limit: :infinity)'