Skip to content

Feature/tiered storage - #1049

Draft
foodprocessor wants to merge 95 commits into
mainfrom
feature/tiered_storage
Draft

foodprocessor wants to merge 95 commits into
mainfrom
feature/tiered_storage

Conversation

@foodprocessor

Copy link
Copy Markdown
Contributor

Add tiered storage component.

jfantinhardesty and others added 30 commits May 27, 2026 10:57
… with no file attatched, also added some config path
if err != nil {
return err
}
err = os.MkdirAll(filepath.Dir(localPath), 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 (1 of 5)

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

tiered_storage.go:680

12026-09-10 10:35pm
Vulnerable Code

func (c *TieredStorage) downloadCopyFromCloud(options internal.OpenFileOptions) error {
localPath, err := c.localPath(options.Name)
if err != nil {
return err
}
err = os.MkdirAll(filepath.Dir(localPath), 0755)

1 Data Flow/s detected

err = os.MkdirAll(filepath.Dir(localPath), 0755)

Secure Code Warrior Training Material
Suppress Finding

To suppress this finding as a acceptable risk, comment:

/mend code suppress acceptable-risk 4dc813a7-848f-4f06-87c3-32a1d946c60b Optional Comment

To suppress this finding as a false positive, comment:

/mend code suppress false-positive 4dc813a7-848f-4f06-87c3-32a1d946c60b 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.

if c.tmpPath == "" || c.tmpPath == "." {
return fmt.Errorf("TieredStorage: path not set in config")
}
err = os.MkdirAll(c.tmpPath, 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 5)

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

tiered_storage.go:166

12026-09-10 10:35pm
Vulnerable Code

c.tmpPath = filepath.Clean(common.ExpandPath(conf.TmpPath))
if c.tmpPath == "" || c.tmpPath == "." {
return fmt.Errorf("TieredStorage: path not set in config")
}
err = os.MkdirAll(c.tmpPath, 0755)

1 Data Flow/s detected

err = os.MkdirAll(c.tmpPath, 0755)

Secure Code Warrior Training Material
Suppress Finding

To suppress this finding as a acceptable risk, comment:

/mend code suppress acceptable-risk 8f701251-0bc5-4d49-b319-2ff147f0edbf Optional Comment

To suppress this finding as a false positive, comment:

/mend code suppress false-positive 8f701251-0bc5-4d49-b319-2ff147f0edbf 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.

if !localExists {
return nil
}
if err := os.MkdirAll(filepath.Dir(dstPath), 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 (3 of 5)

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

tiered_storage.go:436

12026-09-10 10:35pm
Vulnerable Code

return cloudErr
}
if !localExists {
return nil
}
if err := os.MkdirAll(filepath.Dir(dstPath), 0755); err != nil {

1 Data Flow/s detected

if err := os.MkdirAll(filepath.Dir(dstPath), 0755); err != nil {

Secure Code Warrior Training Material
Suppress Finding

To suppress this finding as a acceptable risk, comment:

/mend code suppress acceptable-risk a49883f5-68f2-49b9-a4c4-f7dfffdb65ae Optional Comment

To suppress this finding as a false positive, comment:

/mend code suppress false-positive a49883f5-68f2-49b9-a4c4-f7dfffdb65ae 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.

localCopyNode.cloudBacked.Store(true)

if options.Flags&os.O_TRUNC != 0 {
if err := os.MkdirAll(filepath.Dir(localPath), 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 (4 of 5)

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

tiered_storage.go:610

12026-09-10 10:35pm
Vulnerable Code

localCopyNode := &FileNode{name: options.Name}
localCopyNode.size.Store(attrs.Size)
localCopyNode.cloudBacked.Store(true)
if options.Flags&os.O_TRUNC != 0 {
if err := os.MkdirAll(filepath.Dir(localPath), 0755); err != nil {

1 Data Flow/s detected

if err := os.MkdirAll(filepath.Dir(localPath), 0755); err != nil {

Secure Code Warrior Training Material
Suppress Finding

To suppress this finding as a acceptable risk, comment:

/mend code suppress acceptable-risk 323ec72e-fa6b-49ee-8ff5-778c5d375ac4 Optional Comment

To suppress this finding as a false positive, comment:

/mend code suppress false-positive 323ec72e-fa6b-49ee-8ff5-778c5d375ac4 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.

if err != nil {
return nil, err
}
err = os.MkdirAll(filepath.Dir(localPath), 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 (5 of 5)

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

tiered_storage.go:475

12026-09-10 10:35pm
Vulnerable Code

) (*handlemap.Handle, error) {
localPath, err := c.localPath(options.Name)
if err != nil {
return nil, err
}
err = os.MkdirAll(filepath.Dir(localPath), 0755)

1 Data Flow/s detected

err = os.MkdirAll(filepath.Dir(localPath), 0755)

Secure Code Warrior Training Material
Suppress Finding

To suppress this finding as a acceptable risk, comment:

/mend code suppress acceptable-risk 4ca0f66e-6c6c-427e-a016-10e002763fc9 Optional Comment

To suppress this finding as a false positive, comment:

/mend code suppress false-positive 4ca0f66e-6c6c-427e-a016-10e002763fc9 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.

3 participants