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

The FileMode argument is explicitly set to an insecure value #3

Open
subpop opened this issue Sep 14, 2023 · 0 comments
Open

The FileMode argument is explicitly set to an insecure value #3

subpop opened this issue Sep 14, 2023 · 0 comments

Comments

@subpop
Copy link
Collaborator

subpop commented Sep 14, 2023

Running yggdrasil-worker-package-manager through a static analyzer resulting in some findings that could be fixed.

1. rhc/yggdrasil-worker-package-manager/util.go:50: insecure_file_permissions: The "FileMode" argument is explicitly set to an insecure value making the file world-readable, world-writeable or world-executeable.
2. rhc/yggdrasil-worker-package-manager/util.go:50: remediation: Set the "FileMode" argument to a value that forbids the world permission.
#    48|   		return ioutil.WriteFile(name, data, 0644)
#    49|   	} else {
#    50|-> 		file, err := os.OpenFile(name, os.O_WRONLY|os.O_APPEND, 0644)
#    51|   		if err != nil {
#    52|   			return fmt.Errorf("cannot open file for appending: %w", err)
1. rhc/yggdrasil-worker-package-manager/package_manager_apt.go:31: insecure_file_permissions: The "FileMode" argument is explicitly set to an insecure value making the file world-readable, world-writeable or world-executeable.
2. rhc/yggdrasil-worker-package-manager/package_manager_apt.go:31: remediation: Set the "FileMode" argument to a value that forbids the world permission.
#    29|   
#    30|   func (p *PackageManagerApt) EnableRepo(sourceLine string) (stdout, stderr []byte, code int, err error) {
#    31|-> 	if err := os.MkdirAll(filepath.Base(sourcesFile), 0755); err != nil {
#    32|   		return nil, nil, -1, fmt.Errorf("cannot create sources list directory: %w", err)
#    33|   	}
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

No branches or pull requests

1 participant