____ __ ____ _ _ _
/ ___| __ _ / _| ___ / ___| | |__ ___ | || |
\___ \ / _` || |_ / _ \\___ \ | '_ \ / _ \| || |
___) || (_| || _|| __/ ___) || | | || __/| || |
|____/ \__,_||_| \___||____/ |_| |_| \___||_||_|
๐ก๏ธ SafeShell: A security tool for shell history management, designed to detect, stash, and clear sensitive commands, ensuring safer terminal sessions.
๐ฅ๏ธ Display a summary of sensitive commands at the start of each terminal session. ๐ Remove sensitive commands from the shell history to enhance security and privacy. ๐จโ๐ป Temporarily store your command history prior to presentations or screen-sharing sessions for confidentiality.
To install safeshell, simply clone the repository and follow the instructions below:
git clone [email protected]:trinhminhtriet/safeshell.git
cd safeshell
cargo install --path .Running the below command will globally install the safeshell binary.
cargo install safeshellmacOS
curl -sS https://raw.githubusercontent.com/trinhminhtriet/safeshell/master/install/install.sh | bashLinux
curl -sS https://raw.githubusercontent.com/trinhminhtriet/safeshell/master/install/install.sh | bashWindows
iwr https://raw.githubusercontent.com/trinhminhtriet/safeshell/master/install/install.ps1 -useb | iexBash
Add the following to the end of ~/.bashrc:eval $(safeshell --init-shell)Zsh
Add the following to the end of ~/.zshrc:eval $(safeshell --init-shell)PowerShell
Add the following to the end of your PowerShell configuration (find it by running $PROFILE):Invoke-Expression (&safeshell --init-shell)Fish
Add the following to the end of ~/.config/fish/config.fish:safeshell --init-shell | source$ safeshell --help
Secure shell commands
USAGE:
safeshell [OPTIONS] [SUBCOMMAND]
OPTIONS:
--config-dir <CFG_DIR_PATH> Set configuration directory path
-h, --help Print help information
--init-shell Show sensitive findings summary for MOTD
--log <LEVEL> 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 fileSensitive data can be stored in your history file when export a token of something or running a script with token.
safeshell find --format tablesafeshell clearsafeshell clear --removesafeshell clear --backupYou can stash your history shell by running the command:
safeshell stashNow your history shell is clear, to bring back your history run the command:
safeshell stash popYou can also restore your history backup file by running the command:
safeshell stash restoreCreate custom configuration by running the command
safeshell configConfig command will create:
- Custom pattern template for adding a custom risky patterns
- Ignore file to allows you ignore specific pattern
Validate syntax file
safeshell config validateValidate syntax file
safeshell config deleteManage pattern ignores
safeshell config ignoresRunning the below command will globally uninstall the safeshell binary.
cargo uninstall safeshellRemove the project repo
rm -rf /path/to/git/clone/safeshellWe welcome contributions!
- Fork this repository;
- Create a branch with your feature:
git checkout -b my-feature; - Commit your changes:
git commit -m "feat: my new feature"; - Push to your branch:
git push origin my-feature.
Once your pull request has been merged, you can delete your branch.
This project is licensed under the MIT License - see the LICENSE file for details.