Skip to content

Commit 90694bf

Browse files
authored
Remove Snowflake Driver (#4173)
* Refactor Snowflake detector to remove dependency on gosnowflake and implement custom login request handling - Removed the gosnowflake driver dependency from the Snowflake detector. - Introduced a custom login request structure and logic to handle authentication via Snowflake's undocumented API. - Updated password validation to enforce minimum length and character requirements. - Adjusted integration tests to account for changes in the Result struct * Refactor Snowflake credential verification logic - Moved the credential verification logic into a separate function, `verifyMatch`, to improve code organization and readability. - Simplified error handling and response processing within the verification function. * Refactor Snowflake password validation logic and simpler error handling * Added documentation note regarding the undocumented Snowflake login endpoint.
1 parent 42a1e9a commit 90694bf

File tree

4 files changed

+101
-124
lines changed

4 files changed

+101
-124
lines changed

go.mod

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ toolchain go1.24.2
66

77
replace github.com/jpillora/overseer => github.com/trufflesecurity/overseer v1.2.8
88

9-
replace github.com/snowflakedb/gosnowflake => github.com/trufflesecurity/gosnowflake v0.0.1
10-
119
// Coinbase archived this library and it has some vulnerable dependencies so we've forked.
1210
replace github.com/coinbase/waas-client-library-go => github.com/trufflesecurity/waas-client-library-go v1.0.9
1311

@@ -89,7 +87,6 @@ require (
8987
github.com/sendgrid/sendgrid-go v3.16.0+incompatible
9088
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3
9189
github.com/shuheiktgw/go-travis v0.3.1
92-
github.com/snowflakedb/gosnowflake v1.13.3
9390
github.com/stretchr/testify v1.10.0
9491
github.com/tailscale/depaware v0.0.0-20250112153213-b748de04d81b
9592
github.com/testcontainers/testcontainers-go v0.34.0
@@ -133,8 +130,6 @@ require (
133130
cloud.google.com/go/monitoring v1.24.0 // indirect
134131
dario.cat/mergo v1.0.0 // indirect
135132
filippo.io/edwards25519 v1.1.0 // indirect
136-
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
137-
github.com/99designs/keyring v1.2.2 // indirect
138133
github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect
139134
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
140135
github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 // indirect
@@ -143,14 +138,12 @@ require (
143138
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.25.0 // indirect
144139
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.50.0 // indirect
145140
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.50.0 // indirect
146-
github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c // indirect
147141
github.com/Microsoft/go-winio v0.6.2 // indirect
148142
github.com/ProtonMail/go-crypto v1.1.5 // indirect
149143
github.com/STARRY-S/zip v0.2.1 // indirect
150144
github.com/alecthomas/chroma/v2 v2.8.0 // indirect
151145
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect
152146
github.com/andybalholm/brotli v1.1.1 // indirect
153-
github.com/apache/arrow/go/v14 v14.0.2 // indirect
154147
github.com/atotto/clipboard v0.1.4 // indirect
155148
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.10 // indirect
156149
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.30 // indirect
@@ -187,7 +180,6 @@ require (
187180
github.com/couchbaselabs/gocbconnstr/v2 v2.0.0-20240607131231-fb385523de28 // indirect
188181
github.com/cpuguy83/dockercfg v0.3.2 // indirect
189182
github.com/cyphar/filepath-securejoin v0.3.6 // indirect
190-
github.com/danieljoos/wincred v1.2.1 // indirect
191183
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
192184
github.com/distribution/reference v0.6.0 // indirect
193185
github.com/dlclark/regexp2 v1.4.0 // indirect
@@ -198,30 +190,25 @@ require (
198190
github.com/docker/go-connections v0.5.0 // indirect
199191
github.com/docker/go-units v0.5.0 // indirect
200192
github.com/dsnet/compress v0.0.2-0.20230904184137-39efe44ab707 // indirect
201-
github.com/dvsekhvalnov/jose2go v1.6.0 // indirect
202193
github.com/elastic/elastic-transport-go/v8 v8.6.1 // indirect
203194
github.com/emirpasic/gods v1.18.1 // indirect
204195
github.com/envoyproxy/go-control-plane/envoy v1.32.4 // indirect
205196
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
206197
github.com/felixge/httpsnoop v1.0.4 // indirect
207-
github.com/form3tech-oss/jwt-go v3.2.5+incompatible // indirect
208198
github.com/fsnotify/fsnotify v1.6.0 // indirect
209199
github.com/go-asn1-ber/asn1-ber v1.5.8-0.20250403174932-29230038a667 // indirect
210200
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
211201
github.com/go-git/go-billy/v5 v5.6.2 // indirect
212202
github.com/go-jose/go-jose/v4 v4.0.2 // indirect
213203
github.com/go-logr/stdr v1.2.2 // indirect
214204
github.com/go-ole/go-ole v1.2.6 // indirect
215-
github.com/goccy/go-json v0.10.2 // indirect
216-
github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect
217205
github.com/gofrs/flock v0.12.1 // indirect
218206
github.com/gogo/protobuf v1.3.2 // indirect
219207
github.com/golang-jwt/jwt/v4 v4.5.1 // indirect
220208
github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 // indirect
221209
github.com/golang-sql/sqlexp v0.1.0 // indirect
222210
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
223211
github.com/golang/snappy v0.0.4 // indirect
224-
github.com/google/flatbuffers v23.5.26+incompatible // indirect
225212
github.com/google/go-github/v66 v66.0.0 // indirect
226213
github.com/google/go-querystring v1.1.0 // indirect
227214
github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7 // indirect
@@ -231,7 +218,6 @@ require (
231218
github.com/gorilla/websocket v1.5.3 // indirect
232219
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
233220
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect
234-
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
235221
github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 // indirect
236222
github.com/hashicorp/errwrap v1.1.0 // indirect
237223
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
@@ -241,7 +227,6 @@ require (
241227
github.com/kevinburke/ssh_config v1.2.0 // indirect
242228
github.com/kjk/lzma v0.0.0-20161016003348-3fd93898850d // indirect
243229
github.com/klauspost/compress v1.17.11 // indirect
244-
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
245230
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
246231
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
247232
github.com/magiconair/properties v1.8.7 // indirect
@@ -259,7 +244,6 @@ require (
259244
github.com/moby/term v0.5.0 // indirect
260245
github.com/montanaflynn/stats v0.7.1 // indirect
261246
github.com/morikuni/aec v1.0.0 // indirect
262-
github.com/mtibben/percent v0.2.1 // indirect
263247
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
264248
github.com/muesli/cancelreader v0.2.2 // indirect
265249
github.com/muesli/termenv v0.16.0 // indirect
@@ -306,7 +290,6 @@ require (
306290
github.com/yuin/goldmark v1.5.4 // indirect
307291
github.com/yuin/goldmark-emoji v1.0.2 // indirect
308292
github.com/yusufpapurcu/wmi v1.2.3 // indirect
309-
github.com/zeebo/xxh3 v1.0.2 // indirect
310293
go.einride.tech/aip v0.60.0 // indirect
311294
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
312295
go.opentelemetry.io/contrib/detectors/gcp v1.34.0 // indirect
@@ -325,7 +308,6 @@ require (
325308
golang.org/x/sys v0.32.0 // indirect
326309
golang.org/x/term v0.31.0 // indirect
327310
golang.org/x/tools v0.29.0 // indirect
328-
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
329311
google.golang.org/genproto v0.0.0-20250303144028-a0af3efb3deb // indirect
330312
google.golang.org/genproto/googleapis/api v0.0.0-20250414145226-207652e42e2e // indirect
331313
google.golang.org/genproto/googleapis/rpc v0.0.0-20250414145226-207652e42e2e // indirect

0 commit comments

Comments
 (0)