trufflehog/pkg/analyzer
Abdul Basit 04a13385a8
Add Analyzers interface for HuggingFace (#3140)
* implemented analyzer interface with data models for HuggingFace

* correct test for huggingface due to new addition of key in detection result.

---------

Co-authored-by: Abdul Basit <abasit@folio3.com>
2024-08-02 08:20:11 -07:00
..
analyzers Add Analyzers interface for HuggingFace (#3140) 2024-08-02 08:20:11 -07:00
config [analyze] Implement Analyzer interface for github (#3110) 2024-07-26 14:47:03 -07:00
generate_permissions Export maps from permission generation (#3137) 2024-07-31 16:49:56 -07:00
pb/analyzerpb Analyze (#3099) 2024-07-25 12:06:05 -07:00
proto Analyze (#3099) 2024-07-25 12:06:05 -07:00
cli.go Separate out printing statements with anlayzer logic for SourceGraph (#3119) 2024-07-31 10:08:42 -07:00
README.md Add permissions lookup tables (#3125) 2024-07-31 13:01:29 -07:00

Implementing Analyzers

Defining the Permissions

Permissions are defined in lower snake case as permission_name:access_level.

The Permissions are initially defined as a yaml file.

At the top of the analyzer implementation you specify the go generate command.

You can install the generator with go install github.com/trufflesecurity/trufflehog/v3/pkg/analyzer/generate_permissions.

Then you can run go generate ./... to generate the Permission types for the analyzer.

The generated Permission types are to be used in the AnalyzerResult struct when defining the Permissions and in your code.