Skip to content

Commit

Permalink
updates for gosec (#254)
Browse files Browse the repository at this point in the history
  • Loading branch information
delldubey authored Dec 4, 2023
1 parent f6b8c86 commit e888ff1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions csireverseproxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,9 @@ func (s *Server) Start() {
port := utils.GetListenAddress(s.Port)
handler := s.GetRevProxy().GetRouter()
server := http.Server{
Addr: port,
Handler: handler,
Addr: port,
Handler: handler,
ReadHeaderTimeout: 5 * time.Second,
}
go func() {
defer s.WaitGroup.Done()
Expand Down
2 changes: 2 additions & 0 deletions csireverseproxy/pkg/k8smock/k8smock.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"context"
"fmt"
"os"
"path/filepath"
"strconv"
"time"

Expand Down Expand Up @@ -107,6 +108,7 @@ func (mockUtils *MockUtils) GetCertFileFromSecretName(secretName string) (string
}

func (mockUtils *MockUtils) createFile(fileName string, data []byte) error {
fileName = filepath.Clean(fileName)
file, err := os.Create(fileName)
if err != nil {
return err
Expand Down
1 change: 1 addition & 0 deletions csireverseproxy/pkg/k8sutils/k8sutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ func (utils *K8sUtils) GetCredentialsFromSecret(secret *corev1.Secret) (*common.
}

func (utils *K8sUtils) createFile(fileName string, data []byte) error {
fileName = filepath.Clean(fileName)
file, err := os.Create(fileName)
if err != nil {
return err
Expand Down

0 comments on commit e888ff1

Please sign in to comment.