Skip to content

Commit d43fdb5

Browse files
authored
bump deps, sign images, few fixes (#9)
* bump deps, sign images, few fixes * use signed hashes for github actions
1 parent 0afa8e5 commit d43fdb5

File tree

5 files changed

+84
-64
lines changed

5 files changed

+84
-64
lines changed

.github/workflows/build.yaml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,24 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: Checkout repository
18-
uses: actions/checkout@v3
18+
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
1919

2020
- name: Run golangci-lint
21-
uses: reviewdog/action-golangci-lint@v2
21+
uses: reviewdog/action-golangci-lint@f9bba13753278f6a73b27a56a3ffb1bfda90ed71 # v2
2222
with:
23-
go_version: "1.24.3"
23+
go_version: "1.25.4"
2424

2525
- name: Run hadolint
26-
uses: reviewdog/action-hadolint@v1
26+
uses: reviewdog/action-hadolint@921946a7ebaaf08ac72607bad67209f4e52b5407 # v1
2727
build:
2828
runs-on: ubuntu-latest
2929
needs: lint
3030
steps:
3131
- name: Checkout source code
32-
uses: actions/checkout@v3
32+
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
3333

3434
- name: Setup Go
35-
uses: actions/setup-go@v3
35+
uses: actions/setup-go@be3c94b385c4f180051c996d336f57a34c397495 # v3
3636
with:
3737
go-version: '1.24.3'
3838

@@ -44,6 +44,7 @@ jobs:
4444

4545
- name: Build
4646
run: go build -v ./...
47+
4748
- name: Build an image from Dockerfile
4849
run: |
4950
docker build -t controlplane/netassertv2-l4-client:${{ github.sha }} .
@@ -56,6 +57,4 @@ jobs:
5657
ignore-unfixed: true
5758
exit-code: '1'
5859
vuln-type: 'os,library'
59-
output: 'trivy-results.txt'
6060
severity: 'CRITICAL,HIGH,MEDIUM'
61-
- run: cat trivy-results.txt

.github/workflows/docker.yaml

Lines changed: 39 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,41 +5,62 @@ on:
55
tags:
66
- "v[0-9]+.[0-9]+.[0-9]+"
77

8+
env:
9+
GH_REGISTRY: ghcr.io
10+
IMAGE_NAME: ${{ github.repository }}
11+
812
jobs:
913
docker:
1014
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
packages: write
18+
id-token: write
19+
attestations: write
20+
1121
steps:
1222
- name: Checkout code
13-
uses: actions/checkout@v2
14-
15-
- name: Print Tag
16-
run: |
17-
echo "Tag name from GITHUB_REF_NAME: $GITHUB_REF_NAME"
18-
echo "Tag name from github.ref_name: ${{ github.ref_name }}"
23+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
1924

2025
- name: Set up QEMU
21-
uses: docker/setup-qemu-action@v2
26+
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3
2227

2328
- name: Set up Docker Buildx
24-
uses: docker/setup-buildx-action@v2
29+
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
30+
31+
- name: Install cosign
32+
uses: sigstore/cosign-installer@398d4b0eeef1380460a10c8013a76f728fb906ac # v3
33+
34+
- name: Log in to GHCR
35+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3
36+
with:
37+
registry: ${{ env.GH_REGISTRY }}
38+
username: ${{ github.actor }}
39+
password: ${{ secrets.GITHUB_TOKEN }}
2540

2641
- name: Login to Docker Hub
27-
uses: docker/login-action@v2
42+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3
2843
with:
2944
username: ${{ secrets.DOCKERHUB_USERNAME }}
3045
password: ${{ secrets.DOCKERHUB_TOKEN }}
3146

3247
- name: Build and push
33-
uses: docker/build-push-action@v4
34-
with:
35-
push: true
36-
tags: controlplane/netassertv2-l4-client:${{ github.ref_name }}
37-
38-
- name: Build and push
39-
uses: docker/build-push-action@v4
48+
id: buildpush
49+
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6
4050
with:
4151
platforms: linux/amd64,linux/arm64
52+
sbom: true
53+
provenance: mode=max
4254
push: true
4355
tags: |
44-
controlplane/netassertv2-l4-client:${{ github.ref_name }}
45-
controlplane/netassertv2-l4-client:latest
56+
docker.io/controlplane/netassertv2-l4-client:${{ github.ref_name }}
57+
docker.io/controlplane/netassertv2-l4-client:latest
58+
${{ env.GH_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}
59+
${{ env.GH_REGISTRY }}/${{ env.IMAGE_NAME }}:latest
60+
61+
- name: Sign artifact
62+
run: |
63+
cosign sign --yes \
64+
"${{ env.GH_REGISTRY }}/${{ env.IMAGE_NAME }}@${{ steps.buildpush.outputs.digest }}"
65+
cosign sign --yes \
66+
"docker.io/controlplane/netassertv2-l4-client@${{ steps.buildpush.outputs.digest }}"

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.24-alpine AS builder
1+
FROM golang:1.25-alpine AS builder
22
COPY . /build
33
WORKDIR /build
44

go.mod

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
11
module github.com/controlplaneio/netassertv2-l4-client
22

3-
go 1.24.3
3+
go 1.25.4
44

55
require (
6-
github.com/spf13/cobra v1.9.1
7-
github.com/spf13/pflag v1.0.6
8-
github.com/spf13/viper v1.20.1
6+
github.com/spf13/cobra v1.10.2
7+
github.com/spf13/pflag v1.0.10
8+
github.com/spf13/viper v1.21.0
99
go.uber.org/automaxprocs v1.6.0
10-
go.uber.org/zap v1.27.0
10+
go.uber.org/zap v1.27.1
1111
)
1212

1313
require (
1414
github.com/fsnotify/fsnotify v1.9.0 // indirect
15-
github.com/go-viper/mapstructure/v2 v2.2.1 // indirect
15+
github.com/go-viper/mapstructure/v2 v2.5.0 // indirect
1616
github.com/inconshreveable/mousetrap v1.1.0 // indirect
1717
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
18-
github.com/sagikazarmark/locafero v0.9.0 // indirect
19-
github.com/sourcegraph/conc v0.3.0 // indirect
20-
github.com/spf13/afero v1.14.0 // indirect
21-
github.com/spf13/cast v1.8.0 // indirect
18+
github.com/sagikazarmark/locafero v0.12.0 // indirect
19+
github.com/spf13/afero v1.15.0 // indirect
20+
github.com/spf13/cast v1.10.0 // indirect
2221
github.com/subosito/gotenv v1.6.0 // indirect
2322
go.uber.org/multierr v1.11.0 // indirect
24-
golang.org/x/sys v0.33.0 // indirect
25-
golang.org/x/text v0.25.0 // indirect
23+
go.yaml.in/yaml/v3 v3.0.4 // indirect
24+
golang.org/x/sys v0.40.0 // indirect
25+
golang.org/x/text v0.33.0 // indirect
2626
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
27-
gopkg.in/yaml.v3 v3.0.1 // indirect
2827
)

go.sum

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHk
55
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
66
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
77
github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
8-
github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss=
9-
github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
8+
github.com/go-viper/mapstructure/v2 v2.5.0 h1:vM5IJoUAy3d7zRSVtIwQgBj7BiWtMPfmPEgAXnvj1Ro=
9+
github.com/go-viper/mapstructure/v2 v2.5.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
1010
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
1111
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
1212
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
@@ -27,22 +27,21 @@ github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P
2727
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
2828
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
2929
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
30-
github.com/sagikazarmark/locafero v0.9.0 h1:GbgQGNtTrEmddYDSAH9QLRyfAHY12md+8YFTqyMTC9k=
31-
github.com/sagikazarmark/locafero v0.9.0/go.mod h1:UBUyz37V+EdMS3hDF3QWIiVr/2dPrx49OMO0Bn0hJqk=
32-
github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo=
33-
github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0=
34-
github.com/spf13/afero v1.14.0 h1:9tH6MapGnn/j0eb0yIXiLjERO8RB6xIVZRDCX7PtqWA=
35-
github.com/spf13/afero v1.14.0/go.mod h1:acJQ8t0ohCGuMN3O+Pv0V0hgMxNYDlvdk+VTfyZmbYo=
36-
github.com/spf13/cast v1.8.0 h1:gEN9K4b8Xws4EX0+a0reLmhq8moKn7ntRlQYgjPeCDk=
37-
github.com/spf13/cast v1.8.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
38-
github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo=
39-
github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0=
40-
github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o=
41-
github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
42-
github.com/spf13/viper v1.20.1 h1:ZMi+z/lvLyPSCoNtFCpqjy0S4kPbirhpTMwl8BkW9X4=
43-
github.com/spf13/viper v1.20.1/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4=
44-
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
45-
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
30+
github.com/sagikazarmark/locafero v0.12.0 h1:/NQhBAkUb4+fH1jivKHWusDYFjMOOKU88eegjfxfHb4=
31+
github.com/sagikazarmark/locafero v0.12.0/go.mod h1:sZh36u/YSZ918v0Io+U9ogLYQJ9tLLBmM4eneO6WwsI=
32+
github.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I=
33+
github.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg=
34+
github.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY=
35+
github.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo=
36+
github.com/spf13/cobra v1.10.2 h1:DMTTonx5m65Ic0GOoRY2c16WCbHxOOw6xxezuLaBpcU=
37+
github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiTUUS4=
38+
github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
39+
github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=
40+
github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
41+
github.com/spf13/viper v1.21.0 h1:x5S+0EU27Lbphp4UKm1C+1oQO+rKx36vfCoaVebLFSU=
42+
github.com/spf13/viper v1.21.0/go.mod h1:P0lhsswPGWD/1lZJ9ny3fYnVqxiegrlNrEmgLjbTCAY=
43+
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
44+
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
4645
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
4746
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
4847
go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs=
@@ -51,12 +50,14 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
5150
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
5251
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
5352
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
54-
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
55-
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
56-
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
57-
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
58-
golang.org/x/text v0.25.0 h1:qVyWApTSYLk/drJRO5mDlNYskwQznZmkpV2c8q9zls4=
59-
golang.org/x/text v0.25.0/go.mod h1:WEdwpYrmk1qmdHvhkSTNPm3app7v4rsT8F2UD6+VHIA=
53+
go.uber.org/zap v1.27.1 h1:08RqriUEv8+ArZRYSTXy1LeBScaMpVSTBhCeaZYfMYc=
54+
go.uber.org/zap v1.27.1/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
55+
go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc=
56+
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
57+
golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ=
58+
golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
59+
golang.org/x/text v0.33.0 h1:B3njUFyqtHDUI5jMn1YIr5B0IE2U0qck04r6d4KPAxE=
60+
golang.org/x/text v0.33.0/go.mod h1:LuMebE6+rBincTi9+xWTY8TztLzKHc/9C1uBCG27+q8=
6061
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
6162
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
6263
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=

0 commit comments

Comments
 (0)