|
| 1 | +# Vulnerability Reporting |
| 2 | + |
| 3 | +We use [msys2-sbom](https://github.com/msys2/msys2-devtools) to create a [CycloneDX SBOM file](https://cyclonedx.org/) based on the contents of the git repo [in CI](https://github.com/msys2/MINGW-packages/actions/workflows/generate-srcinfo.yml). We then use [grype](https://github.com/anchore/grype) to scan the SBOM and create another SBOM file with [VEX data](https://cyclonedx.org/capabilities/vex/). The [msys2-web site](https://github.com/msys2/msys2-web) then parses these files and displays |
| 4 | +the known potential vulnerabilities on https://packages.msys2.org/outofdate and https://packages.msys2.org/security. |
| 5 | + |
| 6 | +```mermaid |
| 7 | +graph LR; |
| 8 | + A[Extract PKGBUILD Metadata] --> B[Generate SBOM]; |
| 9 | + B --> C[Scan SBOM with Grype]; |
| 10 | + C --> D[packages.msys2.org]; |
| 11 | +``` |
| 12 | + |
| 13 | +## Package Metadata |
| 14 | + |
| 15 | +The following metadata is used to generate the SBOM file, so that CVEs etc. can be matched to our packages: |
| 16 | + |
| 17 | +In the `msys2_references` field in each `PKGBUILD` file the `cpe` key, the `purl` and the `pypi` keys are used to match to CVEs. |
| 18 | +The more references the better. Language ecosystem specific references such as pypi and cargo are preferred. For more information about the fields see [PKGBUILD](./pkgbuild.md). |
| 19 | + |
| 20 | +Example: |
| 21 | + |
| 22 | +```bash |
| 23 | +msys2_references=( |
| 24 | + "cpe: cpe:/a:python-cryptography_project:python-cryptography" |
| 25 | + "cpe: cpe:2.3:a:cryptography_project:cryptography" |
| 26 | + "pypi: cryptography" |
| 27 | + "purl: pkg:pypi/cryptography" |
| 28 | +) |
| 29 | +``` |
| 30 | + |
| 31 | +## Where to find CPEs and other IDs? |
| 32 | + |
| 33 | +* For Python packages search the package on https://pypi.org |
| 34 | +* For Rust packages search the package on https://crates.io |
| 35 | +* CPEs can be found on Repology: https://repology.org/project/openssl/cves |
| 36 | +* CPEs can also be found on Anitya: https://release-monitoring.org/project/2566 |
| 37 | +* CPEs can also be found using the official CPE search, but it is very slow and returns too many unrelated results most of the time: https://nvd.nist.gov/products/cpe/search |
| 38 | + |
| 39 | +## TODO |
| 40 | + |
| 41 | +* Some automated way to sync/update CPEs |
| 42 | +* Add metadata field to ignore certain CVEs for certain packages |
| 43 | +* Add metadata field for the real upstream version, in case we use a different format |
0 commit comments