Coder Social home page Coder Social logo

purge-history-secrets's Introduction

Zsh History Purge Secrets Plugin

This zsh plugin helps ensure that secrets do not persist in your zsh history. It checks the .zsh_history file every 60 seconds for potential secrets using Gitleaks. If any are found, the respective lines are purged from the history and logged.

Prerequisites

  1. Gitleaks: This tool is used to scan the zsh history for potential secrets.
  2. jq: A lightweight and flexible command-line JSON processor.

Installing Gitleaks

Please follow the official installation guide for Gitleaks from here.

Installing jq

Please follow the official installation guide for jq from here.

Installation

  1. Clone this repository:
git clone https://github.com/jotasixto/purge-history-secrets.git ~/.oh-my-zsh/custom/plugins/purge-history-secrets
  1. Add the plugin to the list of plugins in your ~/.zshrc:
plugins=(... purge-history-secrets)
  1. Reload your zsh configuration:
source ~/.zshrc

How it works

Once the plugin is enabled:

  1. Every 60 seconds, the plugin checks the .zsh_history file for potential secrets using Gitleaks.
  2. If potential secrets are detected, the respective lines are deleted from the .zsh_history file.
  3. A log of all purged lines is maintained in ~/.purge-secrets-zshhistory.log, with timestamps indicating when each line was purged.

purge-history-secrets's People

Contributors

jotasixto avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.