Skip to content

Commit

Permalink
Merge pull request #355 from arnested/dependabot/github_actions/secur…
Browse files Browse the repository at this point in the history
…ego/gosec-2.21.3

Bump securego/gosec from 2.21.2 to 2.21.3
  • Loading branch information
arnested authored Sep 18, 2024
2 parents 69b8d50 + 8a97b1f commit 59c0608
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Checkout Source
uses: actions/checkout@v4
- name: Run Gosec Security Scanner
uses: securego/[email protected].2
uses: securego/[email protected].3
with:
args: '-no-fail -fmt sarif -out results.sarif -tests ./...'
- name: Upload SARIF file
Expand All @@ -42,7 +42,6 @@ jobs:
- id: govulncheck
uses: golang/[email protected]
with:
govulncheck-action: go.mod
output-format: sarif
output-file: results.sarif
- name: Fix SARIF format
Expand Down
4 changes: 2 additions & 2 deletions container.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"syscall"
"time"

"github.com/docker/docker/api/types"
typesContainer "github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/events"
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/client"
"ldddns.arnested.dk/internal/container"
Expand Down Expand Up @@ -126,7 +126,7 @@ func listen(ctx context.Context, config Config, docker *client.Client, egs *entr
filter.Add("event", "start")
filter.Add("event", "unpause")

msgs, errs := docker.Events(ctx, types.EventsOptions{
msgs, errs := docker.Events(ctx, events.ListOptions{
Filters: filter,
Since: strconv.FormatInt(started.Unix(), 10),
Until: "",
Expand Down
7 changes: 7 additions & 0 deletions internal/container/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ func (c Container) Services() map[string]uint16 {
continue
}

//nolint:mnd,gomnd
if portNumber > 65535 {
log.Logf(log.PriErr, "Port number %d is too large", portNumber)

continue
}

service := netdb.GetServByPort(int(portNumber), proto)

if service == nil || proto == nil {
Expand Down
5 changes: 2 additions & 3 deletions internal/hostname/hostname_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,9 @@ func TestRewriteHostname(t *testing.T) {
}

for _, tt := range testdata {
tt := tt
t.Run(tt.in, func(t *testing.T) {
t.Logf("%q %q\n", tt.in, tt.out)
t.Parallel()

if s := hostname.RewriteHostname(tt.in); s != tt.out {
t.Errorf("got %q from %q, want %q", s, tt.in, tt.out)
}
Expand All @@ -130,7 +129,7 @@ func FuzzRewriteHostname(f *testing.F) {
f.Add("blåbærgrød")
f.Add("xn--blbrgrd-fxak7p.local")

f.Fuzz(func(t *testing.T, a string) {
f.Fuzz(func(_ *testing.T, a string) {
hostname.RewriteHostname(a)
})
}

0 comments on commit 59c0608

Please sign in to comment.