& security lead ▪ Security Engineer in Residence @ Ruby Central Today, on stage @qrush ▪ Nick Quaranto ▪ RubyGems.org / Gemcutter.org original author ▪ Director of Platform Engineering @ Wistia
Move from Heroku, Rackspace to AWS • Nick had kids and wound down involvement ◦ Answering dozens of support tickets, responding to pages/downtime not sustainable (sounds familiar!) • Lots more contributors helped out Time is a flat circle
Always-on expectations • Lack of recognition and appreciation (see every HN post) • Financial sustainability challenges • Imposter syndrome and perfectionism
unauthenticated • All the normal surface area of a rails app • Reading & validating gems and (YAML) gemspecs and tarballs and gzipped files • Keeping rubygems & bundler users safe Security Isn’t Easy
no (major) left-pad style issues (yet) ◦ Plenty of other security issues regularly • Lots of expectations on a very public service • Needed some policies (Thanks Marty!)
• Check out CONTRIBUTING.md for setup instructions • Join #rubygems-org on Bundler Slack for questions • Run the app & tests locally ◦ It’s a Rails app, you got this! • Join us tomorrow @ Hack Spaces
don’t last 16+ years! • Funding for the long run, and a service that must be operational forever, is even harder • Focus on what will change instead of what won’t • Say thanks to those who help out
be summarized as two functions: • A function that verifies an artifact + sigstore bundle against a trusted root • A function that signs an artifact against a trusted root
to serve the trusted root → A service that issues signing certs based on OIDC tokens → Don’t forget the CT Log! → A service that records handwaves in a transparency log → A bundle format that has artifacts from all of the above
from scratch so difficult Writing a Sigstore client from scratch can be quite difficult for several reasons, primarily due to the complexity of the underlying cryptographic protocols, integration with various services, and handling security concerns. Here's a breakdown of the challenges you might face: 1. Complexity of the Sigstore Protocol 2. Cryptographic Foundations 3. Interfacing with Sigstore Services 4. Security Considerations 5. Integration with Other Tools 6. API Design and Usability 7. Testing and Debugging
signing & verification flows • 100% vendorable inside of RubyGems & Bundler ◦ And by extension, all Ruby distributions themselves • Don’t trust Sam to write novel cryptography code
are still (mostly) written in C • Ruby stdlib primitives are largely implemented in native code • Every layer of wrappers leads to increased impedance mismatches • Supporting old rubies + multiple implementations means even less can be taken for granted
native code is a no-go for language-level dependency • Need to be able to update sigstore-ruby outside of ruby releases • WASM, JVM, etc. • “Rewrite it in Rust” isn’t a panacea
Broken X509 path validation with intermediary CAs → Missing Ed25519 support → Missing public key der export → … plus everything else missing from the C-ruby gem jruby- openssl
amalgamation of multiple different systems • X509 for PKI • TUF for trusted material distribution • Merkle trees for transparency log inclusion • Signed notes for checkpoints
→ sigstore-conformance → tuf-conformance → Edited sigstore client doc → Convergence between different independent implementations → Mock sigstore implementations for testing → William Woodruff saved the day more times than I could count
HN hack when Nick was on a bus (2012?) ◦ RubyGems 1/30/13 Incident Status ◦ Rubygems Trust Model ◦ Gem Yanking ◦ HTTPS • Current challenges ◦ Sigstore? ◦ H1 • Lessons ◦ We’re a big target ◦ Lots of expectations on a very public service ◦ Need some policies (Thanks Marty)
take home • GIFs are still funny? • Narrative re startups today ◦ Rails apps can last, scale, and be sustainable ◦ Build enduring software • Focus on what can change / (wont change?) ◦ Probably will change: frontend stacks ◦ Won’t: databases, well factored code + biz logic • Talk through what has/ what hasn’t changed • Lapidary: The Art of Gemcutting - Speaker Deck
Rails in … (remember when) • Internal dependencies (Bundler exists because of Rails) ◦ https:/ /blog.rubygems.org/2015/02/01/rewriting-history.html • Frontend js story ◦ No current frontend builder/typescript currently ◦ Remember sass? • Designs (screenshots from archive.org) ◦ Original ◦ Dockyard redesign https:/ /dockyard.com/blog/2014/11/18/rubygems-redesign • Tests ◦ Rspec/Cucumber ◦ System/integration tests ◦ Current state