Skip to content
GitLab
探索
项目
群组
代码片段
项目
群组
代码片段
/
帮助
帮助
支持
社区论坛
快捷键
?
提交反馈
登录
切换导航
菜单
打开侧边栏
wazuh
Osquery
提交
e577a76b
提交
e577a76b
编辑于
7年前
作者:
Mitchell Grenier
提交者:
Teddy Reed
7年前
浏览文件
操作
下载
电子邮件补丁
差异文件
macOS - Listeners on folders that throw mount events (#3506)
上级
34a6cfe7
master
build_aarch64_run_tests
experimental
release/v5.2.3
5.3.0
5.2.3
5.2.2
5.2.1
5.2.0
5.1.0
5.0.1
5.0.0
4.9.0
4.8.0
4.7.0
4.6.0
4.5.1
4.5.0
4.4.0
4.3.0
4.2.0
4.1.2
4.1.1
4.1.0
4.0.2
4.0.1
4.0.0
3.4.0
3.3.2
3.3.1
3.3.0
3.2.9
3.2.8
3.2.7
3.2.6
3.2.5
3.2.4
3.2.3
3.2.2
3.2.1
3.2.0
3.1.0
3.0.0
2.11.2
2.11.1
2.11.0
2.10.4
2.10.3
2.10.2
2.10.1
2.10.0
2.9.2
2.9.1
2.9.0
2.8.1
2.8.0
2.7.0
2.6.1
无相关合并请求
变更
2
隐藏空白变更内容
行内
左右并排
显示
2 个更改的文件
osquery/events/darwin/fsevents.cpp
+9
-0
osquery/events/darwin/fsevents.cpp
osquery/tables/events/darwin/file_events.cpp
+16
-1
osquery/tables/events/darwin/file_events.cpp
有
25 个添加
和
1 个删除
+25
-1
osquery/events/darwin/fsevents.cpp
+
9
-
0
浏览文件 @
e577a76b
...
...
@@ -254,6 +254,15 @@ void FSEventsEventPublisher::Callback(
// Should remove the watch on this path.
}
if
(
ec
->
fsevent_flags
&
kFSEventStreamEventFlagMount
)
{
auto
mc
=
std
::
make_shared
<
FSEventsSubscriptionContext
>
();
mc
->
path
=
ec
->
path
+
"/*"
;
auto
subscription
=
Subscription
::
create
(
"file_events"
,
mc
);
auto
status
=
EventFactory
::
addSubscription
(
"fsevents"
,
subscription
);
auto
pub
=
EventFactory
::
getEventPublisher
(
"fsevents"
);
pub
->
configure
();
}
// Record the string-version of the first matched mask bit.
bool
has_action
=
false
;
for
(
const
auto
&
action
:
kMaskActions
)
{
...
...
This diff is collapsed.
Click to expand it.
osquery/tables/events/darwin/file_events.cpp
+
16
-
1
浏览文件 @
e577a76b
...
...
@@ -8,8 +8,9 @@
*
*/
#include
<
vector
>
#include
<
future
>
#include
<string>
#include
<vector>
#include
<osquery/core.h>
#include
<osquery/config.h>
...
...
@@ -81,6 +82,20 @@ Status FileEventSubscriber::Callback(const FSEventsEventContextRef& ec,
return
Status
(
0
);
}
// Need to call configure on the publisher, not the subscriber
if
(
ec
->
fsevent_flags
&
kFSEventStreamEventFlagMount
)
{
// Should we add listening to the mount point
auto
subscriber
=
([
this
,
&
ec
]()
{
auto
msc
=
createSubscriptionContext
();
msc
->
path
=
ec
->
path
+
"/*"
;
msc
->
category
=
"tmp"
;
return
subscribe
(
&
FileEventSubscriber
::
Callback
,
msc
);
});
std
::
packaged_task
<
void
()
>
task
(
std
::
move
(
subscriber
));
auto
result
=
task
.
get_future
();
std
::
thread
(
std
::
move
(
task
)).
detach
();
}
Row
r
;
r
[
"action"
]
=
ec
->
action
;
r
[
"target_path"
]
=
ec
->
path
;
...
...
This diff is collapsed.
Click to expand it.
编辑
预览
支持
Markdown
0%
请重试
或
添加新附件
.
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录
菜单
探索
项目
群组
代码片段