-
Notifications
You must be signed in to change notification settings - Fork 20
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
Feature/static code security scanner #74
Feature/static code security scanner #74
Conversation
#fi | ||
#echo "done." | ||
|
||
#echo -n "Linting golang code... " |
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.
I want to enable formatting/linting in a separate PR since it will likely be a large diff that doesn't change any functionality.
…-code-security-scanner
@@ -70,6 +70,9 @@ type DeleteLeasesIDOK struct { | |||
} | |||
|
|||
func (o *DeleteLeasesIDOK) Error() string { | |||
/* | |||
#nosec: CWE-89 false positive. No sql here. |
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.
#nosec
is the syntax for annotating known gosec issues so that they don't cause the tool to fail.
@@ -40,6 +43,9 @@ func (u *AWSUtil) UploadDirectoryToS3(localPath string, bucket string, prefix st | |||
if err != nil { | |||
log.Fatalln("Unable to get relative path:", path, err) | |||
} | |||
/* | |||
#nosec CWE-22: added disclaimer to function docs |
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.
@joshmarsh can you explain how this works / what is does?
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.
Sorry, I though I added a comment explaining nosec, but I’m not seeing it anymore.
Adding a //#nosec comment causes gosec to skip the code that you commented.
Here are the docs: https://github.com/securego/gosec/blob/master/README.md#annotating-code
Proposed changes
gosec is a static code analysis tool that scans for known security vulnerabilities. This PR adds gosec to the pipeline and fixes some issues raised by the tool.
Example of gosec working in our pipeline
Types of changes
Checklist
README.md
, inline comments, etc.)CHANGELOG.md
under a## next
release, with a short summary of my changesRelevant Links
Further comments