Skip to content
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

Implement GOSec for security scanning Fix vulnerabilities #227

Merged
merged 4 commits into from
Oct 11, 2018
Merged

Implement GOSec for security scanning Fix vulnerabilities #227

merged 4 commits into from
Oct 11, 2018

Conversation

parrobe
Copy link
Member

@parrobe parrobe commented Oct 10, 2018

No description provided.

@parrobe parrobe requested a review from arthurbarr October 10, 2018 15:09
}
err = os.Remove(crlFile)
if err != nil {
log.Debugf("Error removing %s: %v", crlFile, err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these should be regular log messages, not debug ones. Also, in the case of removing files failing, maybe we should just fail.

@@ -25,6 +25,7 @@ import (

"github.com/ibm-messaging/mq-container/internal/logger"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/common/log"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the wrong log implementation to use.

f.Close()
stdin.Close()
err = f.Close()
if err != nil {

This comment was marked as resolved.

f.Close()
err = f.Close()
if err != nil {
log.Debugf("Unable to close mirror file handle: %v", err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normal log entry

os.Remove(mqsc)
err := os.Remove(mqsc)
if err != nil {
log.Debugf("Error removing file %s: %v", mqsc, err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log normally

// #nosec G204
err = syscall.Exec("/usr/local/bin/runmqserver", []string{"runmqserver"}, os.Environ())
if err != nil {
log.Debugf("Error replacing this process with runmqserver: %v", err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log normally

stdin.Close()
err = stdin.Close()
if err != nil {
log.Debugf("Error closing password stdin: %v", err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log normally

}
err = os.Remove(ks.Filename)
if err != nil {
log.Debugf("Error removing %s: %v", ks.Filename, err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log normally

stdin.Close()
err = f.Close()
if err != nil {
log.Debugf("Failed to close MQSC file handle: %v", err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log normally

@arthurbarr arthurbarr merged commit 78ce84b into ibm-messaging:master Oct 11, 2018
@parrobe parrobe deleted the gosec branch October 12, 2018 10:37
mirskifa pushed a commit that referenced this pull request Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants