Skip to main content

convert secret patterns to gf compatible

Project description

secpat2gf

convert secret pattern to gf compatible.

Install

from PyPi:

$ pip3 install secpat2gf

from Source:

$ git clone https://github.com/dwisiswant0/secpat2gf
$ cd secpat2gf/
$ pip3 install -r requirements.txt

Usage

$ secpat2gf --help
usage: secpat2gf [-h] -r RULE_FILE [-f FLAGS] [-s]

options:
  -h, --help            show this help message and exit
  -r RULE_FILE, --rule-file RULE_FILE
                        path to rule file/URL
  -f FLAGS, --flags FLAGS
                        grep flags (default: -aHnPr)
  -s, --save            save to $HOME/.gf instead of stdout

Example

Converting YAML-based rule URL to gf compatible

$ secpat2gf -r https://github.com/mazen160/secrets-patterns-db/raw/master/datasets/generic.yml
[02/10/2023 08:56:55 AM] Slack Token pattern
{
  "flags": "-aHnPr",
  "pattern": "(xox[pborsa]-[0-9]{12}-[0-9]{12}-[0-9]{12}-[a-z0-9]{32})"
}
[02/10/2023 08:56:55 AM] test pattern
{
  "flags": "-aHnPr",
  "pattern": "test"
}
[02/10/2023 08:56:55 AM] generic password pattern
{
  "flags": "-aHnPr",
  "pattern": "password.+"
}
[02/10/2023 08:56:55 AM] Generic secret pattern
{
  "flags": "-aHnPr",
  "pattern": "secret.+"
}
...

Converting YAML-based rule file to gf & save the results

$ secpat2gf --save -r generic.yaml

More

More example, see workaround from gf-secrets.

Resources

  • secrets-patterns-db - Secrets Patterns DB: The largest open-source Database for detecting secrets, API keys, passwords, tokens, and more.
  • gf - A wrapper around grep, to help you grep for things.
  • gf-secrets - Secret and/or credential patterns used for gf.

License

secpat2gf is distributed under MIT. See LICENSE file.

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

secpat2gf-1.0.0.tar.gz (3.6 kB view hashes)

Uploaded Source

Built Distribution

secpat2gf-1.0.0-py3-none-any.whl (5.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page