Skip to content

Commit

Permalink
chore(gosec): update nosec based on latest gosec
Browse files Browse the repository at this point in the history
Ref kubearmor#1044

Remove the gosec exclude once we handle kubearmor#1464

Signed-off-by: daemon1024 <barun1024@gmail.com>
  • Loading branch information
daemon1024 committed Oct 18, 2023
1 parent c645789 commit 7da422a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion KubeArmor/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ ifeq (, $(shell which gosec))
rm -rf $$GOSEC_TMP_DIR ;\
}
endif
cd $(CURDIR); gosec ./...
cd $(CURDIR); gosec -exclude=G402 ./...

.PHONY: local-release
local-release: build
Expand Down
9 changes: 3 additions & 6 deletions KubeArmor/core/k8sHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -449,8 +449,7 @@ func (kh *K8sHandler) WatchK8sPods() *http.Response {
// kube-proxy (local)
URL := "http://" + kh.K8sHost + ":" + kh.K8sPort + "/api/v1/pods?watch=true"

// #nosec
if resp, err := http.Get(URL); err == nil {
if resp, err := http.Get(URL); err == nil /* #nosec */ {
return resp
}

Expand Down Expand Up @@ -529,8 +528,7 @@ func (kh *K8sHandler) WatchK8sSecurityPolicies() *http.Response {
// kube-proxy (local)
URL := "http://" + kh.K8sHost + ":" + kh.K8sPort + "/apis/security.kubearmor.com/v1/kubearmorpolicies?watch=true"

// #nosec
if resp, err := http.Get(URL); err == nil {
if resp, err := http.Get(URL); err == nil /* #nosec */ {
return resp
}

Expand Down Expand Up @@ -565,8 +563,7 @@ func (kh *K8sHandler) WatchK8sHostSecurityPolicies() *http.Response {
// kube-proxy (local)
URL := "http://" + kh.K8sHost + ":" + kh.K8sPort + "/apis/security.kubearmor.com/v1/kubearmorhostpolicies?watch=true"

// #nosec
if resp, err := http.Get(URL); err == nil {
if resp, err := http.Get(URL); err == nil /* #nosec */ {
return resp
}

Expand Down

0 comments on commit 7da422a

Please sign in to comment.