-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Replace uses of os.Create with os2.Create within backup/restore workflows #17648
Conversation
…lows This abstracts this ever so slightly into a new `os2.Create` to replace usages of `os.Create` across packages. I didn't want to address every single use of `os.Create` within this PR, but ideally we'd review other uses and swap them to use this version. This prevents files from being created and written with world read/write privileges. I strongly don't think any of these cases, that behavior was intentional, rather implicit due to using `os.Create` which internally uses 0666 permissions. Fixes vitessio#17647 Signed-off-by: Matt Robenolt <[email protected]>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #17648 +/- ##
==========================================
- Coverage 67.76% 67.75% -0.01%
==========================================
Files 1586 1587 +1
Lines 255763 255772 +9
==========================================
- Hits 173315 173310 -5
- Misses 82448 82462 +14 ☔ View full report in Codecov by Sentry. |
This constricts from an os.ModePerm, which is 0777 down to 0770, similarly just dropping the world bits. Signed-off-by: Matt Robenolt <[email protected]>
This also provides sensible defaults without needing to utilize explicit file permissions. Signed-off-by: Matt Robenolt <[email protected]>
Signed-off-by: Matt Lord <[email protected]>
Signed-off-by: Matt Lord <[email protected]>
Signed-off-by: Matt Robenolt <[email protected]>
Signed-off-by: Matt Robenolt <[email protected]>
cee9409
to
2e53cbb
Compare
Signed-off-by: Matt Lord <[email protected]>
Signed-off-by: Matt Lord <[email protected]>
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.
Thanks, @mattrobenolt ! ❤️
Signed-off-by: Matt Lord <[email protected]>
This abstracts this ever so slightly into a new
os2.Create
to replace usages ofos.Create
across packages.I didn't want to address every single use of
os.Create
within this PR, but ideally we'd review other uses and swap them to use this version.This prevents files from being created and written with world read/write privileges. I strongly don't think any of these cases, that behavior was intentional, rather implicit due to using
os.Create
which internally uses 0666 permissions.Note
I think that this should be backported to all supported releases (back to v19 today) since it improves the product's security posture.
Related Issue(s)
Fixes #17647
Checklist
Deployment Notes