๐Ÿšฉ Show sensitive command summary when open a new terminal

Overview

Build







๐Ÿšฉ Show sensitive command summary when open a new terminal
๐Ÿ‘€ Clear sensitive commands from shell history
๐Ÿ™ˆ Stash your history command before presentations OR screen sharing


Shellclear

The idea behind shellclear is to provide a simple and fast way to secure you shell commands history

Installation

brew tap rusty-ferris-club/tap && brew install shellclear

Or download the binary file from releases page.

Terminal Summary

Add in shell profile (~/.zshrc / .bash_profile / .bashrc)

eval $(shellclear --init-shell)

motd

Using

$ shellclear --help

Secure shell commands

USAGE:
    shellclear [OPTIONS] [SUBCOMMAND]

OPTIONS:
        --config-dir     Set configuration directory path
    -h, --help                         Print help information
        --init-shell                   Show sensitive findings summary for MOTD
        --log                   Set logging level [default: INFO] [possible values: OFF,
                                       TRACE, DEBUG, INFO, WARN, ERROR]
        --no-banner                    Don't show the banner
    -V, --version                      Print version information


SUBCOMMANDS:
    config     Create custom configuration
    find       Find sensitive commands
    help       Print this message or the help of the given subcommand(s)
    restore    Restore backup history file
    stash      Stash history file

Supported Shells

  • bash
  • zshrc
  • fish

๐Ÿ‘€ Find Sensitive Commands

Sensitive data can be stored in your history file when export a token of something or running a script with token.

shellclear find --format table

find

๐Ÿงน Clear findings :

shellclear clear

๐Ÿงณ Backup shell history before clear

shellclear clear --backup

๐Ÿ™ˆ Stash/Pop/Restore

You can stash your history shell by running the command:

shellclear stash

Now your history shell is clear, to bring back your history run the command:

shellclear stash pop

You can also restore your history backup file by running the command:

shellclear stash restore

โœ๏ธ External Configuration

Create custom configuration by running the command

shellclear config

Config command will create:

  1. Custom pattern template for adding a custom risky patterns
  2. Ignore file to allows you ignore specific pattern

Validate Config Files

Validate syntax file

shellclear config validate

Delete Config Folder

Validate syntax file

shellclear config delete

Ignores Pattern

Manage pattern ignores

shellclear config ignores

Thanks

To all Contributors - you make this happen, thanks!

Copyright

Copyright (c) 2022 @kaplanelad. See LICENSE for further details.

