A fast and small Rust library to make Electron apps more secure.

Overview

electron-hardener

crates.io version crate documentation MSRV crates.io downloads CI

A Rust library and command line tool to harden Electron binaries against runtime behavior modifications.

This provides a way to harden Electron applications against a specific class of runtime behavior modification. Specifically, if an unprivileged process can't write to the application's binary file or process address space, it should not be able to change what an app does at runtime.

The library provides two sets of functionality:

  • An interface to view and modify the status of fuses in an application, similar to the official fuses package.
  • A fast and configurable alternative implementation of the electron-evil-feature-patcher tool created by Dimitri Witkowski. All patches it can perform are also exposed in this crate. See its README for more details on how it works.

Usage

Library

The library exposes a simple and configurable interface:

use electron_hardener::{ElectronApp, Fuse, NodeJsCommandLineFlag};

let mut app = ElectronApp::from_bytes(&mut application_bytes)?;

app.set_fuse_status(Fuse::RunAsNode, false)?;

app.patch_option(NodeJsCommandLineFlag::Inspect)?;

Check out the command line tool's source or the example to see more ways to use it.

Command line tool

The command line tool exposes the same functionality and interface as electron-evil-feature-patcher:

electron-hardener ./path/to/packaged/electron/app

Install

Library

In your project's Cargo.toml file:

electron_hardener = "0.1

Command line tool

Make sure you have a Rust compiler installed and then run

cargo install electron-hardener

MSRV

The Minimum Supported Rust Version is currently 1.46.0. This will be bumped to the latest stable version of Rust when needed.

Credits

Made with ❤️ by the 1Password team, with full credits to Dimitri Witkowski for taking the time and effort to discover the command line flags that can be disabled, and finally creating the original tool which served as inspiration for this project.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
You might also like...
An independent Rust text editor that runs in your terminal!
An independent Rust text editor that runs in your terminal!

Ox editor Ox is a code editor that runs in your terminal. About The Project Ox is a code editor. It was written in Rust using ANSI escape sequences. I

Rust :heart: Emacs

Rust ❤️ Emacs A community-driven port of Emacs to Rust. Table of Contents Why Emacs? Why Rust? Why A Fork? Getting Started Requirements Dockerized dev

A modern editor with a backend written in Rust.
A modern editor with a backend written in Rust.

Xi Editor (pronounced "Zigh") A modern editor with a backend written in Rust. Maintenance status: The xi-editor project is not currently under active

Web base text editor written in rust
Web base text editor written in rust

Ultron Ultron is a web based monospace text-editor with syntax highlighting, completely written in rust. I wrote this code editor for my very specific

Rust-based traffic editor for RMF

Traffic Editor III Welcome to Traffic Editor III. install stuff Unfortunately we need a newer Rust than what comes with Ubuntu 20.04. First make sure

My own personal code editor built with Rust + OpenGL
My own personal code editor built with Rust + OpenGL

Glyph This is my personal code editor that I am building for fun and to get more familiar with OpenGL. Glyph currently supports Vim keybinds, syntax h

A simple terminal-based editor made in rust!

ELuna Editor The terminal-based editor for europa lang. Goals Be as minimal as possible, but retain conveniences found in other editors. Do not add fe

Ginkgo is a text editor built entirely in Rust
Ginkgo is a text editor built entirely in Rust

Ginkgo is a text editor built entirely in Rust. It supports cursor movements, CTRL commands, select vim commands, insert vs. normal modes, and more. Ginkgo is based on my text editor JED, which itself was based on the popular online editor Kilo.

a shiny test framework for rust

Ooh, shiny! Shiny makes you less distracted with copying over initialization code in test cases. It also has a fancy syntax similar to Ruby's RSpec or

Releases(v0.2.2)
  • v0.2.2(Sep 22, 2021)

    [0.2.2] - 2021-09-22

    Changed

    • Updated minimum supported Electron version to 15.
    • Deprecated patching with NodeJsCommandLineFlag. This has been superseded by the NodeCliInspect fuse.
    • Deprecated patching with DevToolsMessage. It is no longer needed due to the functionality provided by the NodeCliInspect fuse.

    New

    • Added support for Electron's experimental cookie encryption fuse added in version 13.
    • Added support for Electron's new fuses to disable NodeJS debugging flags and environment variables.
    • Added support for Electron's new ASAR integrity fuses to protect against unknown code from being ran.
    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(Jun 1, 2021)

Owner
1Password
1Password remembers all your passwords for you. It keeps your digital life secure and always available, safe behind the one password that only you know.
1Password
Lightning-fast and Powerful Code Editor written in Rust

Lapce Lightning-fast and Powerful Code Editor written in Rust About Lapce is written in pure Rust, with UI in Druid. It's using Xi-Editor's Rope Scien

Lapce 22.1k Jan 8, 2023
syntect is a syntax highlighting library for Rust that uses Sublime Text syntax definitions.

syntect is a syntax highlighting library for Rust that uses Sublime Text syntax definitions. It aims to be a good solution for any Rust project that needs syntax highlighting, including deep integration with text editors written in Rust.

Tristan Hume 1.5k Jan 8, 2023
Linting your Rust-files in Atom, using rustc and cargo.

linter-rust Linting your Rust-files in Atom, using rustc and cargo. Files will be checked when you open or save them. Installation Install Rust and/or

Atom Linter 42 Sep 28, 2022
Wealthy Rich ported to Rust! This aims to be a crate for rich text and beautiful formatting in the terminal

Wealthy Rich ported to Rust! This aims to be a crate for rich text and beautiful formatting in the terminal

Sourajyoti Basak 20 Dec 29, 2022
A pathtracer written in rust - runs in the web and includes an editor

Webtracer A pathtracer written in rust - runs in the web and includes an editor Rendering is parallelized and utilizes all cpu cores You can easily ed

Shapur 5 Oct 7, 2022
Rustpad is an efficient and minimal collaborative code editor, self-hosted, no database required

Rustpad is an efficient and minimal open-source collaborative text editor based on the operational transformation algorithm

Eric Zhang 2.5k Dec 31, 2022
Borderlands 3 Save/Profile Editor for Windows/MacOS and Linux!

Borderlands 3 Save Editor A tool to help you modify your Borderlands 3 Saves and Profiles. Currently it runs on Windows, Mac OS and Linux. It supports

Zak 195 Jan 4, 2023
Fusion Reactor for Rust - Atom Rust IDE

токамак Fusion Reactor for Rust - Syntax highlighting Creating Cargo project Support for Cargo projects Code Completion with Racer Managing Rust toolc

Theo M. Bulut 403 Nov 28, 2022
A terminal-based text editor written in Rust

Iota Iota is a terminal-based text-editor written in Rust. Here's what it looks like right now, editing itself. Motivation Iota was born out of my fru

Greg Chapple 1.6k Jan 8, 2023
A text editor in ≤1024 lines of code, written in Rust

Kibi: A text editor in ≤1024 lines of code, written in Rust A configurable text editor with UTF-8 support, incremental search, syntax highlighting, li

Ilaï Deutel 881 Dec 29, 2022