Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions binary/proto/scan_result.proto
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,7 @@ message SecretData {
HerokuSecretKey heroku_secret_key = 74;
NpmJsAccessToken npmjs_access_token = 75;
CloudflareAPIToken cloudflare_api_token = 76;
MongoDBConnectionURL mongodb_connection_url = 77;
}

message GCPSAK {
Expand Down Expand Up @@ -924,6 +925,10 @@ message SecretData {
string token = 1;
}

message MongoDBConnectionURL {
string url = 1;
}

message DenoPat {
string pat = 1;
}
Expand Down
736 changes: 401 additions & 335 deletions binary/proto/scan_result_go_proto/scan_result.pb.go

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions binary/proto/secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import (
"github.com/google/osv-scalibr/veles/secrets/huggingfaceapikey"
"github.com/google/osv-scalibr/veles/secrets/jwt"
velesmistralapikey "github.com/google/osv-scalibr/veles/secrets/mistralapikey"
mongodbconnectionurl "github.com/google/osv-scalibr/veles/secrets/mongodburl"
"github.com/google/osv-scalibr/veles/secrets/npmjsaccesstoken"
velesonepasswordkeys "github.com/google/osv-scalibr/veles/secrets/onepasswordkeys"
velesopenai "github.com/google/osv-scalibr/veles/secrets/openai"
Expand Down Expand Up @@ -295,6 +296,8 @@ func velesSecretToProto(s veles.Secret) (*spb.SecretData, error) {
return squarePersonalAccessTokenToProto(t), nil
case velessquareapikey.SquareOAuthApplicationSecret:
return squareOAuthApplicationSecretToProto(t), nil
case mongodbconnectionurl.MongoDBConnectionURL:
return mongoDBConnectionURIToProto(t), nil
default:
return nil, fmt.Errorf("%w: %T", ErrUnsupportedSecretType, s)
}
Expand Down Expand Up @@ -351,6 +354,16 @@ func squareOAuthApplicationSecretToProto(s velessquareapikey.SquareOAuthApplicat
}
}

func mongoDBConnectionURIToProto(s mongodbconnectionurl.MongoDBConnectionURL) *spb.SecretData {
return &spb.SecretData{
Secret: &spb.SecretData_MongodbConnectionUrl{
MongodbConnectionUrl: &spb.SecretData_MongoDBConnectionURL{
Url: s.URL,
},
},
}
}

func elasticCloudAPIKeyToProto(s elasticcloudapikey.ElasticCloudAPIKey) *spb.SecretData {
return &spb.SecretData{
Secret: &spb.SecretData_ElasticCloudApiKey{
Expand Down Expand Up @@ -1383,6 +1396,10 @@ func velesSecretToStruct(s *spb.SecretData) (veles.Secret, error) {
return velessquareapikey.SquareOAuthApplicationSecret{
Key: s.GetSquareOauthApplicationSecret().GetKey(),
}, nil
case *spb.SecretData_MongodbConnectionUrl:
return mongodbconnectionurl.MongoDBConnectionURL{
URL: s.GetMongodbConnectionUrl().GetUrl(),
}, nil
default:
return nil, fmt.Errorf("%w: %T", ErrUnsupportedSecretType, s.GetSecret())
}
Expand Down
1 change: 1 addition & 0 deletions docs/supported_inventory_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ See the docs on [how to add a new Extractor](/docs/new_extractor.md).
| Vapid keys | `secrets/vapidkey` |
| reCAPTCHA secret keys | `secrets/recaptchakey` |
| Generic JWT tokens | `secrets/jwttoken` |
| MongoDB Connection URL | `secrets/mongodbconnectionurl` |
| pyx user key v1 | `secrets/pyxkeyv1` |
| pyx user key v2 | `secrets/pyxkeyv2` |
| Telegram Bot API Token | `secrets/telegrambottoken` |
Expand Down
2 changes: 2 additions & 0 deletions enricher/enricherlist/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ import (
"github.com/google/osv-scalibr/veles/secrets/herokuplatformkey"
"github.com/google/osv-scalibr/veles/secrets/huggingfaceapikey"
"github.com/google/osv-scalibr/veles/secrets/mistralapikey"
mongodbconnectionurl "github.com/google/osv-scalibr/veles/secrets/mongodburl"
"github.com/google/osv-scalibr/veles/secrets/npmjsaccesstoken"
"github.com/google/osv-scalibr/veles/secrets/openai"
"github.com/google/osv-scalibr/veles/secrets/openrouter"
Expand Down Expand Up @@ -127,6 +128,7 @@ var (
fromVeles(slacktoken.NewAppConfigAccessTokenValidator(), "secrets/slackconfigaccesstokenvalidate", 0),
fromVeles(dockerhubpat.NewValidator(), "secrets/dockerhubpatvalidate", 0),
fromVeles(cloudflareapitoken.NewValidator(), "secrets/cloudflareapitokenvalidate", 0),
fromVeles(mongodbconnectionurl.NewValidator(), "secrets/mongodbconnectionurlvalidate", 0),
fromVeles(denopat.NewUserTokenValidator(), "secrets/denopatuservalidate", 0),
fromVeles(denopat.NewOrgTokenValidator(), "secrets/denopatorgvalidate", 0),
fromVeles(gcpsak.NewValidator(), "secrets/gcpsakvalidate", 0),
Expand Down
41 changes: 31 additions & 10 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ require (
github.com/containerd/containerd/api v1.9.0
github.com/deitch/magic v0.0.0-20240306090643-c67ab88f10cb
github.com/diskfs/go-diskfs v1.7.0
github.com/docker/docker v28.2.2+incompatible
github.com/docker/docker v28.5.1+incompatible
github.com/dsoprea/go-exfat v0.0.0-20190906070738-5e932fbdb589
github.com/erikvarga/go-rpmdb v0.0.0-20250523120114-a15a62cd4593
github.com/go-git/go-git/v5 v5.16.2
Expand Down Expand Up @@ -51,22 +51,25 @@ require (
github.com/shirou/gopsutil v3.21.11+incompatible
github.com/smacker/go-tree-sitter v0.0.0-20240827094217-dd81d9e9be82
github.com/spdx/tools-golang v0.5.5
github.com/testcontainers/testcontainers-go v0.40.0
github.com/testcontainers/testcontainers-go/modules/mongodb v0.40.0
github.com/thoas/go-funk v0.9.3
github.com/tidwall/gjson v1.18.0
github.com/tidwall/jsonc v0.3.2
github.com/tidwall/sjson v1.2.5
github.com/tink-crypto/tink-go/v2 v2.4.0
go.etcd.io/bbolt v1.4.1
go.mongodb.org/mongo-driver/v2 v2.5.0
go.uber.org/multierr v1.11.0
golang.org/x/crypto v0.41.0
golang.org/x/mod v0.26.0
golang.org/x/net v0.43.0
golang.org/x/crypto v0.43.0
golang.org/x/mod v0.28.0
golang.org/x/net v0.45.0
golang.org/x/oauth2 v0.30.0
golang.org/x/sync v0.17.0
golang.org/x/sys v0.35.0
golang.org/x/term v0.34.0
golang.org/x/text v0.28.0
golang.org/x/tools v0.35.0
golang.org/x/sys v0.37.0
golang.org/x/term v0.36.0
golang.org/x/text v0.30.0
golang.org/x/tools v0.37.0
golang.org/x/vuln v1.1.4
google.golang.org/grpc v1.76.0
google.golang.org/protobuf v1.36.10
Expand All @@ -80,6 +83,7 @@ require (

require (
cloud.google.com/go/compute/metadata v0.8.0 // indirect
dario.cat/mergo v1.0.2 // indirect
github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6 // indirect
github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0 // indirect
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect
Expand All @@ -90,6 +94,7 @@ require (
github.com/anchore/go-struct-converter v0.0.0-20230627203149-c72ef8859ca9 // indirect
github.com/atotto/clipboard v0.1.4 // indirect
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc // indirect
github.com/charmbracelet/x/ansi v0.8.0 // indirect
github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd // indirect
Expand All @@ -104,17 +109,19 @@ require (
github.com/containerd/stargz-snapshotter/estargz v0.16.3 // indirect
github.com/containerd/ttrpc v1.2.7 // indirect
github.com/containerd/typeurl/v2 v2.2.3 // indirect
github.com/cpuguy83/dockercfg v0.3.2 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/djherbis/times v1.6.0 // indirect
github.com/docker/cli v28.2.2+incompatible // indirect
github.com/docker/distribution v2.8.3+incompatible // indirect
github.com/docker/docker-credential-helpers v0.9.3 // indirect
github.com/docker/go-connections v0.5.0 // indirect
github.com/docker/go-connections v0.6.0 // indirect
github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/dsoprea/go-logging v0.0.0-20200710184922-b02d349568dd // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/ebitengine/purego v0.8.4 // indirect
github.com/edsrzf/mmap-go v1.1.0 // indirect
github.com/elliotwutingfeng/asciiset v0.0.0-20230602022725-51bbb787efab // indirect
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
Expand All @@ -132,19 +139,25 @@ require (
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/klauspost/compress v1.18.0 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/lunixbochs/struc v0.0.0-20200707160740-784aaebc1d40 // indirect
github.com/magiconair/properties v1.8.10 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-localereader v0.0.1 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/mattn/go-shellwords v1.0.12 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/moby/go-archive v0.1.0 // indirect
github.com/moby/locker v1.0.1 // indirect
github.com/moby/patternmatcher v0.6.0 // indirect
github.com/moby/sys/mountinfo v0.7.2 // indirect
github.com/moby/sys/sequential v0.6.0 // indirect
github.com/moby/sys/signal v0.7.1 // indirect
github.com/moby/sys/user v0.4.0 // indirect
github.com/moby/sys/userns v0.1.0 // indirect
github.com/moby/term v0.5.0 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
github.com/muesli/cancelreader v0.2.2 // indirect
github.com/muesli/termenv v0.16.0 // indirect
Expand All @@ -154,22 +167,30 @@ require (
github.com/pkg/errors v0.9.1 // indirect
github.com/pkg/xattr v0.4.9 // indirect
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/sahilm/fuzzy v0.1.1 // indirect
github.com/santhosh-tekuri/jsonschema/v6 v6.0.1 // indirect
github.com/secDre4mer/pkcs7 v0.0.0-20240322103146-665324a4461d // indirect
github.com/shirou/gopsutil/v4 v4.25.6 // indirect
github.com/sirupsen/logrus v1.9.4-0.20230606125235-dd1b4c2e81af // indirect
github.com/spdx/gordf v0.0.0-20221230105357-b735bd5aac89 // indirect
github.com/stretchr/testify v1.11.1 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.0 // indirect
github.com/tklauser/go-sysconf v0.3.15 // indirect
github.com/tklauser/numcpus v0.10.0 // indirect
github.com/tonistiigi/go-csvvalue v0.0.0-20240814133006-030d3b2625d0 // indirect
github.com/ulikunitz/xz v0.5.11 // indirect
github.com/vbatts/tar-split v0.12.1 // indirect
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
github.com/xdg-go/scram v1.2.0 // indirect
github.com/xdg-go/stringprep v1.0.4 // indirect
github.com/xhit/go-str2duration/v2 v2.1.0 // indirect
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
Expand All @@ -181,7 +202,7 @@ require (
go.uber.org/zap v1.17.0 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0 // indirect
golang.org/x/telemetry v0.0.0-20250710130107-8d8967aff50b // indirect
golang.org/x/telemetry v0.0.0-20250908211612-aef8a434d053 // indirect
golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated // indirect
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
google.golang.org/genproto v0.0.0-20250603155806-513f23925822 // indirect
Expand Down
Loading