Crates.io | electron-hardener |
lib.rs | electron-hardener |
version | 0.2.2 |
source | src |
created_at | 2021-04-23 17:55:15.654839 |
updated_at | 2021-09-22 18:28:35.375333 |
description | Utility to remove features from Electron that modify runtime behavior |
homepage | |
repository | https://github.com/1Password/electron-hardener |
max_upload_size | |
id | 388710 |
size | 57,368 |
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:
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.
The command line tool exposes the same functionality and interface as electron-evil-feature-patcher
:
electron-hardener ./path/to/packaged/electron/app
In your project's Cargo.toml
file:
electron_hardener = "0.1"
Make sure you have a Rust compiler installed and then run
cargo install electron-hardener
electron-harder
tracks the latest stable version of Electron. Functionality is currently tested on a minimum version of Electron 15. Older versions may partially work but this is not guaranteed.
The Minimum Supported Rust Version is currently 1.46.0. This will be bumped to the latest stable version of Rust when needed.
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.