Skip to content

Commit a912495

Browse files
Merge pull request #1577 from doyensec:veles-codecatalyst
PiperOrigin-RevId: 842221015
2 parents c52032f + f691c9e commit a912495

File tree

19 files changed

+807
-32
lines changed

19 files changed

+807
-32
lines changed

binary/proto/scan_result.proto

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,7 @@ message SecretData {
736736
ReCaptchaKey re_captcha_key = 51;
737737
PyxKeyV1 pyx_key_v1 = 52;
738738
PyxKeyV2 pyx_key_v2 = 53;
739+
CodeCatalystCredentials code_catalyst_credentials = 54;
739740
}
740741

741742
message GCPSAK {
@@ -1010,14 +1011,17 @@ message SecretData {
10101011
message ReCaptchaKey {
10111012
string secret = 1;
10121013
}
1013-
10141014
message PyxKeyV1 {
10151015
string key = 1;
10161016
}
10171017

10181018
message PyxKeyV2 {
10191019
string key = 1;
10201020
}
1021+
1022+
message CodeCatalystCredentials{
1023+
string url = 1;
1024+
}
10211025
}
10221026

10231027
message SecretStatus {

binary/proto/scan_result_go_proto/scan_result.pb.go

Lines changed: 113 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

binary/proto/secret.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import (
3737
"github.com/google/osv-scalibr/veles/secrets/gcpoauth2client"
3838
velesgcpsak "github.com/google/osv-scalibr/veles/secrets/gcpsak"
3939
"github.com/google/osv-scalibr/veles/secrets/gcshmackey"
40+
"github.com/google/osv-scalibr/veles/secrets/gitbasicauth/codecatalyst"
4041
velesgithub "github.com/google/osv-scalibr/veles/secrets/github"
4142
"github.com/google/osv-scalibr/veles/secrets/gitlabpat"
4243
velesgrokxaiapikey "github.com/google/osv-scalibr/veles/secrets/grokxaiapikey"
@@ -222,11 +223,23 @@ func velesSecretToProto(s veles.Secret) (*spb.SecretData, error) {
222223
return pyxKeyV1ToProto(t), nil
223224
case pyxkeyv2.PyxKeyV2:
224225
return pyxKeyV2ToProto(t), nil
226+
case codecatalyst.Credentials:
227+
return codeCatalystCredentialsToProto(t), nil
225228
default:
226229
return nil, fmt.Errorf("%w: %T", ErrUnsupportedSecretType, s)
227230
}
228231
}
229232

233+
func codeCatalystCredentialsToProto(s codecatalyst.Credentials) *spb.SecretData {
234+
return &spb.SecretData{
235+
Secret: &spb.SecretData_CodeCatalystCredentials_{
236+
CodeCatalystCredentials: &spb.SecretData_CodeCatalystCredentials{
237+
Url: s.FullURL,
238+
},
239+
},
240+
}
241+
}
242+
230243
func awsAccessKeyCredentialToProto(s awsaccesskey.Credentials) *spb.SecretData {
231244
return &spb.SecretData{
232245
Secret: &spb.SecretData_AwsAccessKeyCredentials_{
@@ -982,6 +995,10 @@ func velesSecretToStruct(s *spb.SecretData) (veles.Secret, error) {
982995
return pyxkeyv2.PyxKeyV2{
983996
Key: s.GetPyxKeyV2().GetKey(),
984997
}, nil
998+
case *spb.SecretData_CodeCatalystCredentials_:
999+
return codecatalyst.Credentials{
1000+
FullURL: s.GetCodeCatalystCredentials().GetUrl(),
1001+
}, nil
9851002
default:
9861003
return nil, fmt.Errorf("%w: %T", ErrUnsupportedSecretType, s.GetSecret())
9871004
}

docs/supported_inventory_types.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ See the docs on [how to add a new Extractor](/docs/new_extractor.md).
112112
| Type | Extractor Plugin |
113113
|---------------------------------------------|--------------------------------------|
114114
| AWS access key | `secrets/awsaccesskey` |
115+
| Amazon CodeCatalyst credentials | `secrets/codecatalystcredentials` |
115116
| Anthropic API key | `secrets/anthropicapikey` |
116117
| Azure Token | `secrets/azuretoken` |
117118
| Crates.io API Token | `secrets/cratesioapitoken` |

enricher/enricherlist/list.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import (
4141
"github.com/google/osv-scalibr/veles/secrets/gcpoauth2access"
4242
"github.com/google/osv-scalibr/veles/secrets/gcpsak"
4343
"github.com/google/osv-scalibr/veles/secrets/gcshmackey"
44+
"github.com/google/osv-scalibr/veles/secrets/gitbasicauth/codecatalyst"
4445
"github.com/google/osv-scalibr/veles/secrets/github"
4546
"github.com/google/osv-scalibr/veles/secrets/gitlabpat"
4647
"github.com/google/osv-scalibr/veles/secrets/grokxaiapikey"
@@ -119,6 +120,7 @@ var (
119120
fromVeles(gcpoauth2access.NewValidator(), "secrets/gcpoauth2accesstokenvalidate", 0),
120121
fromVeles(gcshmackey.NewValidator(), "secrets/gcshmackeyvalidate", 0),
121122
fromVeles(awsaccesskey.NewValidator(), "secrets/awsaccesskeyvalidate", 0),
123+
fromVeles(codecatalyst.NewValidator(), "secrets/codecatalystcredentialsvalidate", 0),
122124
})
123125

124126
// SecretsEnrich lists enrichers that add data to detected secrets.

extractor/filesystem/list/list.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ import (
9797
"github.com/google/osv-scalibr/extractor/filesystem/sbom/spdx"
9898
"github.com/google/osv-scalibr/extractor/filesystem/secrets/awsaccesskey"
9999
"github.com/google/osv-scalibr/extractor/filesystem/secrets/convert"
100+
"github.com/google/osv-scalibr/extractor/filesystem/secrets/gitbasicauth/codecatalyst"
100101
"github.com/google/osv-scalibr/extractor/filesystem/secrets/mariadb"
101102
"github.com/google/osv-scalibr/extractor/filesystem/secrets/mysqlmylogin"
102103
"github.com/google/osv-scalibr/extractor/filesystem/secrets/onepasswordconnecttoken"
@@ -287,6 +288,7 @@ var (
287288
onepasswordconnecttoken.Name: {noCFG(onepasswordconnecttoken.New)},
288289
mariadb.Name: {noCFG(mariadb.NewDefault)},
289290
awsaccesskey.Name: {noCFG(awsaccesskey.New)},
291+
codecatalyst.Name: {noCFG(codecatalyst.New)},
290292
}
291293

292294
// SecretDetectors for Detector interface.

0 commit comments

Comments
 (0)