Code Monkey home page Code Monkey logo

final-project-sudo's Introduction

Garnet

Garnet is a secure and performant browser isolation prototype that replays remote browser draw commands in local browser via WebAssembly.

Overview

Garnet consists of three major components: Browser Extension, Server and Modified Chromium.

Garnet Archetecture

Browser Extension

  • Capture and send I/O events in local browser
  • Verify the draw commands from server is valid (no malicious code injected)
  • Render the draw commands which are sent from server via Skia's WebAssembly build

Server

  • Receive I/O events from local browser and simulate the same mouse/keyboard events on Modified Chromium
  • Listen to the file that Chromium write draw command to and convert the draw commands to Skia JS draw commands
  • Send Skia JS draw command to browser extension

Modified Chromium

  • Logging draw commands (Skia draw commands, ui/gfx commands) to a temp file which is listened by server

For more details:

Project Structure

Here we present where major components are located and their key files.

  • Brwoser Extension: client/web-extension/
    • manifest.json: extension manifest file which contains info such as version, name, script path
    • background.js: script also run in background which delegate the request to server
    • index.html + index.js: create canvas for display draw commands(from server) via WebAssembly
  • Server: server/
    • index.js: start chromium base on request; listen to the file that Chromium write draw command to and convert the draw commands to Skia JS draw commands; send Skia JS draw command to browser extension
  • Modified Chromium: chromium @ ac814e8/
    • ui/gfx/render_text.cc, chromium/ui/gfx/canvas_skia.cc: chromium internal text rendering commands
    • chromium/third_party/skia/src/core/SkCanvas.cpp: SkCanvas draw commands for basic shapes and images

Development

Server

  1. Install Nodejs (>= 10.13.0).

  2. Clone the repo:

git clone https://github.com/ECS-251-W2020/final-project-sudo.git
cd final-project-sudo
  1. Setup chromium submodule:
git submodule init
git submodule update

Compile the modified chromium to executable. Refer to chromium.org(skip "Get the code")

  1. Install dependencies:
cd server
npm install
  1. Start the server:
npm start

Client

Install the web extension in local browser:

  1. Open the Extension Management page by navigating to chrome://extensions.
  2. Enable Developer Mode by clicking the toggle switch next to Developer mode.
  3. Click the LOAD UNPACKED button and select the extension directory.
  4. Enjoy your secure browsing experience

final-project-sudo's People

Contributors

atonyxiao avatar kingdido999 avatar wukeyi avatar yunqiuguo avatar

Stargazers

 avatar  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.