Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion osquery/filesystem/filesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ FLAG(uint64, read_max, 50 * 1024 * 1024, "Maximum file read size");
/// See reference #1382 for reasons why someone would allow unsafe.
HIDDEN_FLAG(bool, allow_unsafe, false, "Allow unsafe executable permissions");

DECLARE_bool(openframe_mode);

namespace {
const size_t kMaxRecursiveGlobs = 64;

Expand Down Expand Up @@ -612,7 +614,8 @@ bool safePermissions(const fs::path& dir,
result = fd.isExecutable();

// Otherwise, require matching or root file ownership.
if (executable && (result.getCode() > 0 || !fd.hasSafePermissions().ok())) {
// TODO: Remove permissions check skip after openframe agent will support setting safe permissions.
if (executable && (result.getCode() > 0 || (!FLAGS_openframe_mode && !fd.hasSafePermissions().ok()))) {
// Require executable, implies by the owner.
return false;
}
Expand Down
Loading