diff --git a/.github/workflows/actions.yaml b/.github/workflows/actions.yaml index 9dee4a55..34369c56 100644 --- a/.github/workflows/actions.yaml +++ b/.github/workflows/actions.yaml @@ -18,6 +18,8 @@ jobs: go_security_scan: name: Run gosec runs-on: ubuntu-latest + env: + GO111MODULE: on steps: - name: Checkout the code uses: actions/checkout@v2 @@ -25,8 +27,12 @@ jobs: uses: dell/common-github-actions/gosec-runner@main with: directories: "./..." - excludes: "G108,G402" exclude-dir: "csireverseproxy" + proxy_go_security_scan: + name: Run gosec on reverseproxy + runs-on: ubuntu-latest + steps: + - run: make proxygosec malware_security_scan: name: Malware Scanner runs-on: ubuntu-latest diff --git a/Makefile b/Makefile index 321619fc..0a60605b 100644 --- a/Makefile +++ b/Makefile @@ -84,6 +84,15 @@ else endif @echo "Logs are stored at gosec.log, Outputfile at gosecresults.csv" +proxygosec: +ifeq (, $(shell which gosec)) + go install github.com/securego/gosec/v2/cmd/gosec@latest + $(shell cd csireverseproxy ; $(GOBIN)/gosec -quiet -log gosec.log -out=gosecresults.csv -fmt=csv ./...) +else + $(shell cd csireverseproxy ; gosec -quiet -log gosec.log -out=gosecresults.csv -fmt=csv ./...) +endif + @echo "Logs are stored at gosec.log, Outputfile at gosecresults.csv" + golint: ifeq (, $(shell which golint)) @{ \ diff --git a/csireverseproxy/Makefile b/csireverseproxy/Makefile index 7d518535..4fdd2ce1 100644 --- a/csireverseproxy/Makefile +++ b/csireverseproxy/Makefile @@ -39,3 +39,5 @@ docker-push: docker-build unit-test: go test -v -coverprofile c.out -coverpkg $(coverpackages) ./... +gosec: + gosec ./... \ No newline at end of file