Configure SAST in .gitlab-ci.yml, creating this file if it does not already exist

This commit is contained in:
Phil 2022-01-07 20:25:28 +01:00
parent 6c69d3aae7
commit 33a4a36ee4

View file

@ -1,13 +1,15 @@
# You can override the included template(s) by including variable overrides
# SAST customization: https://docs.gitlab.com/ee/user/application_security/sast/#customizing-the-sast-settings
# Secret Detection customization: https://docs.gitlab.com/ee/user/application_security/secret_detection/#customizing-settings
# Dependency Scanning customization: https://docs.gitlab.com/ee/user/application_security/dependency_scanning/#customizing-the-dependency-scanning-settings
# Note that environment variables can be set in several places
# See https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedence
variables: variables:
REPO_NAME: git.ucode.space/Phil/goshorly REPO_NAME: git.ucode.space/Phil/goshorly
DOCKER_BUILDKIT: 1 DOCKER_BUILDKIT: 1
stages: stages:
- test - test
- build - build
format: format:
image: golang:latest image: golang:latest
stage: test stage: test
@ -19,7 +21,6 @@ format:
- go fmt $(go list ./... | grep -v /vendor/) - go fmt $(go list ./... | grep -v /vendor/)
- go vet $(go list ./... | grep -v /vendor/) - go vet $(go list ./... | grep -v /vendor/)
- go test -race $(go list ./... | grep -v /vendor/) - go test -race $(go list ./... | grep -v /vendor/)
gosec: gosec:
image: golang:latest image: golang:latest
before_script: before_script:
@ -30,7 +31,6 @@ gosec:
- go install github.com/securego/gosec/v2/cmd/gosec@latest - go install github.com/securego/gosec/v2/cmd/gosec@latest
- go get -v -d . - go get -v -d .
- gosec ./... - gosec ./...
docker-build-prod-latest: docker-build-prod-latest:
image: ezkrg/buildx image: ezkrg/buildx
stage: build stage: build
@ -48,7 +48,6 @@ docker-build-prod-latest:
. .
only: only:
- main - main
docker-build-MR-dry-run: docker-build-MR-dry-run:
image: docker:latest image: docker:latest
stage: build stage: build
@ -66,3 +65,7 @@ docker-build-MR-dry-run:
- docker build --pull -t "$CI_REGISTRY_IMAGE${tag}" . - docker build --pull -t "$CI_REGISTRY_IMAGE${tag}" .
only: only:
- merge_requests - merge_requests
sast:
stage: test
include:
- template: Security/SAST.gitlab-ci.yml