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

Add configuration parsing and custom detectors to engine #968

Merged
merged 2 commits into from Dec 20, 2022

Conversation

mcastorina
Copy link
Collaborator

No description provided.

@mcastorina
Copy link
Collaborator Author

Waiting on #950 to be merged.

@mcastorina mcastorina marked this pull request as ready for review December 14, 2022 16:54
@mcastorina mcastorina requested a review from a team as a code owner December 14, 2022 16:54
Copy link
Collaborator

@trufflesteeeve trufflesteeeve left a comment

Choose a reason for hiding this comment

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

Looks good. I'd change the empty filename case, but this LGTM.

// Read parses a given filename into a Config.
func Read(filename string) (*Config, error) {
if filename == "" {
return &Config{}, nil
Copy link
Collaborator

Choose a reason for hiding this comment

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

optional: I feel like this should return an error instead of an empty config. Because an empty filename string would occur anytime --config is included but nothing follows it, yeah? (At least I think it would?) Which seems like an accident we should tell the user about, rather than intentionally adding an empty config.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hm.. that's a good point. I'll have to see if there's a way to differentiate between --config '' and no flag, because currently I think they both return "".

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Found there's an ExistingFile() method in kingpin which will do the job. Now --config '' will error and no flag will not.

@mcastorina mcastorina merged commit f5b83ee into main Dec 20, 2022
@mcastorina mcastorina deleted the thog-807-custom-regex-engine branch December 20, 2022 16:14
javajawa added a commit to mewbotorg/mewbot that referenced this pull request Dec 26, 2022
Update trufflehog from 3.19.0 to 3.21.0.

- Bump github.com/xanzy/go-gitlab from 0.76.0 to 0.77.0 by @​dependabot in trufflesecurity/trufflehog#981
- Bump golang.org/x/crypto from 0.3.0 to 0.4.0 by @​dependabot in trufflesecurity/trufflehog#982
- Add configuration parsing and custom detectors to engine by @​mcastorina in trufflesecurity/trufflehog#968
- Add custom regex detector docs by @​mcastorina in trufflesecurity/trufflehog#983
- Remove custom log leveler by @​mcastorina in trufflesecurity/trufflehog#985
- Bump github.com/xanzy/go-gitlab from 0.74.0 to 0.76.0 by @​dependabot in trufflesecurity/trufflehog#934
- Bump github.com/bill-rich/disk-buffer-reader from v0.1.6 to v0.1.7 by @​bill-rich in trufflesecurity/trufflehog#970
- Bump go.mongodb.org/mongo-driver from 1.11.0 to 1.11.1 by @​dependabot in trufflesecurity/trufflehog#971
- Bump github.com/getsentry/sentry-go from 0.15.0 to 0.16.0 by @​dependabot in trufflesecurity/trufflehog#973
- [bug] - Handle error when scanning s3 bucket. by @​ahrav in trufflesecurity/trufflehog#969
- Bump github.com/go-git/go-git/v5 from 5.4.2 to 5.5.1 by @​dependabot in trufflesecurity/trufflehog#972
- Bump github.com/envoyproxy/protoc-gen-validate from 0.6.13 to 0.9.1 by @​dependabot in trufflesecurity/trufflehog#963
- Add more logging for git sources by @​mcastorina in trufflesecurity/trufflehog#974
- Add s3 object count to trace logs by @​bill-rich in trufflesecurity/trufflehog#975
- Implement CustomRegex detector by @​mcastorina in trufflesecurity/trufflehog#950
- Use Todoist's REST API v2 by @​goncalossilva in trufflesecurity/trufflehog#978
- Allow using a glob for include list. by @​ahrav in trufflesecurity/trufflehog#977
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants