[SEC] Updated vul import libs. Adding automation for security checks on commit

This commit is contained in:
benduncan
2025-11-27 17:09:10 +11:00
parent 58d75102ca
commit 35769524e3
7 changed files with 1809 additions and 8 deletions
+5
View File
@@ -22,3 +22,8 @@ jobs:
- name: Run Tests
run: make test
- name: golang-govulncheck-action
uses: golang/govulncheck-action@v1.0.4
# - name: Security reports
# run: make security
+12
View File
@@ -25,6 +25,18 @@ Hive provides AWS API/SDK layer functionality, which requires the AWS CLI tool t
sudo apt install awscli
```
Confirm awscli version > 2.0 is installed which is required by Hive. If your OS package manager installed an older version, e.g 1.X, install the latest version of the AWS CLI tool directly.
[https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)
```bash
aws --version
```
```
aws-cli/2.32.4
```
## Build
Create the base directory for the Hive development environment.
+29 -1
View File
@@ -1,5 +1,17 @@
GO_PROJECT_NAME := hive
# Where to install Go tools
GOBIN ?= $(shell go env GOBIN)
ifeq ($(GOBIN),)
GOBIN := $(shell go env GOPATH)/bin
endif
GOVULNCHECK := $(GOBIN)/govulncheck
# Install govulncheck only if the binary is missing / out of date
$(GOVULNCHECK):
go install golang.org/x/vuln/cmd/govulncheck@latest
build:
$(MAKE) go_build
@@ -12,9 +24,10 @@ go_run:
@echo "\n....Running $(GO_PROJECT_NAME)...."
$(GOPATH)/bin/$(GO_PROJECT_NAME)
test:
test: $(GOVULNCHECK)
@echo "\n....Running tests for $(GO_PROJECT_NAME)...."
LOG_IGNORE=1 go test -v -timeout 120s ./...
$(GOVULNCHECK) ./...
bench:
@echo "\n....Running benchmarks for $(GO_PROJECT_NAME)...."
@@ -28,4 +41,19 @@ run:
clean:
rm ./bin/$(GO_PROJECT_NAME)
security:
@echo "\n....Running security checks for $(GO_PROJECT_NAME)...."
$(GOVULNCHECK) ./... > tests/govulncheck-report.txt
@echo "Govulncheck report saved to tests/govulncheck-report.txt"
gosec ./... > tests/gosec-report.txt
@echo "Gosec report saved to gosec-report.txt"
staticcheck ./... > tests/staticcheck-report.txt
@echo "Staticcheck report saved to tests/staticcheck-report.txt"
go vet ./... 2>&1 | tee tests/govet-report.txt
@echo "Go vet report saved to tests/govet-report.txt"
.PHONY: go_build go_run build run test clean
+3 -3
View File
@@ -4,7 +4,6 @@ go 1.25
require (
github.com/aws/aws-sdk-go v1.55.8
github.com/davecgh/go-spew v1.1.1
github.com/gofiber/fiber/v2 v2.52.9
github.com/google/uuid v1.6.0
github.com/kdomanski/iso9660 v0.4.0
@@ -12,6 +11,7 @@ require (
github.com/mulgadc/viperblock v0.1.2
github.com/nats-io/nats-server/v2 v2.11.6
github.com/nats-io/nats.go v1.43.0
github.com/pelletier/go-toml/v2 v2.2.4
github.com/pterm/pterm v0.12.82
github.com/spf13/cobra v1.9.1
github.com/spf13/viper v1.20.1
@@ -26,8 +26,9 @@ require (
atomicgo.dev/schedule v0.1.0 // indirect
github.com/andybalholm/brotli v1.1.1 // indirect
github.com/containerd/console v1.0.5 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fsnotify/fsnotify v1.8.0 // indirect
github.com/go-viper/mapstructure/v2 v2.2.1 // indirect
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
github.com/google/go-tpm v0.9.5 // indirect
github.com/gookit/color v1.5.4 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
@@ -42,7 +43,6 @@ require (
github.com/nats-io/jwt/v2 v2.7.4 // indirect
github.com/nats-io/nkeys v0.4.11 // indirect
github.com/nats-io/nuid v1.0.1 // indirect
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/sagikazarmark/locafero v0.7.0 // indirect
+2 -4
View File
@@ -33,8 +33,8 @@ github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHk
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M=
github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss=
github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
github.com/go-viper/mapstructure/v2 v2.4.0 h1:EBsztssimR/CONLSZZ04E8qAkxNYq4Qp9LvH92wZUgs=
github.com/go-viper/mapstructure/v2 v2.4.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
github.com/gofiber/fiber/v2 v2.52.9 h1:YjKl5DOiyP3j0mO61u3NTmK7or8GzzWzCFzkboyP5cw=
github.com/gofiber/fiber/v2 v2.52.9/go.mod h1:YEcBbO/FB+5M1IZNBP9FO3J9281zgPAreiI1oqg8nDw=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
@@ -85,8 +85,6 @@ github.com/minio/highwayhash v1.0.3 h1:kbnuUMoHYyVl7szWjSxJnxw11k2U709jqFPPmIUyD
github.com/minio/highwayhash v1.0.3/go.mod h1:GGYsuwP/fPD6Y9hMiXuapVvlIUEhFhMTh0rxU3ik1LQ=
github.com/mulgadc/predastore v0.1.5 h1:7SySkQQ5MQ1NTcKcB14pCUIJipq0YVgCJZeKM6ytrLM=
github.com/mulgadc/predastore v0.1.5/go.mod h1:BhMymRV3zMTu2S+5pJnNDDm5+AGakjhSc/PKX0q8Xfg=
github.com/mulgadc/viperblock v0.1.1 h1:R1DVX1S+/xPPMQ4LIFkwIX7Es+RS3Wgdd8bsWLTEvgY=
github.com/mulgadc/viperblock v0.1.1/go.mod h1:zCjdQ76fi2Qs2a5ign9A/Uqgbz77xts5WV0OR1be48I=
github.com/mulgadc/viperblock v0.1.2 h1:h5yAha2CIsSp/x7oPvqByqlsYzZYSLLim15AL1o7Dm0=
github.com/mulgadc/viperblock v0.1.2/go.mod h1:zCjdQ76fi2Qs2a5ign9A/Uqgbz77xts5WV0OR1be48I=
github.com/nats-io/jwt/v2 v2.7.4 h1:jXFuDDxs/GQjGDZGhNgH4tXzSUK6WQi2rsj4xmsNOtI=
File diff suppressed because it is too large Load Diff
+9
View File
@@ -0,0 +1,9 @@
=== Symbol Results ===
No vulnerabilities found.
Your code is affected by 0 vulnerabilities.
This scan also found 0 vulnerabilities in packages you import and 5
vulnerabilities in modules you require, but your code doesn't appear to call
these vulnerabilities.
Use '-show verbose' for more details.