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

remove global exclusion for G108,G114 and add nosec in code #404

Merged
merged 1 commit into from
Apr 5, 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
2 changes: 1 addition & 1 deletion .github/workflows/presubmit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,5 @@ jobs:
- name: Install `gosec`
run: go install github.com/securego/gosec/v2/cmd/gosec@latest
- name: Run Gosec Security Scanner
run: ~/go/bin/gosec -exclude-dir test -exclude-generated -severity medium -exclude=G108,G114 ./...
run: ~/go/bin/gosec -exclude-dir test -exclude-generated -severity medium ./...

5 changes: 2 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"flag"
"fmt"
"net/http"
_ "net/http/pprof"
_ "net/http/pprof" // #nosec G108
"os"
"time"

Expand Down Expand Up @@ -194,8 +194,7 @@ func main() {
if enableProfiling {
// To use the profiler - https://golang.org/pkg/net/http/pprof/
go func() {
setupLog.Info("starting profiler",
"error", http.ListenAndServe("localhost:6060", nil))
setupLog.Info("starting profiler", "error", http.ListenAndServe("localhost:6060", nil)) // #nosec G114
}()
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/resource/introspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (i *IntrospectHandler) Start(_ context.Context) error {
mux.HandleFunc(GetResourcesSummaryPath, i.ResourceSummaryHandler)

// Should this be a fatal error?
err := http.ListenAndServe(i.BindAddress, mux)
err := http.ListenAndServe(i.BindAddress, mux) // #nosec G114
if err != nil {
i.Log.Error(err, "failed to run introspect API")
}
Expand Down
Loading