Replies: 3 comments
-
One problem with this approach is that there is no integrity checking for implicit gem dependencies as the actual versions of the dependencies are negotiated rather than explicitly defined. I'm not sure how to get around this limitation... yet |
Beta Was this translation helpful? Give feedback.
-
https://rubygems.org/ could maintain a transparency log of all assets published. When building your Gemfile.lock you could include the latest transparency log merkle root in that file:
The latest tl root would be presented somewhere prominently on the website and "bundle lock" would update it. then for every package downloaded rubygems would need to present the path in the transparency log to the hash of the asset requested. |
Beta Was this translation helpful? Give feedback.
-
We'll be implementing this through lockfile checksums. We'll provide a way to enable them in Bundler 2.6. |
Beta Was this translation helpful? Give feedback.
-
I want to start the discussion of introducing the concept of Subresource Integrity (SRI) into the Gemfile.
Here is an example of what it may look like:
The goal is exactly the same as SRI but translated to gems:
Using this technique, it would be more or less impossible for a gem version to be replaced with a malicious one as it will not match the specified hash and therefore will never be installed.
To enable this feature, there will need to be a standardized technique to determining the hash of a gem. Likewise, the hash would need to be made public by gem authors and possibly the gem repositories. E.g RubyGems.
Having Gem Integrity, will help to protect the Ruby community from malicious actors.
Using Gem Integrity as a foundation, we could also provide additional value added features. Some ideas are:
I would love to hear everyone's thoughts on this.
Beta Was this translation helpful? Give feedback.
All reactions