Skip to content

Commit

Permalink
Local GoKart (#603)
Browse files Browse the repository at this point in the history
related to #600
I was looking to see if GoKArt is part of golang-ci - not at the moment.
I have added a make target gokart. Static analysis came out very well, no code changes needed.
GoKart is checking code including imported packages, see output:

```shell
Using config found at /Users/ab011th/.gokart/analyzers.yml

Revving engines VRMMM VRMMM
3...2...1...Go!

Race Complete! Analysis took 1.862020787s and 569 Go files were scanned (including imported packages)
GoKart found 0 potentially vulnerable functions
```

Signed-off-by: kuritka <kuritka@gmail.com>
  • Loading branch information
kuritka authored Sep 8, 2021
1 parent 20207ba commit 12611a4
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ LOG_FORMAT ?= simple
LOG_LEVEL ?= debug
CONTROLLER_GEN_VERSION ?= v0.4.1
GOLIC_VERSION ?= v0.5.0
GOKART_VERSION ?= v0.2.0
POD_NAMESPACE ?= k8gb
CLUSTER_GEO_TAG ?= eu
EXT_GSLB_CLUSTERS_GEO_TAGS ?= us
Expand Down Expand Up @@ -91,7 +92,7 @@ all: help

# check integrity
.PHONY: check
check: license lint test ## Check project integrity
check: license lint gokart test ## Check project integrity

.PHONY: clean-test-apps
clean-test-apps:
Expand Down Expand Up @@ -257,6 +258,12 @@ infoblox-secret:
--from-literal=EXTERNAL_DNS_INFOBLOX_WAPI_USERNAME=$${WAPI_USERNAME} \
--from-literal=EXTERNAL_DNS_INFOBLOX_WAPI_PASSWORD=$${WAPI_PASSWORD}

# GoKart - Go Security Static Analysis
# see: https://github.com/praetorian-inc/gokart
.PHONY: gokart
gokart:
$(call gokart,--globalsTainted --verbose)

# updates source code with license headers
.PHONY: license
license:
Expand Down Expand Up @@ -467,6 +474,11 @@ define controller-gen
$(GOBIN)/controller-gen $1
endef

define gokart
@go install github.com/praetorian-inc/gokart@$(GOKART_VERSION)
$(GOBIN)/gokart scan $1
endef

define golic
@go install github.com/AbsaOSS/golic@$(GOLIC_VERSION)
$(GOBIN)/golic inject $1
Expand Down

0 comments on commit 12611a4

Please sign in to comment.