Skip to content

Commit 3fe3ff3

Browse files
committed
chore(ci): optimize pre-commit configuration
- Make semgrep security scan incremental by removing pass_filenames: false - Delay trivy and checkov security scans to pre-push stage
1 parent 1f7fb40 commit 3fe3ff3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,7 @@ repos:
791791
entry: bash -c 'if unirtm which trivy >/dev/null 2>&1; then exec unirtm exec -- trivy fs . --scanners vuln,misconfig,secret --skip-dirs internal/addlicense/testdata --db-repository public.ecr.aws/aquasecurity/trivy-db --java-db-repository public.ecr.aws/aquasecurity/trivy-java-db:1 --checks-bundle-repository public.ecr.aws/aquasecurity/trivy-checks --timeout 15m --exit-code 1 --severity HIGH,CRITICAL "$@"; else echo "Skipped trivy not found"; fi' --
792792
always_run: true
793793
pass_filenames: false
794+
stages: [manual, pre-push] # Skip in local pre-commit, run in CI or manually
794795
description: "Comprehensive security scan for vulnerabilities, misconfigurations, and secrets using Trivy."
795796

796797
- id: checkov
@@ -799,14 +800,13 @@ repos:
799800
entry: bash -c 'if unirtm which checkov >/dev/null 2>&1; then exec unirtm exec -- checkov --directory . --quiet --compact --soft-fail-on HIGH "$@"; else echo "Skipped checkov not found"; fi' --
800801
types_or: [yaml, dockerfile, terraform]
801802
pass_filenames: false
803+
stages: [manual, pre-push] # Skip in local pre-commit, run in CI or manually
802804
description: "Audit Infrastructure-as-Code (Terraform, K8s, Docker) for security best practices."
803805

804806
- id: semgrep
805807
name: semgrep security scan
806808
language: system
807809
entry: bash -c 'if unirtm which semgrep >/dev/null 2>&1; then exec unirtm exec -- semgrep scan --config auto --error --quiet "$@"; else echo "Skipped semgrep not found"; fi' --
808-
always_run: true
809-
pass_filenames: false
810810
description: "Multi-language static analysis for security, bugs, and best practices using Semgrep."
811811

812812
- id: bandit

0 commit comments

Comments
 (0)