Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump securego/gosec from 2.21.2 to 2.21.3 #355

Merged
merged 4 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/gosec@v2.21.2
uses: securego/gosec@v2.21.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/govulncheck-action@v1.0.3
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 @@
"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 @@
filter.Add("event", "start")
filter.Add("event", "unpause")

msgs, errs := docker.Events(ctx, types.EventsOptions{
msgs, errs := docker.Events(ctx, events.ListOptions{

Check warning on line 129 in container.go

View check run for this annotation

Codecov / codecov/patch

container.go#L129

Added line #L129 was not covered by tests
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 @@
continue
}

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

Check warning on line 61 in internal/container/container.go

View check run for this annotation

Codecov / codecov/patch

internal/container/container.go#L61

Added line #L61 was not covered by tests

continue

Check warning on line 63 in internal/container/container.go

View check run for this annotation

Codecov / codecov/patch

internal/container/container.go#L63

Added line #L63 was not covered by tests
}

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)
})
}