Skip to content

sensitive-search is a configurable cli tool to find sensitive information stored in files such as passwords and usernames that need to be stored in an environment variable or vault

License

Notifications You must be signed in to change notification settings

vatdaell/sensitive-search

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🕵️ Sensitive Search

Sensitive search is a configurable cli tool to find sensitive information stored in files such as passwords and usernames that need to be stored in an environment variable or vault. Sensitive Seach will search for password, username and user by default but this is configurable as listed below.

Installation

Prerequisites

  • Python 3.6 or later
  • Git

Clone Repository

git clone https://github.com/vatdaell/sensitive-search.git

Basic Usage

To scan a single file for sensitive data:

python main.py path/to/your/file.txt

Scan a Directory Recursively

To scan an entire directory and its subdirectories for sensitive data:

python main.py -r path/to/your/directory 

Specify File Encoding

If your file uses a specific encoding, you can specify it with the -e or --encoding option, the default encoding is UTF-8:

python main.py path/to/your/file.txt -e encoding

For example, to use UTF-8 encoding:

python main.py path/to/your/file.txt -e utf-8

Use Custom Patterns from a JSON File

To use custom patterns for scanning, specify a JSON file containing your patterns with the -p or --patterns option:

python main.py path/to/your/file.txt -p path/to/your/patterns.json

patterns.json

{
  "patterns": [
    "\\bpassword\\s*=\\s*.+",
    "\\buser(name)?\\s*=\\s*.+",
    "...other patterns..."
  ]
}

Generate a Text File Output

To generate a text file output of the scan results, use the -t or --text option followed by the desired output filename:

python main.py path/to/your/file.txt -t output.txt

Note

Please ensure that the paths to files or directories, pattern JSON file, and output text file are correctly specified according to your filesystem.

About

sensitive-search is a configurable cli tool to find sensitive information stored in files such as passwords and usernames that need to be stored in an environment variable or vault

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages