Skip to content

Commit 890b3dc

Browse files
committed
update vulnarable versions, fix merge PR
1 parent faf0ad4 commit 890b3dc

File tree

6 files changed

+21
-21
lines changed

6 files changed

+21
-21
lines changed

.golangci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ linters:
6161
# - contextcheck disabled because of generics
6262
- dupword
6363
- decorder
64-
- depguard
64+
# - depguard
6565
- dogsled
6666
- dupl
6767
- durationcheck

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ platfrom-build: clean lint test ; $(info $(M) building binaries for multiple os/
5252
setup-tools: setup-lint setup-gocov setup-gocov-xml setup-go2xunit setup-mockery setup-ghr
5353

5454
setup-lint:
55-
$(GO) install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.50.1
55+
$(GO) install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.54.2
5656
setup-gocov:
5757
$(GO) install github.com/axw/gocov/...
5858
setup-gocov-xml:

go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ module secrets-init
33
go 1.19
44

55
require (
6+
cloud.google.com/go/compute v1.10.0
67
cloud.google.com/go/secretmanager v1.8.0
78
github.com/aws/aws-sdk-go v1.44.128
89
github.com/googleapis/gax-go/v2 v2.6.0
910
github.com/pkg/errors v0.9.1
1011
github.com/sirupsen/logrus v1.9.0
1112
github.com/stretchr/testify v1.8.1
1213
github.com/urfave/cli/v2 v2.23.0
13-
golang.org/x/sys v0.1.0
14+
golang.org/x/sys v0.12.0
1415
google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e
1516
)
1617

1718
require (
18-
cloud.google.com/go/compute v1.10.0 // indirect
1919
cloud.google.com/go/iam v0.5.0 // indirect
2020
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
2121
github.com/davecgh/go-spew v1.1.1 // indirect
@@ -30,9 +30,9 @@ require (
3030
github.com/stretchr/objx v0.5.0 // indirect
3131
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
3232
go.opencensus.io v0.23.0 // indirect
33-
golang.org/x/net v0.0.0-20221012135044-0b7e1fb9d458 // indirect
33+
golang.org/x/net v0.15.0 // indirect
3434
golang.org/x/oauth2 v0.0.0-20221006150949-b44042a4b9c1 // indirect
35-
golang.org/x/text v0.3.7 // indirect
35+
golang.org/x/text v0.13.0 // indirect
3636
google.golang.org/api v0.99.0 // indirect
3737
google.golang.org/appengine v1.6.7 // indirect
3838
google.golang.org/grpc v1.50.1 // indirect

go.sum

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
100100
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
101101
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
102102
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
103-
golang.org/x/net v0.0.0-20221012135044-0b7e1fb9d458 h1:MgJ6t2zo8v0tbmLCueaCbF1RM+TtB0rs3Lv8DGtOIpY=
104-
golang.org/x/net v0.0.0-20221012135044-0b7e1fb9d458/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
103+
golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8=
104+
golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
105105
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
106106
golang.org/x/oauth2 v0.0.0-20221006150949-b44042a4b9c1 h1:3VPzK7eqH25j7GYw5w6g/GzNRc0/fYtrxz27z1gD4W0=
107107
golang.org/x/oauth2 v0.0.0-20221006150949-b44042a4b9c1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg=
@@ -115,14 +115,15 @@ golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7w
115115
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
116116
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
117117
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
118-
golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U=
119-
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
118+
golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o=
119+
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
120120
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
121121
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
122122
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
123123
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
124-
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
125124
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
125+
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
126+
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
126127
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
127128
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
128129
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=

main.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ func main() {
5353
Name: "exit-early",
5454
Usage: "exit when a provider fails or a secret is not found",
5555
EnvVars: []string{"EXIT_EARLY"},
56+
},
5657
&cli.StringFlag{
5758
Name: "google-project",
5859
Usage: "the google cloud project for secrets without a project prefix",
@@ -174,14 +175,13 @@ func removeZombies(childPid int) {
174175
}
175176
log.WithError(err).Error("unexpected wait4 error")
176177
os.Exit(1)
177-
} else {
178-
// check if pid is child, if so save
179-
// PID is > 0 if a child was reaped, and we immediately check if another one is waiting
180-
if pid == childPid {
181-
exitCode = status.ExitStatus()
182-
}
183-
continue
184178
}
179+
// check if pid is child, if so save
180+
// PID is > 0 if a child was reaped, and we immediately check if another one is waiting
181+
if pid == childPid {
182+
exitCode = status.ExitStatus()
183+
}
184+
continue
185185
}
186186
// no more children, exit with the same code as the child process
187187
os.Exit(exitCode)

pkg/secrets/aws/secrets.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func NewAwsSecretsProvider() (secrets.Provider, error) {
4545

4646
// ResolveSecrets replaces all passed variables values prefixed with 'aws:aws:secretsmanager' and 'arn:aws:ssm:REGION:ACCOUNT:parameter'
4747
// by corresponding secrets from AWS Secret Manager and AWS Parameter Store
48-
func (sp *SecretsProvider) ResolveSecrets(_ context.Context, vars []string) ([]string, error) { //nolint:gocognit
48+
func (sp *SecretsProvider) ResolveSecrets(_ context.Context, vars []string) ([]string, error) {
4949
envs := make([]string, 0, len(vars))
5050

5151
for _, env := range vars {
@@ -68,9 +68,8 @@ func (sp *SecretsProvider) ResolveSecrets(_ context.Context, vars []string) ([]s
6868
envs = append(envs, e)
6969
}
7070
continue // We continue to not add this ENV variable but only the environment variables that exists in the JSON
71-
} else {
72-
env = key + "=" + *secret.SecretString
7371
}
72+
env = key + "=" + *secret.SecretString
7473
} else if (strings.HasPrefix(value, "arn:aws:ssm") || strings.HasPrefix(value, "arn:aws-cn:ssm")) && strings.Contains(value, ":parameter/") {
7574
tokens := strings.Split(value, ":")
7675
// valid parameter ARN arn:aws:ssm:REGION:ACCOUNT:parameter/PATH

0 commit comments

Comments
 (0)