-
Notifications
You must be signed in to change notification settings - Fork 10
scripts: Start of new requirements installer #2408
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
base: main
Are you sure you want to change the base?
Conversation
The reason why I picked the For example:
|
Sure but if that is going to be a consideration then we should have a at least a plan to take advantage of that, so please create an issue for it else I don't see why we should have roundabout ways to manage it. As an alternative, what we have talked about is for the requirement script to be able to download newer versions and at release create a pinned requirements listing. Would it make sense in a such requirements list to write |
Looks promising! |
My understanding was that this issue would cover that.
All the PURLs ideally. But matching CVEs against PURLs isn't a straight forward job, talking from experience from previous engagements... 😄
Yea I'm not against having a list of "installable" PURLs and then a sublist of aliases/additional resources which can be used to, for example, discover source code for |
Well, there was nothing there even suggesting that it should be implemented using queries on purls rather than our standard method of subscribing to security notices.
Note, I'm asking for sources to query against so I can evaluate which purls to use before I create specific mappings that are going to replaced, not which purls to query as I assume we want that for everything. And as you have previous experience, I thought you might have some suggestions. 😉
Aight, then I'll move towards this because it make more logical sense to me for the requirements installer, and then we can create a framework for increasing our query coverage with mappings later on. 👍 |
Sorry I misread it. I am not aware of any other sources that can query PURLs directly so we'll likely have to parse and translate.
Yea that sounds good. Let's focus on getting installations properly implemented and figure out security scanning later. Having extras/metadata part of the requirements structure doesn't hurt though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the reason for the DIY PURL parser over using one of the official ones? Other than that it's a fun exercise of course! 😄
Zero dependencies. |
If you truly want to achieve zero dependencies it would make sense to me to build this in a compiled language. Otherwise you will have to bundle this with bash. The go library is really straight forward if you want to give it a go (hehe)! |
Definitely in the future, but given how we have it today this is the simplest solution, and it doesn't require anything but a file to be included. Edit: Also as a note, the base image target we have is ubuntu so bash is preloaded. |
a415001
to
0069ec8
Compare
0069ec8
to
8225825
Compare
I have been working on this on and off for a while and now it is only missing a handler for helm-plugins, then it can install everything the current requirements installer can. |
This looks great! The only thing that is unfortunate is that it will be all done in the same layer in the Dockerfile. Would it be possible to perform them as separate layers so that you don't have to re-download everything if you just change one dependency? |
Not in a Docker/Containerfile directly, if we were to use something like Buildah and script the build process it would be easy, dunno if Docker has something similar 🤔 Perhaps if we had it generate/update a Docker/Containerfile with the steps to install it instead 🤔 My thinking though is that it will be a separate PR to make this ready for containers, and focus on the requirements first. |
Yep, that makes sense! |
helm-plugin support! next is to refactor, simplify, and harmonise how output is done. |
Warning
This is a public repository, ensure not to disclose:
What kind of PR is this?
Required: Mark one of the following that is applicable:
Optional: Mark one or more of the following that are applicable:
Important
Breaking changes should be marked
kind/admin-change
orkind/dev-change
depending on typeCritical security fixes should be marked with
kind/security
What does this PR do / why do we need this PR?
This aim to develop a lightweight requirements installer that can be used in a container as well as on workstations, using the current PURL format.
The goal is to be able to serve the tests/Dockerfile with the following types:
As much as possible is to be done in bash alone, debs are always installed first as that may install other package managers, but if needed they are expected to be installed before running the script.
The last type is provided by mapping, which isn't the greatest method, but the one that we kind of already use in the current ansible based approach.
Note that the purl parser does not attempt to be compliant, but tries to be enough for our purposes.
Information to reviewers
Currently I've tested to just run the script against the base requirement file when building a container.
We probably need to have a discussion around the purl types as we are using strange ways to refer to
golang
packages.Logically it does not make sense for us to refer to
golang
packages, as we are not fetchinggolang
packages. It should begithub
packages for a lot of these as we fetch them from their github releases.I'll wait with implementing more mappings until we have discussed this.
Checklist