Skip to content

Commit

Permalink
Adapt pipeline_definitions to include SAST linting logs in OCM descri…
Browse files Browse the repository at this point in the history
…ptor (#959)

* Add newline at the end of files

* Adapt pipeline_definitions to include SAST linting logs in OCM descriptor
  • Loading branch information
thiyyakat authored Jan 17, 2025
1 parent f733669 commit 20acd80
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 4 deletions.
17 changes: 17 additions & 0 deletions .ci/pipeline_definitions
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
machine-controller-manager:
base_definition:
repo:
source_labels:
- name: cloud.gardener.cnudie/dso/scanning-hints/source_analysis/v1
value:
policy: skip
comment: |
we use gosec for sast scanning. See attached log.
traits:
version:
preprocess:
Expand Down Expand Up @@ -55,6 +62,16 @@ machine-controller-manager:
ocm_repository: europe-docker.pkg.dev/gardener-project/releases
release:
nextversion: 'bump_minor'
assets:
- type: build-step-log
step_name: check
purposes:
- lint
- sast
- gosec
comment: |
we use gosec (linter) for SAST scans
see: https://github.com/securego/gosec
publish:
dockerimages:
machine-controller-manager:
Expand Down
2 changes: 1 addition & 1 deletion hack/add_license_headers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ addlicense \
-ignore "**/*.md" \
-ignore "**/*.yaml" \
-ignore "**/Dockerfile" \
.
.
2 changes: 1 addition & 1 deletion hack/sast.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ fi
# Thus, generated code is excluded from gosec scan.
# Nested go modules are not supported by gosec (see https://github.com/securego/gosec/issues/501), so the ./hack folder
# is excluded too. It does not contain productive code anyway.
gosec -exclude-generated -exclude-dir=hack $gosec_report_parse_flags ./...
gosec -exclude-generated -exclude-dir=hack $gosec_report_parse_flags ./...
2 changes: 1 addition & 1 deletion hack/tools.mk
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ $(GOLANGCI_LINT): $(TOOLS_BIN_DIR)
GOBIN=$(abspath $(TOOLS_BIN_DIR)) go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)

$(GOSEC):
GOSEC_VERSION=$(GOSEC_VERSION) bash $(TOOLS_PKG_PATH)/install-gosec.sh
GOSEC_VERSION=$(GOSEC_VERSION) bash $(TOOLS_PKG_PATH)/install-gosec.sh
2 changes: 1 addition & 1 deletion hack/tools/install-gosec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ curl -L -o ${temp_dir}/${file_name} "https://github.com/securego/gosec/releases/

tar -xzm -C "${temp_dir}" -f "${temp_dir}/${file_name}"
mv "${temp_dir}/gosec" $TOOLS_BIN_DIR
chmod +x $TOOLS_BIN_DIR/gosec
chmod +x $TOOLS_BIN_DIR/gosec

0 comments on commit 20acd80

Please sign in to comment.