Scan for secrets within files.
Project description
Secret Scanner
A simple tool to scan directories for secrets using regular expressions.
Install
Install using either pip
, pipx
or your Python installer of choice
pipx install secretscanner
Usage
To scan a directory and print the files with secrets
secretscanner DIRECTORY
To also display info on the tokens that have been found pass the -v
/--verbose
flag.
To hide the output pass the -q
/--quiet
flag.
To output the tokens found as josn pass the -j
/--json
flag.
If secrets are found the tool exits with exit code 1
Output
Default output
Files with embedded secrets:
/secretscanner/tests/dir/github/github.txt
/secretscanner/tests/dir/pypi/pypi.txt
/secretscanner/tests/dir/digitalocean/digitalocean.txt
Verbose Output
Files with embedded secrets:
/secretscanner/tests/dir/github/github.txt
- Issuer: github
Type: pat
Token: ghp_GHJSGSJHGgjhgshjagjgasjgjhJHGHJJGJGHJGHJG76y78bhjksdbahjkghj
- Issuer: github
Type: oauth
Token: gho_GHJSGSJHGgjhgshjagjgasjgjhJHGHJJGJGHJGHJG76y78bhjksdbahjkghj
- Issuer: github
Type: user-to-server
Token: ghu_GHJSGSJHGgjhgshjagjgasjgjhJHGHJJGJGHJGHJG76y78bhjksdbahjkghj
- Issuer: github
Type: server-to-server
Token: ghs_GHJSGSJHGgjhgshjagjgasjgjhJHGHJJGJGHJGHJG76y78bhjksdbahjkghj
- Issuer: github
Type: refresh
Token: ghr_GHJSGSJHGgjhgshjagjgasjgjhJHGHJJGJGHJGHJG76y78bhjksdbahjkghj
/secretscanner/tests/dir/pypi/pypi.txt
- Issuer: pypi
Type: pat
Token:
pypi-AgEIcHlwaS5vcmcCJGzcex4tRk1EkM_jg2KTYkrCissgG2lvbnMiOiAidXNlciIsICJ2ZXJzaW9uIjogMX
0AAAYgjeEtcvL8TyDUVri6iM0LTc2YzUtNDgwYy05NTA3LTlkMjBmZjY2MWY0
/secretscanner/tests/dir/digitalocean/digitalocean.txt
- Issuer: digitalocean
Type: pat
Token:
dop_v1_GHJSGSJHGgjhgshjagjgasjgjhJHGHJJGJGHJGHJG76y78bhjksdbahjkghjJHGHJJGJGHJGHJG76y78
bhjksdbahjkghj
- Issuer: digitalocean
Type: oauth
Token:
doo_v1_GHJSGSJHGgjhgshjagjgasjgjhJHGHJJGJGHJGHJG76y78bhjksdbahjkghjJHGHJJGJGHJGHJG76y78
bhjksdbahjkghj
- Issuer: digitalocean
Type: refresh
Token:
dor_v1_GHJSGSJHGgjhgshjagjgasjgjhJHGHJJGJGHJGHJG76y78bhjksdbahjkghjJHGHJJGJGHJGHJG76y78
bhjksdbahjkghj
Recognized Secrets
The tool currently recognizes the following secret types
- Github access tokens
- PyPI access tokens
- Digital Ocean access tokens
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
secretscanner-0.1.1.tar.gz
(3.9 kB
view hashes)
Built Distribution
Close
Hashes for secretscanner-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae48a867d88b4df148ed73ae4ffb9ed104d8d0fd5749024a9c97996aaa865af8 |
|
MD5 | 7feadb78f7e73ec42b00cbb7327942cc |
|
BLAKE2b-256 | 5bf8f36225d505c5dec7c1475e44bf96cfcd06cc189006ef001e53a4579c7153 |