From dff7611cadc4a4d7a57dbdb2fbcf51e67ee22949 Mon Sep 17 00:00:00 2001 From: Karl Cardenas Date: Fri, 24 Feb 2023 15:31:26 -0700 Subject: [PATCH 1/2] fix: added maxgoproxs --- .github/workflows/gitleaks.yaml | 38 +++++++++++++++++++++++++++++++++ go.mod | 1 + go.sum | 2 ++ main.go | 1 + 4 files changed, 42 insertions(+) create mode 100644 .github/workflows/gitleaks.yaml diff --git a/.github/workflows/gitleaks.yaml b/.github/workflows/gitleaks.yaml new file mode 100644 index 0000000..f646270 --- /dev/null +++ b/.github/workflows/gitleaks.yaml @@ -0,0 +1,38 @@ +name: GitLeaks +on: [pull_request] + +concurrency: + group: gitleaks-${{ github.ref }} + cancel-in-progress: true + +jobs: + gitleaks-scan: + runs-on: ubuntu-latest + container: + image: gcr.io/spectro-common-dev/fayasa/bulwark:latest + env: + REPO: ${{ github.event.repository.name }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + credentials: + username: _json_key + password: ${{ secrets.GCR_SPCD_JSON_KEY }} + steps: + + - name: run-bulwark-gitleaks-scan + shell: sh + env: + BRANCH: ${{ github.head_ref || github.ref_name }} + run: /workspace/bulwark -name CodeSASTGitLeaks -target $REPO -tags "branch:$BRANCH,options:--log-opts origin..HEAD" + + - name: check-result + shell: sh + run: | + resultPath=./$REPO/gitleaks.json + cat $resultPath | grep -v \"Match\"\: | grep -v \"Secret\"\: + total_failed_tests=`cat $resultPath | grep \"Fingerprint\"\: | wc -l` + if [ "$total_failed_tests" -gt 0 ]; then + echo "GitLeaks validation check failed with above findings..." + exit 1 + else + echo "GitLeaks validation check passed" + fi \ No newline at end of file diff --git a/go.mod b/go.mod index f3d73a9..be7c554 100644 --- a/go.mod +++ b/go.mod @@ -7,6 +7,7 @@ require ( github.com/lib/pq v1.10.7 github.com/mileusna/useragent v1.2.1 github.com/rs/zerolog v1.28.0 + go.uber.org/automaxprocs v1.5.1 ) require ( diff --git a/go.sum b/go.sum index 69f2e29..06d00bc 100644 --- a/go.sum +++ b/go.sum @@ -19,6 +19,8 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.28.0 h1:MirSo27VyNi7RJYP3078AA1+Cyzd2GB66qy3aUHvsWY= github.com/rs/zerolog v1.28.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6usyD0= +go.uber.org/automaxprocs v1.5.1 h1:e1YG66Lrk73dn4qhg8WFSvhF0JuFQF0ERIp4rpuV8Qk= +go.uber.org/automaxprocs v1.5.1/go.mod h1:BF4eumQw0P9GtnuxxovUd06vwm1o18oMzFtK66vU6XU= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6 h1:foEbQz/B0Oz6YIqu/69kfXPYeFQAuuMYFkjaqXzl5Wo= golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/main.go b/main.go index 602ffec..08a1172 100644 --- a/main.go +++ b/main.go @@ -13,6 +13,7 @@ import ( "github.com/jmoiron/sqlx" _ "github.com/lib/pq" + _ "go.uber.org/automaxprocs" "spectrocloud.com/hello-universe-api/endpoints" "spectrocloud.com/hello-universe-api/internal" ) From 4053d7c763276ab66fa35399d80c415daa389454 Mon Sep 17 00:00:00 2001 From: Karl Cardenas Date: Fri, 24 Feb 2023 15:33:14 -0700 Subject: [PATCH 2/2] docs: readme update --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8c6ca89..bdf64f9 100644 --- a/README.md +++ b/README.md @@ -20,8 +20,8 @@ A Postman collection is available to help you explore the API. Review the [Postm The quickest method to start the API server locally is by using the Docker image. ```shell -docker pull ghcr.io/spectrocloud/hello-universe-api:1.0.6 -docker run -p 3000:3000 ghcr.io/spectrocloud/hello-universe-api:1.0.6 +docker pull ghcr.io/spectrocloud/hello-universe-api:1.0.7 +docker run -p 3000:3000 ghcr.io/spectrocloud/hello-universe-api:1.0.7 ``` To start the API server you must have connectivity to a postgres instance. Use [environment variables](#environment-variables) to customize the API server start parameters.