Skip to content
This repository was archived by the owner on Apr 22, 2024. It is now read-only.

Commit 85e7991

Browse files
authored
Bump dependencies and configure a nonroot user (#82)
1 parent c93146a commit 85e7991

File tree

5 files changed

+167
-112
lines changed

5 files changed

+167
-112
lines changed

.github/workflows/scan.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Copyright 2024 Tetrate
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Scan
16+
17+
on:
18+
push:
19+
branches:
20+
- main
21+
- release-**
22+
tags: [ 'v[0-9]+.[0-9]+.[0-9]+**' ] # Ex. v0.2.0, v0.2.1-rc2
23+
pull_request:
24+
branches:
25+
- main
26+
- release-**
27+
workflow_dispatch: {}
28+
29+
env:
30+
GOPROXY: https://proxy.golang.org
31+
32+
jobs:
33+
scan:
34+
runs-on: ubuntu-latest
35+
env:
36+
DOCKER_TAG: scan
37+
DOCKER_HUB: local
38+
DOCKER_TARGETS: linux-amd64
39+
steps:
40+
- uses: docker/setup-qemu-action@v3
41+
with:
42+
platforms: amd64
43+
- uses: docker/setup-buildx-action@v3
44+
- uses: actions/checkout@v4
45+
- run: make docker
46+
- uses: anchore/scan-action@v3
47+
with:
48+
image: local/authservice:scan-amd64
49+
output-format: table

Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,28 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
# Builder image used to create a non-root user and to pick the SSL CA certs from
16+
FROM alpine:3.18.0 as builder
17+
RUN apk --update add ca-certificates
18+
RUN adduser --disabled-password --gecos "" --uid 65532 nonroot
19+
20+
1521
FROM scratch
1622

1723
ARG TARGETARCH
1824
ARG TARGETOS
1925
ARG REPO
2026
ARG FLAVOR
2127

28+
# Copy the user info so we can run the container as a non-root user
29+
COPY --from=builder /etc/passwd /etc/passwd
30+
COPY --from=builder /etc/group /etc/group
31+
# Copy the base SSL CA certs so we can make HTTPS requests
32+
COPY --from=builder /etc/ssl/cert.pem /etc/ssl/cert.pem
33+
34+
# Run as non-root. We can't use nonroot:nonroot here since in K8s:
35+
# https://github.com/kubernetes/kubernetes/blob/98eff192802a87c613091223f774a6c789543e74/pkg/kubelet/kuberuntime/security_context_others.go#L49.
36+
USER 65532:65532
37+
2238
ADD bin/authservice-${FLAVOR}-${TARGETOS}-${TARGETARCH} /usr/local/bin/authservice
2339
ENTRYPOINT ["/usr/local/bin/authservice"]

go.mod

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ require (
77
github.com/envoyproxy/go-control-plane v0.12.0
88
github.com/envoyproxy/protoc-gen-validate v1.0.4
99
github.com/go-logr/logr v1.4.1
10-
github.com/lestrrat-go/httprc v1.0.4
11-
github.com/lestrrat-go/jwx/v2 v2.0.20
12-
github.com/redis/go-redis/v9 v9.4.0
13-
github.com/stretchr/testify v1.8.4
10+
github.com/lestrrat-go/httprc v1.0.5
11+
github.com/lestrrat-go/jwx/v2 v2.0.21
12+
github.com/redis/go-redis/v9 v9.5.1
13+
github.com/stretchr/testify v1.9.0
1414
github.com/tetratelabs/log v0.2.3
1515
github.com/tetratelabs/run v0.3.0
1616
github.com/tetratelabs/telemetry v0.8.2
17-
golang.org/x/net v0.20.0
18-
google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe
19-
google.golang.org/grpc v1.61.0
17+
golang.org/x/net v0.22.0
18+
google.golang.org/genproto/googleapis/rpc v0.0.0-20240304212257-790db918fca8
19+
google.golang.org/grpc v1.62.1
2020
google.golang.org/protobuf v1.33.0
2121
gopkg.in/yaml.v3 v3.0.1
2222
k8s.io/api v0.29.2
@@ -26,30 +26,30 @@ require (
2626
)
2727

2828
require (
29-
cloud.google.com/go/compute v1.23.3 // indirect
29+
cloud.google.com/go/compute v1.25.0 // indirect
3030
cloud.google.com/go/compute/metadata v0.2.3 // indirect
31-
github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect
31+
github.com/alicebob/gopher-json v0.0.0-20230218143504-906a9b012302 // indirect
3232
github.com/beorn7/perks v1.0.1 // indirect
3333
github.com/cespare/xxhash/v2 v2.2.0 // indirect
34-
github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa // indirect
34+
github.com/cncf/xds/go v0.0.0-20240306133729-91a88dc4e959 // indirect
3535
github.com/davecgh/go-spew v1.1.1 // indirect
3636
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
3737
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
38-
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
39-
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
40-
github.com/evanphx/json-patch/v5 v5.8.0 // indirect
38+
github.com/emicklei/go-restful/v3 v3.11.3 // indirect
39+
github.com/evanphx/json-patch v5.9.0+incompatible // indirect
40+
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
4141
github.com/fsnotify/fsnotify v1.7.0 // indirect
42-
github.com/go-openapi/jsonpointer v0.19.6 // indirect
43-
github.com/go-openapi/jsonreference v0.20.2 // indirect
44-
github.com/go-openapi/swag v0.22.3 // indirect
42+
github.com/go-openapi/jsonpointer v0.20.3 // indirect
43+
github.com/go-openapi/jsonreference v0.20.5 // indirect
44+
github.com/go-openapi/swag v0.22.10 // indirect
4545
github.com/goccy/go-json v0.10.2 // indirect
4646
github.com/gogo/protobuf v1.3.2 // indirect
4747
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
4848
github.com/golang/protobuf v1.5.4 // indirect
4949
github.com/google/gnostic-models v0.6.8 // indirect
5050
github.com/google/go-cmp v0.6.0 // indirect
5151
github.com/google/gofuzz v1.2.0 // indirect
52-
github.com/google/uuid v1.4.0 // indirect
52+
github.com/google/uuid v1.6.0 // indirect
5353
github.com/imdario/mergo v0.3.6 // indirect
5454
github.com/josharian/intern v1.0.0 // indirect
5555
github.com/json-iterator/go v1.1.12 // indirect
@@ -59,36 +59,35 @@ require (
5959
github.com/lestrrat-go/option v1.0.1 // indirect
6060
github.com/logrusorgru/aurora v2.0.3+incompatible // indirect
6161
github.com/mailru/easyjson v0.7.7 // indirect
62-
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
6362
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
6463
github.com/modern-go/reflect2 v1.0.2 // indirect
6564
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
6665
github.com/pkg/errors v0.9.1 // indirect
6766
github.com/pmezard/go-difflib v1.0.0 // indirect
68-
github.com/prometheus/client_golang v1.18.0 // indirect
69-
github.com/prometheus/client_model v0.5.0 // indirect
70-
github.com/prometheus/common v0.45.0 // indirect
71-
github.com/prometheus/procfs v0.12.0 // indirect
67+
github.com/prometheus/client_golang v1.19.0 // indirect
68+
github.com/prometheus/client_model v0.6.0 // indirect
69+
github.com/prometheus/common v0.50.0 // indirect
70+
github.com/prometheus/procfs v0.13.0 // indirect
7271
github.com/rogpeppe/go-internal v1.12.0 // indirect
7372
github.com/segmentio/asm v1.2.0 // indirect
7473
github.com/spf13/pflag v1.0.5 // indirect
75-
github.com/yuin/gopher-lua v1.1.0 // indirect
76-
golang.org/x/crypto v0.19.0 // indirect
77-
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
78-
golang.org/x/oauth2 v0.16.0 // indirect
79-
golang.org/x/sys v0.17.0 // indirect
80-
golang.org/x/term v0.17.0 // indirect
74+
github.com/yuin/gopher-lua v1.1.1 // indirect
75+
golang.org/x/crypto v0.21.0 // indirect
76+
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect
77+
golang.org/x/oauth2 v0.18.0 // indirect
78+
golang.org/x/sys v0.18.0 // indirect
79+
golang.org/x/term v0.18.0 // indirect
8180
golang.org/x/text v0.14.0 // indirect
82-
golang.org/x/time v0.3.0 // indirect
81+
golang.org/x/time v0.5.0 // indirect
8382
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
8483
google.golang.org/appengine v1.6.8 // indirect
8584
gopkg.in/inf.v0 v0.9.1 // indirect
8685
gopkg.in/yaml.v2 v2.4.0 // indirect
87-
k8s.io/apiextensions-apiserver v0.29.0 // indirect
88-
k8s.io/component-base v0.29.0 // indirect
89-
k8s.io/klog/v2 v2.110.1 // indirect
90-
k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect
91-
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
86+
k8s.io/apiextensions-apiserver v0.29.2 // indirect
87+
k8s.io/component-base v0.29.2 // indirect
88+
k8s.io/klog/v2 v2.120.1 // indirect
89+
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
90+
k8s.io/utils v0.0.0-20240102154912-e7106e64919e // indirect
9291
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
9392
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
9493
sigs.k8s.io/yaml v1.4.0 // indirect

0 commit comments

Comments
 (0)