Skip to content

Commit

Permalink
Merge branch 'main' of github.com:trufflesecurity/trufflehog into old…
Browse files Browse the repository at this point in the history
…-detector-batch-1
  • Loading branch information
zricethezav committed Sep 22, 2023
2 parents 9f9f228 + 995eb64 commit 84fcd5c
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PROTOS_IMAGE ?= trufflesecurity/protos:1.18-0
PROTOS_IMAGE ?= trufflesecurity/protos:1.21-0

.PHONY: check
.PHONY: lint
Expand Down Expand Up @@ -59,7 +59,7 @@ protos-windows:

release-protos-image:
docker buildx build --push --platform=linux/amd64,linux/arm64 \
-t trufflesecurity/protos:1.18-0 -f hack/Dockerfile.protos .
-t trufflesecurity/protos:1.21-0 -f hack/Dockerfile.protos .

snifftest:
./hack/snifftest/snifftest.sh
Expand Down
14 changes: 14 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Examples
This folder contains various examples like custom detectors, scripts, etc. Feel free to contribute!

### Generic Detector
An often requested feature for TruffleHog is a generic detector. By default, we do not support generic detection as it would result in lots of false positives. However, if you want to attempt detect generic secrets you can use a custom detector.

#### Try it out:
```
wget UPDATE ONCE MERGED
trufflehog filesystem --config=$PWD/generic.yml $PWD
# to filter so that _only_ generic credentials are logged:
trufflehog filesystem --config=$PWD/generic.yml --json --no-verification $PWD | awk '/generic-api-key/{print $0}'
```
15 changes: 15 additions & 0 deletions examples/generic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
detectors:
- name: generic-api-key
keywords:
- key
- api
- token
- secret
- client
- passwd
- password
- auth
- access
regex:
# borrowing the gitleaks generic-api-key regex
generic-api-key: "(?i)(?:key|api|token|secret|client|passwd|password|auth|access)(?:[0-9a-z\\-_\\t .]{0,20})(?:[\\s|']|[\\s|\"]){0,3}(?:=|>|:{1,3}=|\\|\\|:|<=|=>|:|\\?=)(?:'|\"|\\s|=|\\x60){0,5}([0-9a-z\\-_.=]{10,150})(?:['|\"|\\n|\\r|\\s|\\x60|;]|$)"
2 changes: 1 addition & 1 deletion hack/Dockerfile.protos
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# trufflesecurity/protos:1.18-0

FROM golang:1.18-buster
FROM golang:1.21-bullseye

ARG TARGETARCH
ARG TARGETOS
Expand Down

0 comments on commit 84fcd5c

Please sign in to comment.