Comments
  • add --config-dir support to shellclear cli

    add --config-dir support to shellclear cli

    I am not sure if this exists or is unnecessary but I couldn't figure out how to set the configuration files directory through the CLI and I want to save it in a different location than homedir. So I decided to add this to the code, let me know if that works out for you. Thanks.

    opened by boaz-quotient 6
  • Issue #64: Add tests for curl, URL basic-auth, and wget

    Issue #64: Add tests for curl, URL basic-auth, and wget

    cURL: The -u flag and the 'Authorization' header may contain plaintext or base64-encoded secrets. URL: A URL may contain a login combination. wget: various flags pass around username and passsword combinations.

    Fixes #64 (and more).

    opened by MegaManSec 4
  • [Feature Request / Idea]: Detect curl (and other)

    [Feature Request / Idea]: Detect curl (and other) "Authorization header" usage

    Suggestion / Feature Request

    Curl, wget, and other http tools can be used with authorization headers, like the Basic Authorization header, which contains a base64-encoded username:password combo.

    For example: curl -H 'Authorization: Basic $(printf username:password|base64)' website.com is the same as curl -H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' website.com

    According to https://reqbin.com/req/c-haxm0xgr/curl-basic-auth-example, a user can also use the command curl -u username:password website.com

    It would be great if shellclear could detect instances of this, as well as in other programs like wget, for example.

    enhancement 
    opened by MegaManSec 3
  • [Feature Request / Idea]: Mask findings

    [Feature Request / Idea]: Mask findings

    Suggestion / Feature Request

    Today, shellclear presents the findings directly to the stdout using the command shellclear find. To make more secure, we can mask the secrets and show part of the secret. Optional libraries to use: https://github.com/rusty-ferris-club/mask-text https://github.com/rusty-ferris-club/redact-engine

    The second problem is when we use shellcelar clear, the command deletes the finding from the history. In some cases, we want to keep the command and just hind the secrets (we can use the same logic from the first case.

    Maybe add a flag for how to act when the user wan to clear mask/delete

    enhancement 
    opened by kaplanelad 0
  • [Feature Request / Idea]: Use XDG Base Directory Specification by default

    [Feature Request / Idea]: Use XDG Base Directory Specification by default

    Suggestion / Feature Request

    The shellclear/ and .shellclear/ directories unnecessarily pollute users' home directory.

    The XDGBDS defines where these files should be placed with environment variables in order to avoid this.

    The XDG Base Directory Specification is based on the following concepts:

    • There is a single base directory relative to which user-specific data files should be written. This directory is defined by the environment variable $XDG_DATA_HOME.

    • There is a single base directory relative to which user-specific configuration files should be written. This directory is defined by the environment variable $XDG_CONFIG_HOME.

    • There is a single base directory relative to which user-specific state data should be written. This directory is defined by the environment variable $XDG_STATE_HOME.

    • There is a single base directory relative to which user-specific executable files may be written.

    • There is a set of preference ordered base directories relative to which data files should be searched. This set of directories is defined by the environment variable $XDG_DATA_DIRS.

    • There is a set of preference ordered base directories relative to which configuration files should be searched. This set of directories is defined by the environment variable $XDG_CONFIG_DIRS.

    • There is a single base directory relative to which user-specific non-essential (cached) data should be written. This directory is defined by the environment variable $XDG_CACHE_HOME.

    • There is a single base directory relative to which user-specific runtime files and other file objects should be placed. This directory is defined by the environment variable $XDG_RUNTIME_DIR.

    All paths set in these environment variables must be absolute. If an implementation encounters a relative path in any of these variables it should consider the path invalid and ignore it.

    enhancement 
    opened by JacobTravers 4
  • [Bug]: Errors immediately, fish, macos:

    [Bug]: Errors immediately, fish, macos: "mapping values are not allowed in this context"

    What happened?

    Installed v0.4.4 via brew. My shell is fish. Sourced, ran shellclear find. Exited 1 with no output.

    What type of Operating System?

    macOS

    Steps to produce this issue.

    $ shellclear --init-shell | source
    $ shellclear --log TRACE find
    [2022-09-15T22:17:03Z DEBUG shellclear::state] state folder found: "/Users/rmartine/.shellclear"
    [2022-09-15T22:17:03Z DEBUG shellclear::shell] shell PowerShell not found
    
         _          _ _      _
     ___| |__   ___| | | ___| | ___  __ _ _ __
    / __| '_ \ / _ \ | |/ __| |/ _ \/ _` | '__|
    \__ \ | | |  __/ | | (__| |  __/ (_| | |
    |___/_| |_|\___|_|_|\___|_|\___|\__,_|_| 0.4.4
    [2022-09-15T22:17:03Z DEBUG shellclear::engine] app config folder not found in path: /Users/rmartine/shellclear
    [2022-09-15T22:17:03Z DEBUG shellclear::engine] clear history commands from path: /Users/rmartine/.bash_history, params: is clear: false
    [2022-09-15T22:17:03Z DEBUG shellclear::engine] time elapsed to read history file: 505.625ยตs. found 500 commands
    [2022-09-15T22:17:03Z DEBUG shellclear::engine] time elapsed for detect sensitive commands: 10.821583ms
    [2022-09-15T22:17:03Z DEBUG shellclear::engine] clear history commands from path: /Users/rmartine/.zsh_history, params: is clear: false
    [2022-09-15T22:17:03Z DEBUG shellclear::engine] time elapsed to read history file: 207.292ยตs. found 18 commands
    [2022-09-15T22:17:03Z DEBUG shellclear::engine] time elapsed for detect sensitive commands: 143.667ยตs
    [2022-09-15T22:17:03Z DEBUG shellclear::engine] clear history commands from path: /Users/rmartine/.local/share/fish/fish_history, params: is clear: false
    [2022-09-15T22:17:03Z DEBUG shellclear] mapping values are not allowed in this context at line 2563 column 58
    
        Caused by:
            mapping values are not allowed in this context at line 2563 column 58
    
    bug 
    opened by rmartine-ias 2
  • Remove xz-utils lib when installing via sh file

    Remove xz-utils lib when installing via sh file

    opened by kaplanelad 0
Releases(v0.4.7)
Owner
Rusty Ferris Club
A computer club for people who love Rust. We're also building stuff, and teaching each other stuff.
Rusty Ferris Club
A simple program to show a histogram on the terminal.

A simple program to show a histogram on the terminal.

ไพไบ‘ 4 Aug 10, 2021
Safer Nostr is a service that helps protect users by loading sensitive information (IP leak) and using AI to prevent inappropriate images from being uploaded.

Safer Nostr is a service that helps protect users by loading sensitive information (IP leak) and using AI to prevent inappropriate images from being uploaded. It also offers image optimization and storage options. It has configurable privacy and storage settings, as well as custom cache expiration.

Thomas 4 Dec 29, 2022
belt is a command line app that can show your time from a list of selected time zones

A CLI app to show your time from a list of selected time zones, and a rust lib to parse dates in string formats that are commonly used.

Rollie Ma 23 Nov 4, 2022
Fast command-line application to show the moon phase

moon-phases Command-line application to show the moon phase for a given date and time, as a text string, emoji, or numeric value. It can also show the

mirrorwitch 3 Oct 7, 2023
Shell Of A New Machine: Quickly configure new environments

Shell Of A New Machine soanm is a dead-simple tool for easily configuring new UNIX machines, with almost zero prerequisites on the target machine. All

Ben Weinstein-Raun 41 Dec 22, 2022
JiaShiwen 12 Nov 5, 2022
H2O Open Source Kubernetes operator and a command-line tool to ease deployment (and undeployment) of H2O open-source machine learning platform H2O-3 to Kubernetes.

H2O Kubernetes Repository with official tools to aid the deployment of H2O Machine Learning platform to Kubernetes. There are two essential tools to b

H2O.ai 16 Nov 12, 2022
Terminal UI for erhanbaris/smartcalc, a new way to do calculations on-the-fly

smartcalc-tui Terminal UI for erhanbaris/smartcalc, a new way to do calculations on-the-fly. From the README: Do your calculation on text based querie

Aaron Ross 12 Sep 14, 2022
Show unused code from multi-crate Rust projects

Warnalyzer Remove unused code from multi-crate Rust projects. The dead_code lint family of rustc is limited to one crate only and thus can't tell whet

null 75 Dec 27, 2022
Show active TCP connections on a TUI world map.

Maperick Show active TCP connections on a TUI world map. Still WIP, but it's gonna be good. Setup git clone [email protected]:schlunsen/maperick.git cd m

Rasmus Schlรผnsen 5 Jul 8, 2022
๐Ÿ‘‘ Show in-organization ranking of GitHub activities such as review count.

gh-ranking Show in-organization ranking of GitHub activities such as review count. Installation gh extension install yukukotani/gh-ranking Usage USAG

Yuku Kotani 3 Dec 28, 2022
๐ŸŽจโœจ Show off your soothing color palette

?? Show off your soothing color palette โœจ Palettes ยท install ยท contribute ยท Gratitute ?? Palettes Rust C Lua Ruby Go sh js ?? install Installing this

BinaryBrainiacs 4 Jan 28, 2023
Generate a vanity address (`juno1wynd...`) to show your support for WYND DAO

WYND Generator When you generate a new mnemonic, it is very random (must be to be secure), and you cannot predict the address you will get. However, i

null 9 Dec 8, 2022
A very basic show-case of rust on the esp32 in 2022

Readme This example code does the following: Set up a WiFi connection on the ESP32-C3 Spawn a thread using std::thread in which we listen for incoming

Mattia 13 Jan 19, 2023
Here we will show you how to build a simple parser.

A Rustic invitation to parsing: Calculator demo This is the code repository that accompanies the Rustic invitation to parsing blog post. It provides a

EqualTo 5 Apr 25, 2023
App to collect ram/cpu usage from OS and show it in pretty graphs

System info collector This is simple app to collect data about system cpu and memory usage over time. After collecting results into csv file, html fil

Rafaล‚ Mikrut 3 Jul 11, 2023
Show HTML content "inside" your egui rendered application

hframe Show HTML content "inside" your egui rendered application. "hframe" stands for "HTML Frame". Note: hframe only works when the application is co

Franco Profeti 3 Feb 26, 2024
A command line application which sets your wall paper with new image generating pollens once they arrive.

pollenwall Table of Contents pollenwall About Installation Binary releases Build from source Usage Command Line Arguments Running as a service MacOS L

Pollinations.AI 2 Jan 7, 2022
SKYULL is a command-line interface (CLI) in development that creates REST API project structure templates with the aim of making it easy and fast to start a new project.

SKYULL is a command-line interface (CLI) in development that creates REST API project structure templates with the aim of making it easy and fast to start a new project. With just a few primary configurations, such as project name, you can get started quickly.

Gabriel Michaliszen 4 May 9, 2023