-
Notifications
You must be signed in to change notification settings - Fork 527
Introduce gosec
for Static Application Security Testing (SAST)
#9959
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
G101: Look for hard coded credentials
G404: Insecure random number source (rand)
G109: Potential Integer overflow made by strconv.Atoi result conversion to int16/32
G402: Look for bad TLS connection settings
G301: Poor file permissions used when creating a directory G306: Poor file permissions used when writing to a new file
G304: File path provided as taint input
G204: Audit use of command execution
G401: Detect the usage of DES, RC4, MD5 or SHA1 G505: Import blocklist: crypto/sha1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice, thanks!
Just one small comment 😉
/assign |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: LucaBernstein The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/hold |
/lgtm cancel If there are multiple reviewers, one can add |
* enable gosec for static code analysis as enabled by gardener/gardener#9959 * address G304 finding
How to categorize this PR?
/area compliance security
/kind enhancement
What this PR does / why we need it:
This PR introduces
gosec
for Static Application Security Testing at Gardener and should replace other code scanners.It uses the default ruleset of
gosec
with two exceptions../hack
folder is excluded, becausegosec
does not support nested go modules (like logcheck) and there is no productive code in this folder anyway.All findings based on these settings have been mitigated in this PR.
There are two new
make
targets.make sast
is supposed to be called in unit tests. It logs all finding to console and fails in case of errors.make sast-report
can be used in build pipelines. It fails on errors too. Additionally, it creates a report in sarif format to./gosec-report.sarif
file. This report also tracks suppressed findings.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
cc @ccwienk @ThormaehlenFred @dkistner
Release note: