Skip to content
/ skeld Public

a tui tool for opening projects in a restricted sandbox to prevent supply chain attacks such as typosquatting

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

hacrvlq/skeld

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Skeld

Programming is constant remote code execution.1

Or have you inspected all your dependencies? It's easy to write a library that steals private ssh keys on the side.

Skeld mitigates this risk by opening projects in a restricted sandbox where only the required paths are accessible. A sandbox can be conveniently created via a terminal UI by selecting a project, which is then opened in the configured editor/IDE (inside a sandbox).

screenshot of the skeld tui

The paths that the sandbox can access are defined on a per-project basis:

# projects are specified with a single TOML file

[project]
project-dir = "~/dev/skeld"
# paths can be whitelisted read-only
whitelist-ro = [
  # some string interpolation is supported
  # (see `man 'skeld(7)'`, section "String Interpolation")
  "$(CONFIG)/nvim",
]
# paths can be whitelisted read-write
whitelist-rw = [
  "$(DATA)/nvim",
  "$(STATE)/nvim",
]
# including options from other files is also supported
include = ["rust"]

Installation

Note that only Linux is supported.

Important

Skeld depends on Bubblewrap, so it must be available in PATH.

Getting Started

Without any configuration, the skeld UI displays a blank screen. Some configuration is therefore inevitable. Below is an example configuration for the neovim editor.

Configuration

Create a file $XDG_CONFIG_HOME/skeld/config.toml with the following content:

# it is possible to disable the help text in the bottom right corner
disable-help = false

# colorscheme from the screenshot
[colorscheme]
normal = "#DCD7BA"
banner = "#E6C384"
heading = "#C0A36E"
label = "#727169"
keybind = "#6A9589"
background = "#1F1F28"

[[commands]]
name = "<edit>"
keybind = "e"
command = ["nvim"]
# whether to detach from terminal;
# should be true for GUI commands and false for TUI commands
detach = false

[[commands]]
name = "<quit>"
keybind = "q"
# if 'command' is empty, skeld quits immediately
command = []

# user-wide whitelists
[project]
# read-write whitelists
whitelist-rw = [
  "$(DATA)/nvim",
  "$(STATE)/nvim",
]
# read-only whitelists
whitelist-ro = [
  "~/.bashrc",
  "$(CONFIG)/nvim",

  "/usr",
  "/etc",
]
# symlink whitelists
# NOTE: depending on the system, these may not be symlinks;
#       so they may need to be in 'whitelist-ro'
whitelist-ln = [
  "/bin",
  "/lib",
  "/lib64",
]
add-tmpfs = [
  "/tmp",
]
# as long as no secrets are stored in environment variables,
# this should be fine
whitelist-all-envvars = true

# configure the editor/IDE used to open projects
[project.editor]
# command used when a project specifies a file to be opened initially
cmd-with-file = ["nvim", "$(FILE)"]
# command used when no initial file is specified
cmd-without-file = ["nvim", "."]
# whether to detach editor from terminal;
# should be true for GUI editors and false for TUI editors
detach = false

Refer to man 'skeld(7)' for all supported options.

Projects

To add a project, create a file at $XDG_DATA_HOME/skeld/projects/<your_project_name>.toml with the following content:

[project]
project-dir = "<your_project_directory>"
# optionally, a file to be opened initially can be specified
initial-file = "src/main.rs"

# project-specific whitelists
whitelist-dev = [
  "/dev/dri/",
]
# Language-specific whitelists can be separated into different a file.
# To do so, create a file at $XDG_DATA_HOME/skeld/include/<your_lang>.toml
# with the language-specific whitelists.
include = ["<your_lang>"]

Refer to man 'skeld(7)' for all supported options.

Documentation

The documentation is available at man 'skeld(7)'

Building

Requires the Rust Compiler.

cargo build --release
./target/release/skeld

To build the man page, scdoc is required.

scdoc < docs/skeld.7.scd > skeld.7

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Footnotes

  1. This might be slightly overdramatized.

About

a tui tool for opening projects in a restricted sandbox to prevent supply chain attacks such as typosquatting

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Languages