Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added v3 API version for the detector captaindatago #3484

Merged

Conversation

sahil9001
Copy link
Contributor

@sahil9001 sahil9001 commented Oct 19, 2024

Description:

Fixes #3483

Checklist:

  • Tests passing (make test-community)?
  • Lint passing (make lint this requires golangci-lint)?

@sahil9001 sahil9001 requested a review from a team as a code owner October 19, 2024 19:34
Copy link
Contributor

@rgmz rgmz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as #3414 (comment) and #3427 (comment)

@sahil9001
Copy link
Contributor Author

Verified with API Key @rgmz
Screenshot 2024-10-22 at 2 01 09 AM

@sahil9001 sahil9001 requested a review from rgmz October 21, 2024 20:31
}

// Ensure the Scanner satisfies the interface at compile time.
var _ detectors.Detector = (*Scanner)(nil)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The versioning interface is currently unimplemented. When running trufflehog, the following warning is displayed:

2024-10-25T11:39:18+05:00	info-0	trufflehog	possible duplicate detector configured	{"detector": "CaptainData"}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How are you testing this @kashifkhan0771 , can you tell me the command?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add your token in some file locally and run following command against it

trufflehog filesystem ~/<path_to_file_where_secret_is>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I checked with the changes, this warning is not coming now, I have fixed it.

Signed-off-by: Sahil Silare <[email protected]>
@@ -1642,6 +1642,8 @@ func DefaultDetectors() []detectors.Detector {
saladcloudapikey.Scanner{},
boxoauth.Scanner{},
apimetrics.Scanner{},
captainDataV2.Scanner{},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is V1?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is no V1 , We should start with V1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is V1?

I named them according to API versions available, there was v2 and v3 hence the name.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the versioning is based on detectors not the API. Correct me If I am wrong @zricethezav @abmussani
Correct way would be to start with V1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, please check @kashifkhan0771

Copy link
Contributor

@kashifkhan0771 kashifkhan0771 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Good Work @sahil9001 - Thanks for the contribution.

@kashifkhan0771 kashifkhan0771 merged commit e81ff76 into trufflesecurity:main Oct 30, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Introduce new v3 version for the detector captaindata
4 participants