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

Automatic update notifications and security advisories #3088

Closed
lazka opened this issue Jul 6, 2022 · 15 comments
Closed

Automatic update notifications and security advisories #3088

lazka opened this issue Jul 6, 2022 · 15 comments

Comments

@lazka
Copy link
Member

lazka commented Jul 6, 2022

A bit of a meta issue.

Stories:
a) a new upstream release is out which we could package and we want to be notified (with some upper version limit, in case we have separate packages for different major versions)
b) we want to link packages to cygwin/arch to share patches, see potential problems (we have https://packages.msys2.org/outofdate right now)
c) we want to know all open security advisories for the version currently in the repo and a way to ignore them on a per issue/package basis.

For (a) and (c) we need to know the real package names and real versions of each package. So for example the real pypi name, or a git repo + commit hash if we build from git, or a git tag. In various cases we have to adjust the version format for pacman, or rename the package to avoid naming conflicts or have consistent package names in our repo. If it's a git hash it would also be nice to know what the last/base version is so we can see if there is something newer.

Random list of things that might be helpful here:

@dscho
Copy link
Contributor

dscho commented Jul 11, 2022

See also https://github.com/git-for-windows/git/blob/main/.github/workflows/monitor-components.yml, which notifies Git for Windows about new releases in components considered crucial by opening new tickets.

Also, I vaguely recall @Biswa96 working on some Python script to monitor e.g. GitHub CLI updates. (I have a variation of Git for Windows' monitor-components workflow in a private repository of mine that monitors GitHub CLI updates.)

@Biswa96
Copy link
Member

Biswa96 commented Jul 11, 2022

Disclaimer: I have no idea about python. 🙇 I did not remember working on that kind of project.

@lazka
Copy link
Member Author

lazka commented Dec 29, 2022

There is now an extra metadata file in each repo which can be used to store things related to a package: https://github.com/msys2/MSYS2-packages/blob/master/PKGMETA.yml

We only use it for https://packages.msys2.org atm

@goyalyashpal
Copy link

goyalyashpal commented Feb 8, 2023

I do think that how f-droid manages their repo can be took some ideas from.

They have a bot, which scans for updates on the project source repos via some trigger. If update found, those are added to new build pipeline.

They do automated checks for vulnerabilities too IIRC.

Do u want me to tag an fdroid person for their input & participation?

@goyalyashpal
Copy link

goyalyashpal commented Feb 8, 2023

Ref: #3536 above mentioned by @ Biswa96

I also wanted the information about "out-of-date" packages in the repo to be included in repo index (the repo file which pacman fetches), which is then shown by pacman while running some commands like -S, -Ss or -Qu.

Does that come under this issue?

@lazka
Copy link
Member Author

lazka commented Mar 27, 2023

I haven't found an API/service that allows easy access to CVEs and has some kind of mapping to projects which we can use. The closest is repology, but that doesn't have an API, just a web UI for the security part.

If someone knows some service, here is an example query:

Assuming we have "apr v1.7.0", is it affected by a security advisory? (spoiler: it is)

@goyalyashpal
Copy link

in case no service exist, then can web scraping the repology to extract the info help?

@lazka
Copy link
Member Author

lazka commented Mar 27, 2023

scraping is (a) slow (b) not nice the the project being scraped and (c) prone to break quickly

@dscho
Copy link
Contributor

dscho commented Mar 28, 2023

I was recently made aware of this blog post describing how so-called "Bills of Materials" ("BOMs") are generated at scale at Microsoft. These BOMs are stored in .spdx.json files conforming to the SPDX standard and can be used by a GitHub Action called spdx-to-dependency-graph (https://github.com/jhutchings1/spdx-to-dependency-graph-action) to "quickly receive Dependabot alerts for package manifests which GitHub doesn't directly support".

It should be (relatively) straight-forward to generate such .spdx.json files from the information present in the PKGBUILD files (or from the .PKGINFO files contained in the .tar.pkg.zst files). Not the least involved project, I know. But an option.

@lazka
Copy link
Member Author

lazka commented Mar 28, 2023

Thanks. From what I understand this still only supports the ecosystems listed here https://github.com/advisories, so packages from pip, ruby, rust, and go would be relevant, but that's only a fraction of our packages.

For the record, my current tactic is manually look at:

@lazka lazka added this to Roadmap Mar 31, 2023
@dscho
Copy link
Contributor

dscho commented Mar 31, 2023

@lazka you're correct. I thought that packages using "other" package management systems could be used here, too, but it seems that there is no standardized way to label the CVEs accordingly ☹️

@lazka lazka moved this to Todo in Roadmap Apr 9, 2023
@lazka
Copy link
Member Author

lazka commented Sep 5, 2023

https://dependencytrack.org/ might be worth a look

(and https://github.com/CycloneDX/cdxgen to get some BOMs for testing)

@lazka
Copy link
Member Author

lazka commented Mar 19, 2024

As a first step, we now automatically create a SBOM file for the git repo content: https://github.com/msys2/MINGW-packages/releases/tag/srcinfo-cache

It only contains some pypi packages + curl atm (for pypi we have the pypi names, and curl is the only package tagged with a CPE atm)

image

The only public sbom scanner I found was https://snyk.io/code-checker/sbom-security/ (it has a rate limiting...)

Next step: add more CPEs, add a metadata field for the real upstream version (we sometimes change them to work with pacman)

@lazka
Copy link
Member Author

lazka commented Mar 22, 2024

https://github.com/anchore/grype also seems to work outside of the language ecosystems \o/

image

@lazka lazka moved this from Todo to In Progress in Roadmap Apr 3, 2024
@lazka
Copy link
Member Author

lazka commented Apr 3, 2024

@lazka lazka closed this as completed Apr 3, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in Roadmap Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

4 participants