Skip to content

Fix config-base health monitor on Windows - #1030

Open
foodprocessor wants to merge 6 commits into
mainfrom
fix-health-monitor-path
Open

Fix config-base health monitor on Windows#1030
foodprocessor wants to merge 6 commits into
mainfrom
fix-health-monitor-path

Conversation

@foodprocessor

Copy link
Copy Markdown
Contributor

Work harder to resolve cfusemon on the path, and disable monitoring correclty when it is not found.

@jfantinhardesty jfantinhardesty left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

var err error

// Ensure the output directory exists
if err := os.MkdirAll(hmcommon.OutputPath, 0755); err != nil {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Mend Code Security Check

New finding (1 of 2)

The Mend Code Security Check of your branch failed because of a Insecure Directory Permissions finding in this line.

SeverityVulnerability TypeCWEFileData FlowsDetected
HighInsecure Directory Permissions

CWE-732

stats_export.go:274

12026-08-26 08:43pm
Vulnerable Code

var fname string
var fnameNew string
var err error
// Ensure the output directory exists
if err := os.MkdirAll(hmcommon.OutputPath, 0755); err != nil {

1 Data Flow/s detected

if err := os.MkdirAll(hmcommon.OutputPath, 0755); err != nil {

Secure Code Warrior Training Material
Suppress Finding

To suppress this finding as a acceptable risk, comment:

/mend code suppress acceptable-risk a5352419-138e-4acd-a087-e5cd75a6b6e6 Optional Comment

To suppress this finding as a false positive, comment:

/mend code suppress false-positive a5352419-138e-4acd-a087-e5cd75a6b6e6 Optional Comment
💬 Discuss Finding

Add context or questions for the security reviewer by commenting on this issue:

/mend comment Your Message

Your message will appear in the Mend Platform for the security team to review.

Comment thread cmd/health-monitor.go
// This is important when running as a service where the child process may
// have more restrictive permissions than the parent.
if options.MonitorOpt.OutputPath != "" {
err := os.MkdirAll(options.MonitorOpt.OutputPath, 0755)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Mend Code Security Check

New finding (2 of 2)

The Mend Code Security Check of your branch failed because of a Insecure Directory Permissions finding in this line.

SeverityVulnerability TypeCWEFileData FlowsDetected
HighInsecure Directory Permissions

CWE-732

health-monitor.go:118

12026-08-26 11:25pm
Vulnerable Code

// Ensure the output directory exists before spawning the monitor subprocess.
// This is important when running as a service where the child process may
// have more restrictive permissions than the parent.
if options.MonitorOpt.OutputPath != "" {
err := os.MkdirAll(options.MonitorOpt.OutputPath, 0755)

1 Data Flow/s detected

err := os.MkdirAll(options.MonitorOpt.OutputPath, 0755)

Secure Code Warrior Training Material
Suppress Finding

To suppress this finding as a acceptable risk, comment:

/mend code suppress acceptable-risk 8d2f3ef3-b50a-4936-9549-96d832c88185 Optional Comment

To suppress this finding as a false positive, comment:

/mend code suppress false-positive 8d2f3ef3-b50a-4936-9549-96d832c88185 Optional Comment
💬 Discuss Finding

Add context or questions for the security reviewer by commenting on this issue:

/mend comment Your Message

Your message will appear in the Mend Platform for the security team to review.

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