Skip to content

Commit e609507

Browse files
authored
bump deps, sign images, few fixes (#25)
* bump deps, sign images, few fixes * use signed hashes for github actions
1 parent e768419 commit e609507

File tree

5 files changed

+58
-33
lines changed

5 files changed

+58
-33
lines changed

.github/workflows/build.yaml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ jobs:
1717
run: sudo apt install -y libpcap-dev
1818

1919
- name: Checkout repository
20-
uses: actions/checkout@v3
20+
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
2121

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

2727
- name: Run hadolint
28-
uses: reviewdog/action-hadolint@v1
28+
uses: reviewdog/action-hadolint@921946a7ebaaf08ac72607bad67209f4e52b5407 # v1
2929
build:
3030
runs-on: ubuntu-latest
3131
needs: lint
@@ -34,10 +34,10 @@ jobs:
3434
run: sudo apt install -y libpcap-dev
3535

3636
- name: Checkout source code
37-
uses: actions/checkout@v3
37+
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
3838

3939
- name: Setup Go
40-
uses: actions/setup-go@v3
40+
uses: actions/setup-go@be3c94b385c4f180051c996d336f57a34c397495 # v3
4141
with:
4242
go-version: '1.24.3'
4343

@@ -59,9 +59,7 @@ jobs:
5959
with:
6060
image-ref: 'controlplane/netassertv2-packet-sniffer:${{ github.sha }}'
6161
format: 'table'
62+
ignore-unfixed: true
6263
exit-code: '1'
6364
vuln-type: 'os,library'
64-
output: 'trivy-results.txt'
6565
severity: 'CRITICAL,HIGH,MEDIUM'
66-
67-
- run: cat trivy-results.txt

.github/workflows/docker.yaml

Lines changed: 39 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +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
48+
id: buildpush
49+
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6
3450
with:
3551
platforms: linux/amd64,linux/arm64
52+
sbom: true
53+
provenance: mode=max
3654
push: true
3755
tags: |
38-
controlplane/netassertv2-packet-sniffer:${{ github.ref_name }}
39-
controlplane/netassertv2-packet-sniffer:latest
56+
docker.io/controlplane/netassertv2-packet-sniffer:${{ github.ref_name }}
57+
docker.io/controlplane/netassertv2-packet-sniffer: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-packet-sniffer@${{ steps.buildpush.outputs.digest }}"

Dockerfile

Lines changed: 2 additions & 2 deletions
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
RUN apk add --no-cache build-base libpcap-dev && \
@@ -8,7 +8,7 @@ RUN apk add --no-cache build-base libpcap-dev && \
88
# we need to enable CGO as we need to compile with libpcap bindings
99
GO111MODULE=on CGO_ENABLED=1 GOOS=linux go build -v -o /packet-capture .
1010

11-
FROM alpine:3.21
11+
FROM alpine:3.23
1212

1313
COPY --from=builder /packet-capture /usr/bin/packet-capture
1414

go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
module github.com/controlplaneio/netassertv2-packet-sniffer
22

3-
go 1.24.3
3+
go 1.25.4
44

55
require (
6-
github.com/ardanlabs/conf/v3 v3.7.2
6+
github.com/ardanlabs/conf/v3 v3.10.0
77
github.com/google/gopacket v1.1.19
88
github.com/stretchr/testify v1.9.0
9-
go.uber.org/zap v1.27.0
9+
go.uber.org/zap v1.27.1
1010
)
1111

1212
require (
@@ -17,7 +17,7 @@ require (
1717
github.com/rogpeppe/go-internal v1.8.1 // indirect
1818
go.uber.org/multierr v1.11.0 // indirect
1919
golang.org/x/net v0.38.0 // indirect
20-
golang.org/x/sys v0.33.0 // indirect
20+
golang.org/x/sys v0.40.0 // indirect
2121
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
2222
gopkg.in/yaml.v3 v3.0.1 // indirect
2323
)

go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
github.com/ardanlabs/conf/v3 v3.7.2 h1:s2VBuDJM6OQfR0erDuopiZ+dHUQVqGxZeLrTsls03dw=
2-
github.com/ardanlabs/conf/v3 v3.7.2/go.mod h1:XlL9P0quWP4m1weOVFmlezabinbZLI05niDof/+Ochk=
1+
github.com/ardanlabs/conf/v3 v3.10.0 h1:qIrJ/WBmH/hFQ/IX4xH9LX9LzwK44T9aEOy78M+4S+0=
2+
github.com/ardanlabs/conf/v3 v3.10.0/go.mod h1:XlL9P0quWP4m1weOVFmlezabinbZLI05niDof/+Ochk=
33
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
44
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
55
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -27,8 +27,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
2727
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
2828
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
2929
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
30-
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
31-
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
30+
go.uber.org/zap v1.27.1 h1:08RqriUEv8+ArZRYSTXy1LeBScaMpVSTBhCeaZYfMYc=
31+
go.uber.org/zap v1.27.1/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
3232
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
3333
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
3434
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
@@ -40,8 +40,8 @@ golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
4040
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
4141
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
4242
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
43-
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
44-
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
43+
golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ=
44+
golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
4545
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
4646
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
4747
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

0 commit comments

Comments
 (0)