Skip to content

Trufflehog - not able to use regexp to through custom detector #3851

Open
@simonaferrara

Description

Hi,

I'm trying to configure trufflehog to use custom regexp to detect simple secrets basing on my needs, e.g. to search for passwords or access tokens.
Unfortunately I've not found a way to do it.

I've found also another post about a similar issue ( #1317 ) and I've tried to apply the suggestion included within this post's discussion to search for an api key through a custom detector.

I've created the testAPIkeyConfig.yaml file with the following content:

detectors:
- name: custom api detector
  keywords:
  - api
  regex:
    adjective: "[a-zA-Z0-9]{32}"

and the testAPIkey.json with the following content:
"API key": "([a-zA-Z0-9]{32})"

and I've executed the following command:
trufflehog filesystem testAPIkey.json --config testAPIkeyConfig.yaml

The output by trufflehog is not the expected one. The API key is not highlighted by the tool:

Image

What I'm doing wrong?
Your help will be useful for me to configure also other regexp that I would like to use.

Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions