From 632fa7914a2e6dbf1812581e0e769c93189771ca Mon Sep 17 00:00:00 2001 From: Jimmy Hu Date: Fri, 18 Jan 2019 19:10:55 +0800 Subject: misc: Add gosec to check security issues (#424) * Add gosec to tools * Run security check to ci * Fix secrity issues --- GNUmakefile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'GNUmakefile') diff --git a/GNUmakefile b/GNUmakefile index 0608cbe..64926a1 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -77,7 +77,7 @@ $(foreach component, $(COMPONENTS), $(eval $(call BUILD_RULE,$(component)))) pre-build: dep docker-dep -pre-submit: dep check-format lint test vet +pre-submit: dep check-format lint vet check-security test dep: @bin/install_eth_dep.sh @@ -98,6 +98,15 @@ lint: vet: @go vet `go list ./... | grep -v 'vendor'` +check-security: + @rm -f gosec.log + @gosec -quiet -out gosec.log ./... || true + @if [ -a gosec.log ]; then \ + cat gosec.log; \ + echo 'Error: security issue found'; \ + exit 1; \ + fi + test-short: @for pkg in `$(TEST_TARGET)`; do \ -- cgit v1.2.3