mirror of
https://github.com/trufflesecurity/trufflehog.git
synced 2024-11-14 17:07:31 +00:00
9b2cef55c0
* implement analyzer interface for gitlab * generated permissions, added unit test for gitlab analyzer * revert deletion of scopes.go * appending domain in resource names * [chore] moved expected output of test in json file to neat the code. * updated the test for gitlab analyzer to make more unique FullyQualifiedName, Ids are added for resources. * remove unnecessary metadata field and fix github -> gitlab * extract user id from access token json, make user as resource * link analyzer with gitlab v2 detector * fixed code breaking changes due to analyzer protobuf removal. --------- Co-authored-by: Abdul Basit <abasit@folio3.com> |
||
---|---|---|
.. | ||
analyzers | ||
config | ||
generate_permissions | ||
tui | ||
cli.go | ||
README.md |
Implementing Analyzers
Defining the Permissions
Permissions can be defined in:
- lower snake case as
permission_name:access_level
- kebab case as
permission-name:read
- dot notation as
permission.name:read
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.