From a6867c204e58270157a824aef3c76a9a9b25e2c0 Mon Sep 17 00:00:00 2001 From: David Juhasz Date: Wed, 18 Oct 2023 11:20:04 -0700 Subject: [PATCH] Add `make gosec` target to run a security scan - Add gosec target to Makefile - Fix duplicate -exclude-dir in gosec Github action --- .github/workflows/gosec.yml | 9 ++++++++- Makefile | 11 +++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gosec.yml b/.github/workflows/gosec.yml index 193003b6..227f214a 100644 --- a/.github/workflows/gosec.yml +++ b/.github/workflows/gosec.yml @@ -25,4 +25,11 @@ jobs: - name: Install Gosec Security Scanner run: go install github.com/securego/gosec/v2/cmd/gosec@latest - name: Run Gosec Security Scanner - run: gosec -exclude-dir=dashboard -exclude-dir=hack/ -exclude-dir=internal/api/gen -exclude-dir=internal/persistence/ent/db -exclude-dir=internal/persistence/ent/db ./... + run: > + gosec + -exclude-dir=dashboard + -exclude-dir=hack/ + -exclude-dir=internal/api/gen + -exclude-dir=internal/persistence/ent/db + -exclude-dir=internal/storage/persistence/ent/db + ./... diff --git a/Makefile b/Makefile index 4f9b93eb..086c0531 100644 --- a/Makefile +++ b/Makefile @@ -117,6 +117,17 @@ gen-ent: $(ENT) --feature sql/versioned-migration \ --target=./internal/storage/persistence/ent/db +gosec: # @HELP Run gosec security scanner +gosec: + go install github.com/securego/gosec/v2/cmd/gosec@latest + gosec \ + -exclude-dir=dashboard \ + -exclude-dir=hack \ + -exclude-dir=internal/api/gen \ + -exclude-dir=internal/persistence/ent/db \ + -exclude-dir=internal/storage/persistence/ent/db \ + ./... + tilt-trigger-internal: # @HELP Restart enduro-internal and wait until ready. tilt-trigger-internal: @tilt trigger enduro-internal