Replies: 8 comments 4 replies
-
Looks good to me. One note: this does not really contribute to supply chain security because these wing modules may be bringing third party other modules under them and they're all hosted on NPM (currently) and we don't have control over npm (and it's not audited by us). So in case of an actual supply chain attack, if a package is compromised, we can't do anything about it. It would contribute to supply chain security if we came up with a process to freeze every single package and all its dependencies on release, that would be a valuable addition. Thoughts on naming: maybe we call it "side loading". So everything under |
Beta Was this translation helpful? Give feedback.
-
I think if we impose that libraries in |
Beta Was this translation helpful? Give feedback.
-
Yep, that's pretty much what I'm saying. the process needs to be explicit about that. Because if something slips in with a dependency on anywhere else other than @winglang hosted packages, it defeats the purpose. |
Beta Was this translation helpful? Give feedback.
-
This feels like security theater because at scale it's going to be all rubber stamps. So if we want this from a marketing perspective then it makes sense but I'm not convinced of the technical merits. My last interaction with something like this was the Jenkins ecosystem, but they at least controlled all dimensions (GitHub org and the actual distribution via a global Artifactory setup) The more rules/strictness we add the safer it would get of course, but at the end of the day there's only two targets:
|
Beta Was this translation helpful? Give feedback.
-
Have you considered Deno's module system?
I guess we can mark packages which depend only on "standard library" (which is reviewed) as "semi-trusted" packages (or packages w/o "External" dependencies). And well, packages which rely on "semi-trusted" packages as "semi-semi-trusted (lol)". And well, NPM is your wild west, proceed with caution. I am also not sure if it will be realistic to review all the packages any deeper than
anyway, which will provide a false feeling of security to end users – do we want that? |
Beta Was this translation helpful? Give feedback.
-
Here is what I think about this in terms of future plans: Assuming that we'll have a WebAssembly runtime that only implements node core modules that WingSDK needs ( Controlling this sort of thing is really easy going through something like WASI. I like the Cap based module system of Deno, and I like to apply it at runtime level to actually enforce module resolution and not just do some static analysis and say, "well I could not find any What Elad suggests, lays the foundation towards that goal. If we had some sort of pipeline that all our libraries went through, then making Wing libraries compatible with Wing runtime should be a matter of changing build scripts in a single place. So library authors just write normal JS libraries, and our pipeline manages building into JSII or webpackify'ing it so it can go into the WASM runtime in the future. |
Beta Was this translation helpful? Give feedback.
-
Requiring the team who writes the code to modify the CLI command parameters for compilation feels a bit out of bounds. I have worked in many environments where the folks who write code can not mutate the build chain in any meaningful way. I would suggest an additional ability to have a package.conf or another type of package configuration file where one can explicitly allow Potentially adding a feature allowing for compile overrides in the form of a chain (env_vars, paclage_conf, CLI params). |
Beta Was this translation helpful? Give feedback.
-
Related: https://twitter.com/rybickic/status/1603622787087994880 |
Beta Was this translation helpful? Give feedback.
-
(working backwards)
Wing Libraries
A wing library is a collection of types that can be used by other wing libraries or apps.
Open-source supply-chain attacks are becoming one of the most common and dangerous attack vectors in the industry. To increase the trust, safety and quality of the wing library ecosystem, wing takes a unique approach to package publishing.
The basic idea is that "trusted" winglang libraries are normal npm packages that are published under the
@winglang
scope, and their code is hosted under thewinglang
github org. These libraries can be authored by anyone but they are always published by the winglang project and not their authors.This serves two purposes:
Let's walk through the user experience of installing and publishing trusted and untrusted wing libraries.
Installing wing packages
To install a trusted wing package, use:
Use it like so:
Under the hood, wing uses npm to install the package
@winglang/redis
into yourpackage.json
.Publishing wing packages
To publish a new wing library, all you have to do is simply submit a pull request to the https://github.com/winglang/libs repository.
This repository includes a directory for each library, and is already set up to take care of builds, tests and releases. Just put your code in the right place and we'll take care of the rest.
Your pull request will be go through a quick review by one of our community members. The purpose of this review is to help you make your library awesome and that it meets the wing standards. Once reviewed, it will be merged and immediately released.
Untrusted libraries
As mentioned above, winglang libraries are simply npm (JSII) packages, so anyone can publish anything to npm.
You can then use
npm
to install this library:And use
bring
like normal:But:
$ wing compile hello.w ERROR: trying to bring untrusted library "my-wing-lib". Use --allow-untrusted=my-wing-lib to allow.
So you'll have to explicitly opt-in to allow this library:
Beta Was this translation helpful? Give feedback.
All reactions