GithubHelp home page GithubHelp logo

isabella232 / lavamoat Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lavamoat/lavamoat

0.0 0.0 0.0 170.55 MB

tools for sandboxing your dependency graph

License: MIT License

JavaScript 99.73% HTML 0.23% Shell 0.01% CSS 0.03%

lavamoat's Introduction

LavaMoat

LavaMoat

LavaMoat is a set of tools for securing JavaScript projects against a category of attacks called software supply chain attacks.

This genre of attack occurs when a malicious dependency makes it way into a developer's application. An attacker could use the vulnerable dependency to then steal important secrets like credit card numbers, private keys, or personal data.

These attacks have already hit the cryptocurrency ecosystem and present a significant risk for the developers and users of wallets and apps.

In order to help mitigate the risk of such an attack we are building a suite of tools that range from a node-based runtime, to plugins for common app bundlers (eg webpack, browserify), to dependency analysis and visualization tools.

The goal of LavaMoat is to bring added protections to modern JavaScript apps without having to rewrite them from scratch and automate a good first-start security configuration.

How to secure your app against supplychain attacks

  1. disable/allow dependency lifecycle scripts (eg. "postinstall") via @lavamoat/allow-scripts
  2. run your server or build process in lavamoat-node
  3. build your ui with LavaMoat for [Webpack][LavamoatWebpack] or Browserify

How LavaMoat works

The LavaMoat runtime reduces the supplychain risk in three primary ways:

  1. Prevent modifying JavaScript's primordials (Object, String, Number, Array, ...)
  2. Limit access to the platform API (window, document, XHR, etc) per-package

Both are provided by SES containers. Platform API access is passed in via a LavaMoat configuration file.

SecureEcmaScript (SES)

SES is the sandbox used in LavaMoat. See SES's secure computing guide to learn more about the risks of untrusted javascript.

LavaMoat in Node.js

Run your server or app building code with protections via LavaMoat Node

LavaMoat in the browser

When using LavaMoat in the browser, you can just use your favorite bundler if there is an available plugin.

App bundles have two major components:

  1. Runtime (aka kernel / loader / prelude / trusted computing base) This is the code that initializes and runs the bundle. For example, the implementation of the require function.

  2. Module sources This includes the js content of the module sources, and sometimes some config information like module name aliases.

LavaMoat modifies the bundle's runtime to enforce the configured constraints.

Bundler Plugins:

Additional tools

In addition to the LavaMoat runtime bundler plugins, there are some tools to help analyze your dependency graph and configuration.

See lavamoat-viz for a demo of the tool.

Further reading on software supplychain security

Articles:

Videos:

Supporters

Made with love by MetaMask

Funded by ConsenSys

Runs on Agoric

lavamoat's People

Contributors

kumavis avatar etdu avatar dependabot[bot] avatar bentobox19 avatar v-gjy avatar gudahtt avatar whymarrh avatar ethosdev avatar tmpfs avatar ryanml avatar snyk-bot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.