Skip to content

Commit

Permalink
Add s3 credential validation (#2362)
Browse files Browse the repository at this point in the history
* add string non-empty validation to AWS creds

* clean up import spacing

* syntax fixup

* change to non-empty validation only

* convert to lower snake_case

- https://protobuf.dev/programming-guides/style/#message-field-names
  • Loading branch information
Mike Vanbuskirk committed Feb 2, 2024
1 parent b2074ad commit f6546ff
Show file tree
Hide file tree
Showing 3 changed files with 141 additions and 89 deletions.
163 changes: 84 additions & 79 deletions pkg/pb/credentialspb/credentials.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 50 additions & 5 deletions pkg/pb/credentialspb/credentials.pb.validate.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions proto/credentials.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ package credentials;

option go_package = "github.com/trufflesecurity/trufflehog/v3/pkg/pb/credentialspb";

import "validate/validate.proto";

message Unauthenticated {}

message SSHAuth {}
Expand Down Expand Up @@ -46,14 +48,14 @@ message KeySecret {
}

message AWSSessionTokenSecret {
string key = 1;
string secret = 2;
string sessionToken = 3;
string key = 1 [(validate.rules).string.min_len = 1];
string secret = 2 [(validate.rules).string.min_len = 1];
string session_token = 3 [(validate.rules).string.min_len = 1];
}

message AWS {
string key = 1;
string secret = 2;
string key = 1 [(validate.rules).string.min_len = 1];
string secret = 2 [(validate.rules).string.min_len = 1];
string region = 3;
}

Expand Down

0 comments on commit f6546ff

Please sign in to comment.