-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Change logger_mode flag to be actually interpreted as an octal #7273
Change logger_mode flag to be actually interpreted as an octal #7273
Conversation
The logger_mode flag was actually interpreted as decimal format number, not octal. Now the flag is actually a string and is expected to represent an octal number. A validation function has been added to prevent invalid permission modes and the flag itself is expected to be given at osquery startup only, not changed during the execution.
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.
<3
Do we need tests?
The test is present (it's what it's making the CI fail) and I forgot to update it (since it still passes the mode as an integer in decimal format). tryTo is not considering a failure when it's not converting the whole string to a number, because the underlying standard function stops at the first non digit number, and since python transforms 0754 -> "0o754", you always get 0. |
Co-authored-by: seph <seph@kolide.co>
I wasn't sure if there should be a c++ test for Code seems fine to me. I'll give one of the c++ folks a chance to review, though I think we can do this by 5.0 |
…1 to master * commit 'f72b7c5510b8cd78c9d0450cbd1f31903681caa5': (53 commits) Add `TimeoutStopSec` to systemd unit files (osquery#7190) Prevent osquery from killing itself when the --force flag is used (osquery#7295) Linux: Support AF_PACKET sockets. (osquery#7282) libs: update openssl to 1.1.1l (osquery#7293) Correct macOS installed app bundle path in osqueryctl and doc (osquery#7289) macos path fix in launchd plist (osquery#7288) Update osquery installed artifacts default paths in code (osquery#7285) Update osquery installed artifacts paths in the documentation (osquery#7286) Update packaging SHA (osquery#7279) Change to the `disk_encryption` table to support QueryContext (osquery#7209) Add feature to skip denylist for event-based queries (osquery#7158) Support pid_with_namespace in more tables (osquery#7132) audit: socket_events improvements (osquery#7269) [linux][packaging] Update packaging paths (osquery#7271) Change logger_mode flag to be actually interpreted as an octal (osquery#7273) Update `uptime` table descrption (osquery#7270) [macOS][packaging] Create an app bundle along with other package_data (osquery#7263) Add case sensitive pragma to the pragma/actions authorizer allow list (osquery#7267) Fix audit rule removal upon osquery exit (osquery#7221) Fix osquery_info build_platform column value on Linux (osquery#7254) ...
The logger_mode flag was actually interpreted as decimal format number,
not octal.
Now the flag is actually a string and is expected to represent an octal
number.
A validation function has been added to prevent invalid permission modes and
the flag itself is expected to be given at osquery startup only,
not changed during the execution.
This supersedes #7193