我的linux是CentOS7。
当我与非根用户一起运行Elastic Audit节拍时,它会显示以下错误:
ERROR instance/beat.go:877 Exiting: 1 error: 1 error: failed to create audit client: failed to get audit status: operation not permitted
Exiting: 1 error: 1 error: failed to create audit client: failed to get audit status: operation not permitted` 因此,我检查了这个过程所缺少的功能。
strace ./auditbeat -c 1 localhost 2>&1 _ grep EPERM,它显示:
epoll_ctl(4, EPOLL_CTL_ADD, 3, {EPOLLIN|EPOLLOUT|EPOLLRDHUP|EPOLLET, {u32=66785192, u64=140471267168168}}) = -1 EPERM (Operation not permitted)
epoll_ctl(4, EPOLL_CTL_DEL, 3, {0, {u32=0, u64=0}}) = -1 EPERM (Operation not permitted)通过这个CAP_BLOCK_SUSPEND,我发现缺乏功能的是文档。
但是,当我运行命令setcap cap_block_suspend=ep auditbeat时,它会显示:
fatal error: Invalid argument
usage: setcap [-q] [-v] (-r|-|<caps>) <filename> [ ... (-r|-|<capsN>) <filenameN> ]
Note <filename> must be a regular (non-symlink) file.而auditbeat只是一个常规文件。
[usr@linuxhost auditbeat-7.2.0-linux-x86_64]$ stat auditbeat
File: ‘auditbeat’
Size: 70418699 Blocks: 137544 IO Block: 4096 regular file
Device: pasef/17006b Inode: 410084318 Links: 1
Access: (0755/-rwxr-xr-x) Uid: ( 1004/ usr ) Gid: ( 1004/ usr )
Access: 2019-08- 0:39:29.160306947 +000
Modify: 2019-06-20 23:04:01.000000000 +000
Change: 2019-08- 0:39:06.226434256 +000
Birth: -我怎么能解决呢?
谢谢。
发布于 2021-02-02 01:37:51
我也有同样的问题。我的问题之所以发生,是因为我所处理的文件位于一个挂载的文件系统中。我将文件复制到/tmp,在/tmp文件上运行setcap,然后创建一个从/tmp返回到原始位置的符号链接,从而解决了这个问题。
https://stackoverflow.com/questions/57566048
复制相似问题