mirror of
https://github.com/trufflesecurity/trufflehog.git
synced 2024-11-10 15:14:38 +00:00
Add RawV2 Results to the JSON Output (#1273)
* Add RawV2 to JSON Output * Adding RawV2 results to Azure, Datadog and GCP Detectors
This commit is contained in:
parent
cec1543894
commit
a002ba9a75
3 changed files with 6 additions and 0 deletions
|
@ -54,6 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
|
|||
s := detectors.Result{
|
||||
DetectorType: detectorspb.DetectorType_Azure,
|
||||
Raw: []byte(clientSecret[2]),
|
||||
RawV2: []byte(clientID[2] + clientSecret[2] + tenantID[2]),
|
||||
Redacted: clientID[2],
|
||||
}
|
||||
|
||||
|
|
|
@ -51,6 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
|
|||
s1 := detectors.Result{
|
||||
DetectorType: detectorspb.DetectorType_DatadogToken,
|
||||
Raw: []byte(resMatch),
|
||||
RawV2: []byte(resMatch + resApiMatch),
|
||||
}
|
||||
|
||||
if verify {
|
||||
|
|
|
@ -29,6 +29,9 @@ func PrintJSON(r *detectors.ResultWithMetadata) error {
|
|||
Verified bool
|
||||
// Raw contains the raw secret data.
|
||||
Raw string
|
||||
// RawV2 contains the raw secret identifier that is a combination of both the ID and the secret.
|
||||
// This is used for secrets that are multi part and could have the same ID. Ex: AWS credentials
|
||||
RawV2 string
|
||||
// Redacted contains the redacted version of the raw secret identification data for display purposes.
|
||||
// A secret ID should be used if available.
|
||||
Redacted string
|
||||
|
@ -44,6 +47,7 @@ func PrintJSON(r *detectors.ResultWithMetadata) error {
|
|||
DecoderName: r.DecoderType.String(),
|
||||
Verified: r.Verified,
|
||||
Raw: string(r.Raw),
|
||||
RawV2: string(r.RawV2),
|
||||
Redacted: r.Redacted,
|
||||
ExtraData: r.ExtraData,
|
||||
StructuredData: r.StructuredData,
|
||||
|
|
Loading…
Reference in a new issue