Skip to content

Commit 0dbaeb8

Browse files
security: upgrade go to 1.19 + fix vulns in base image and dependencies (#17)
* security: upgrade go to 1.19 + fix vulns in base image and dependencies
1 parent 88819a0 commit 0dbaeb8

File tree

9 files changed

+1416
-203
lines changed

9 files changed

+1416
-203
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
dist
22
.cover
3-
.vscode
3+
.vscode
4+
.idea

Dockerfile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.17.8-bullseye as build
1+
FROM golang:1.19.9-bullseye as build
22

33
WORKDIR /pikolo
44

@@ -11,12 +11,18 @@ RUN go mod download
1111
COPY . .
1212
RUN env CGO_ENABLED=0 go build -ldflags="-s -w"
1313

14-
FROM debian:bullseye-slim
14+
FROM debian:bullseye-20230522-slim
1515

16-
RUN apt-get update -y \
17-
&& apt-get install -y ca-certificates busybox \
16+
# Update package lists and upgrade existing packages
17+
RUN apt-get update && apt-get upgrade -y
18+
19+
# Install packages required for the base image
20+
RUN apt-get install -y ca-certificates busybox \
1821
&& ln -s /bin/busybox /usr/bin/[[
1922

23+
# Clean up the package cache to reduce image size
24+
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
25+
2026
COPY --from=build /pikolo/pikolo /usr/local/bin
2127
COPY VERSION /VERSION
2228

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.13.7
1+
0.13.8

cmd/utils.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"bytes"
55
"encoding/json"
66
"io"
7-
"io/ioutil"
87
"os"
98

109
"github.com/codefresh-io/pikolo/pkg/logger"
@@ -23,7 +22,7 @@ func dieOnError(err error, logger logger.Logger) {
2322
}
2423

2524
func jsonToYaml(j io.Reader) (io.Reader, error) {
26-
buf, err := ioutil.ReadAll(j)
25+
buf, err := io.ReadAll(j)
2726
if err != nil {
2827
return nil, err
2928
}

go.mod

Lines changed: 117 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,139 @@
11
module github.com/codefresh-io/pikolo
22

3-
go 1.17
3+
go 1.19
44

55
require (
66
github.com/ghodss/yaml v1.0.0
7-
github.com/hairyhenderson/gomplate v3.5.0+incompatible
8-
github.com/imdario/mergo v0.3.7
7+
github.com/hairyhenderson/gomplate/v3 v3.11.5
8+
github.com/imdario/mergo v0.3.13
99
github.com/inconshreveable/log15 v0.0.0-20180818164646-67afb5ed74ec
10-
github.com/spf13/cobra v0.0.5
11-
github.com/stretchr/testify v1.4.0
10+
github.com/spf13/cobra v1.4.0
11+
github.com/stretchr/testify v1.7.1
1212
)
1313

1414
require (
15-
github.com/Masterminds/goutils v1.1.0 // indirect
16-
github.com/Shopify/ejson v1.2.1 // indirect
17-
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da // indirect
18-
github.com/aws/aws-sdk-go v1.23.4 // indirect
19-
github.com/boltdb/bolt v1.3.1 // indirect
15+
cloud.google.com/go v0.102.0 // indirect
16+
cloud.google.com/go/compute v1.6.1 // indirect
17+
cloud.google.com/go/iam v0.3.0 // indirect
18+
cloud.google.com/go/storage v1.22.1 // indirect
19+
github.com/Masterminds/goutils v1.1.1 // indirect
20+
github.com/Microsoft/go-winio v0.5.2 // indirect
21+
github.com/ProtonMail/go-crypto v0.0.0-20220517143526-88bb52951d5b // indirect
22+
github.com/Shopify/ejson v1.3.3 // indirect
23+
github.com/acomagu/bufpipe v1.0.3 // indirect
24+
github.com/apparentlymart/go-cidr v1.1.0 // indirect
25+
github.com/armon/go-metrics v0.4.0 // indirect
26+
github.com/armon/go-radix v1.0.0 // indirect
27+
github.com/aws/aws-sdk-go v1.44.206 // indirect
28+
github.com/aws/aws-sdk-go-v2 v1.16.4 // indirect
29+
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.1 // indirect
30+
github.com/aws/aws-sdk-go-v2/config v1.15.9 // indirect
31+
github.com/aws/aws-sdk-go-v2/credentials v1.12.4 // indirect
32+
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.5 // indirect
33+
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.14 // indirect
34+
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.11 // indirect
35+
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.5 // indirect
36+
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.12 // indirect
37+
github.com/aws/aws-sdk-go-v2/internal/v4a v1.0.2 // indirect
38+
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.1 // indirect
39+
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.6 // indirect
40+
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.5 // indirect
41+
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.13.5 // indirect
42+
github.com/aws/aws-sdk-go-v2/service/s3 v1.26.10 // indirect
43+
github.com/aws/aws-sdk-go-v2/service/sso v1.11.7 // indirect
44+
github.com/aws/aws-sdk-go-v2/service/sts v1.16.6 // indirect
45+
github.com/aws/smithy-go v1.11.2 // indirect
46+
github.com/cenkalti/backoff/v3 v3.2.2 // indirect
2047
github.com/davecgh/go-spew v1.1.1 // indirect
21-
github.com/docker/libkv v0.2.1 // indirect
48+
github.com/docker/libkv v0.2.2-0.20180912205406-458977154600 // indirect
2249
github.com/dustin/gojson v0.0.0-20160307161227-2e71ec9dd5ad // indirect
50+
github.com/emirpasic/gods v1.18.1 // indirect
51+
github.com/fatih/color v1.13.0 // indirect
52+
github.com/go-git/gcfg v1.5.0 // indirect
53+
github.com/go-git/go-billy/v5 v5.3.1 // indirect
54+
github.com/go-git/go-git/v5 v5.4.2 // indirect
2355
github.com/go-stack/stack v1.8.0 // indirect
24-
github.com/golang/snappy v0.0.1 // indirect
25-
github.com/google/uuid v1.1.1 // indirect
26-
github.com/gosimple/slug v1.7.0 // indirect
27-
github.com/gotestyourself/gotestyourself v2.2.0+incompatible // indirect
28-
github.com/hairyhenderson/toml v0.3.0 // indirect
29-
github.com/hashicorp/consul/api v1.1.0 // indirect
30-
github.com/hashicorp/errwrap v1.0.0 // indirect
31-
github.com/hashicorp/go-cleanhttp v0.5.1 // indirect
32-
github.com/hashicorp/go-immutable-radix v1.0.0 // indirect
33-
github.com/hashicorp/go-multierror v1.0.0 // indirect
34-
github.com/hashicorp/go-retryablehttp v0.5.4 // indirect
35-
github.com/hashicorp/go-rootcerts v1.0.1 // indirect
56+
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
57+
github.com/golang/protobuf v1.5.2 // indirect
58+
github.com/golang/snappy v0.0.4 // indirect
59+
github.com/google/go-cmp v0.5.8 // indirect
60+
github.com/google/uuid v1.3.0 // indirect
61+
github.com/google/wire v0.5.0 // indirect
62+
github.com/googleapis/gax-go/v2 v2.4.0 // indirect
63+
github.com/googleapis/go-type-adapters v1.0.0 // indirect
64+
github.com/gosimple/slug v1.12.0 // indirect
65+
github.com/gosimple/unidecode v1.0.1 // indirect
66+
github.com/hairyhenderson/go-fsimpl v0.0.0-20220529183339-9deae3e35047 // indirect
67+
github.com/hairyhenderson/toml v0.4.2-0.20210923231440-40456b8e66cf // indirect
68+
github.com/hairyhenderson/yaml v0.0.0-20220618171115-2d35fca545ce // indirect
69+
github.com/hashicorp/consul/api v1.13.0 // indirect
70+
github.com/hashicorp/errwrap v1.1.0 // indirect
71+
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
72+
github.com/hashicorp/go-hclog v1.2.0 // indirect
73+
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
74+
github.com/hashicorp/go-multierror v1.1.1 // indirect
75+
github.com/hashicorp/go-plugin v1.4.4 // indirect
76+
github.com/hashicorp/go-retryablehttp v0.7.1 // indirect
77+
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
78+
github.com/hashicorp/go-secure-stdlib/mlock v0.1.2 // indirect
79+
github.com/hashicorp/go-secure-stdlib/parseutil v0.1.5 // indirect
80+
github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect
3681
github.com/hashicorp/go-sockaddr v1.0.2 // indirect
37-
github.com/hashicorp/golang-lru v0.5.1 // indirect
82+
github.com/hashicorp/go-uuid v1.0.3 // indirect
83+
github.com/hashicorp/go-version v1.5.0 // indirect
84+
github.com/hashicorp/golang-lru v0.5.4 // indirect
3885
github.com/hashicorp/hcl v1.0.0 // indirect
39-
github.com/hashicorp/serf v0.8.2 // indirect
40-
github.com/hashicorp/vault/api v1.0.4 // indirect
41-
github.com/hashicorp/vault/sdk v0.1.13 // indirect
86+
github.com/hashicorp/serf v0.9.7 // indirect
87+
github.com/hashicorp/vault/api v1.6.0 // indirect
88+
github.com/hashicorp/vault/sdk v0.5.0 // indirect
89+
github.com/hashicorp/yamux v0.0.0-20211028200310-0bc27b27de87 // indirect
4290
github.com/inconshreveable/mousetrap v1.0.0 // indirect
43-
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af // indirect
44-
github.com/joho/godotenv v1.3.0 // indirect
45-
github.com/mattn/go-colorable v0.1.2 // indirect
46-
github.com/mattn/go-isatty v0.0.9 // indirect
91+
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
92+
github.com/jmespath/go-jmespath v0.4.0 // indirect
93+
github.com/joho/godotenv v1.4.0 // indirect
94+
github.com/kevinburke/ssh_config v1.2.0 // indirect
95+
github.com/mattn/go-colorable v0.1.12 // indirect
96+
github.com/mattn/go-isatty v0.0.14 // indirect
97+
github.com/mitchellh/copystructure v1.2.0 // indirect
4798
github.com/mitchellh/go-homedir v1.1.0 // indirect
48-
github.com/mitchellh/mapstructure v1.1.2 // indirect
49-
github.com/pierrec/lz4 v2.0.5+incompatible // indirect
50-
github.com/pkg/errors v0.8.1 // indirect
99+
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
100+
github.com/mitchellh/mapstructure v1.5.0 // indirect
101+
github.com/mitchellh/reflectwalk v1.0.2 // indirect
102+
github.com/oklog/run v1.1.0 // indirect
103+
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
104+
github.com/pkg/errors v0.9.1 // indirect
51105
github.com/pmezard/go-difflib v1.0.0 // indirect
52-
github.com/rainycape/unidecode v0.0.0-20150907023854-cb7f23ec59be // indirect
106+
github.com/rs/zerolog v1.26.1 // indirect
53107
github.com/ryanuber/go-glob v1.0.0 // indirect
54-
github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337 // indirect
55-
github.com/spf13/afero v1.2.0 // indirect
56-
github.com/spf13/pflag v1.0.3 // indirect
57-
github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8 // indirect
108+
github.com/sergi/go-diff v1.2.0 // indirect
109+
github.com/spf13/afero v1.8.2 // indirect
110+
github.com/spf13/pflag v1.0.5 // indirect
111+
github.com/ugorji/go/codec v1.2.7 // indirect
112+
github.com/xanzy/ssh-agent v0.3.1 // indirect
58113
github.com/zealic/xignore v0.3.3 // indirect
59-
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 // indirect
60-
golang.org/x/net v0.0.0-20220906165146-f3363e06e74c // indirect
61-
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10 // indirect
62-
golang.org/x/text v0.3.7 // indirect
63-
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 // indirect
64-
gopkg.in/hairyhenderson/yaml.v2 v2.0.0-00010101000000-000000000000 // indirect
65-
gopkg.in/square/go-jose.v2 v2.3.1 // indirect
66-
gopkg.in/yaml.v2 v2.2.4 // indirect
67-
gotest.tools v2.2.0+incompatible // indirect
114+
go.etcd.io/bbolt v1.3.6 // indirect
115+
go.opencensus.io v0.23.0 // indirect
116+
go.uber.org/atomic v1.9.0 // indirect
117+
go4.org/intern v0.0.0-20230205224052-192e9f60865c // indirect
118+
go4.org/unsafe/assume-no-moving-gc v0.0.0-20230204201903-c31fa085b70e // indirect
119+
gocloud.dev v0.25.1-0.20220408200107-09b10f7359f7 // indirect
120+
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect
121+
golang.org/x/net v0.7.0 // indirect
122+
golang.org/x/oauth2 v0.0.0-20220524215830-622c5d57e401 // indirect
123+
golang.org/x/sys v0.5.0 // indirect
124+
golang.org/x/text v0.7.0 // indirect
125+
golang.org/x/time v0.0.0-20220411224347-583f2d630306 // indirect
126+
golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df // indirect
127+
google.golang.org/api v0.81.0 // indirect
128+
google.golang.org/appengine v1.6.7 // indirect
129+
google.golang.org/genproto v0.0.0-20220527130721-00d5c0f3be58 // indirect
130+
google.golang.org/grpc v1.46.2 // indirect
131+
google.golang.org/protobuf v1.28.0 // indirect
132+
gopkg.in/square/go-jose.v2 v2.6.0 // indirect
133+
gopkg.in/warnings.v0 v0.1.2 // indirect
134+
gopkg.in/yaml.v2 v2.4.0 // indirect
135+
gopkg.in/yaml.v3 v3.0.1 // indirect
136+
inet.af/netaddr v0.0.0-20220811202034-502d2d690317 // indirect
68137
k8s.io/client-go v11.0.0+incompatible // indirect
69138
)
70139

0 commit comments

Comments
 (0)