-
Notifications
You must be signed in to change notification settings - Fork 356
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Problem: missing additional static analysis scans (#862)
Solution: added semgrep and gosec
- Loading branch information
Showing
2 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Run Gosec | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
- release/** | ||
|
||
jobs: | ||
Gosec: | ||
runs-on: ubuntu-latest | ||
env: | ||
GO111MODULE: on | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- uses: technote-space/get-diff-action@v3 | ||
with: | ||
SUFFIX_FILTER: | | ||
.go | ||
.mod | ||
.sum | ||
- name: Run Gosec Security Scanner | ||
uses: informalsystems/gosec@master | ||
with: | ||
# we let the report trigger content trigger a failure using the GitHub Security features. | ||
args: '-no-fail -fmt sarif -out results.sarif ./...' | ||
if: "env.GIT_DIFF_FILTERED != ''" | ||
- name: Upload SARIF file | ||
uses: github/codeql-action/upload-sarif@v2 | ||
with: | ||
# Path to SARIF file relative to the root of the repository | ||
sarif_file: results.sarif | ||
if: "env.GIT_DIFF_FILTERED != ''" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Semgrep | ||
on: | ||
# Scan changed files in PRs, block on new issues only (existing issues ignored) | ||
pull_request: {} | ||
push: | ||
branches: | ||
- master | ||
- release/** | ||
paths: | ||
- .github/workflows/semgrep.yml | ||
schedule: | ||
- cron: '0 0 * * 0' | ||
jobs: | ||
# Update from: https://semgrep.dev/docs/semgrep-ci/sample-ci-configs/#github-actions | ||
semgrep: | ||
name: Scan | ||
runs-on: ubuntu-latest | ||
container: | ||
image: returntocorp/semgrep | ||
if: (github.actor != 'dependabot[bot]') | ||
steps: | ||
# Fetch project source with GitHub Actions Checkout. | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
# Run the "semgrep ci" command on the command line of the docker image. | ||
- run: semgrep ci | ||
env: | ||
# Add the rules that Semgrep uses by setting the SEMGREP_RULES environment variable. | ||
SEMGREP_RULES: p/golang # more at semgrep.dev/explore | ||
# Uncomment SEMGREP_TIMEOUT to set this job's timeout (in seconds): | ||
# Default timeout is 1800 seconds (30 minutes). | ||
# Set to 0 to disable the timeout. | ||
# SEMGREP_TIMEOUT: 300 |