我正在使用 SELINUX=enforcing 在 CentOS 上设置 Nagios 核心。
我试着跑
chcon -R -t httpd_sys_content_t /usr/local/nagios/sbin/
Run Code Online (Sandbox Code Playgroud)
按照手册中的建议,但我收到此错误消息:
chcon: can't apply partial context to unlabeled file `cmd.cgi'
chcon: can't apply partial context to unlabeled file `trends.cgi'
chcon: can't apply partial context to unlabeled file `histogram.cgi'
chcon: can't apply partial context to unlabeled file `avail.cgi'
chcon: can't apply partial context to unlabeled file `history.cgi'
chcon: can't apply partial context to unlabeled file `status.cgi'
chcon: can't apply partial context to unlabeled file `tac.cgi'
chcon: …
Run Code Online (Sandbox Code Playgroud) 我注意到命令 setsebool 比其他 linux 命令花费更长的时间。如:
setsebool -P ftp_home_dir ON
Run Code Online (Sandbox Code Playgroud)
出于好奇,我想知道为什么“setsebool”命令需要这么长时间才能完成任务?
我正在使用服务器通过NGINX使用php-fpm写入NFS 类型的挂载点。在第一步,它向我显示以下错误:
2017/01/16 11:32:59 [error] 55463#0: *22 FastCGI sent in stderr: "PHP message: PHP Warning: mkdir(): Permission denied in /var/www/html/x/x.php on line 75
PHP message: PHP Warning: mkdir(): Permission denied in /x/x/x/x/x.php on line 79
PHP message: PHP Warning: mkdir(): Permission denied in /x/x/x/x/x.php on line 83
PHP message: PHP Warning: mkdir(): Permission denied in /x/x/x/x/x.php on line 87
PHP message: PHP Warning: mkdir(): Permission denied in /x/x/x/x/x.php on line 91
PHP message: PHP …
Run Code Online (Sandbox Code Playgroud) linux系统下是否可以为某些用户组配置进程隐藏?
例如: 来自组 X 的用户不应在 ps/top 或 /proc 下看到来自组 Y 的用户拥有的进程。
是否可以使用 SELinux 配置这样的设置?
(我依稀记得有趣的 grsecurity 补丁集中有一个类似的功能——但 IIRC,它更通用——此外,我想配置一个股票 linux 发行版而不必维护自定义内核。)
编辑:为了更好地说明,Solaris 10 有一个类似的特性。这个例子不是那么通用,但可以配置一个用户或一些用户只能在 ps 等中看到自己进程的信息。
我在 CentOS 6.2 上,并且有一个文件,其中备用访问方法字符显示为一个点。
ls -l myfile
-rwxr-x---. 1 me mygroup 172 Aug 13 10:03 myfile
^
This dot.
Run Code Online (Sandbox Code Playgroud)
从显示为 ls 的帮助信息 coreutils 'ls invocation'
Following the file mode bits is a single character that specifies
whether an alternate access method such as an access control list
applies to the file. When the character following the file mode
bits is a space, there is no alternate access method. When it is
a printing character, then there is …
Run Code Online (Sandbox Code Playgroud) 我有一个守护进程,它使用 syslog(3) 登录到一个不是 /var/log 后代的文件。目前,这需要禁用 SELINUX。如何配置启用的 SELINUX 以允许此日志记录?
我是 SELINUX 新手。任何指导或建议将不胜感激。
我在新 VM 上安装了 anaconda,但无法列出其内容。我可以将我的目录更改为 .../anaconda/ 但当我输入时,ls -l
我得到:
ls: cannot open directory .: Permission denied
Run Code Online (Sandbox Code Playgroud)
但是,当我输入时:
sudo ls -l
Run Code Online (Sandbox Code Playgroud)
我得到
total 92
drwxrwxrwx. 2 gcw8 PosixUsers 12288 May 26 15:30 bin
drwxrwxrwx. 2 gcw8 PosixUsers 12288 May 26 15:30 conda-meta
drwxrwxrwx. 3 gcw8 PosixUsers 4096 Mar 27 16:33 docs
drwxrwxrwx. 2 gcw8 PosixUsers 4096 Mar 27 16:33 envs
drwxrwxrwx. 2 gcw8 PosixUsers 4096 Mar 27 16:33 etc
drwxrwxrwx. 6 gcw8 PosixUsers 4096 May 26 15:19 Examples
drwxrwxrwx. 41 gcw8 …
Run Code Online (Sandbox Code Playgroud) 我有一个守护进程(apache/samba/vsftpd/...)在启用 SELinux 的系统上运行,我需要允许它在非默认位置使用文件。标准文件权限配置为允许访问。
如果守护程序以许可模式运行,则一切正常。当设置回强制执行时,它不再起作用,并且我收到一条SELinux AVC 拒绝消息。
如何配置系统以允许在强制模式下访问?
我有一个在 Docker 容器内运行的程序,它加载一个 .so 文件,该文件通过挂钩和内存操作来改变程序的行为。此行为被 SELinux 阻止,并在审核日志中显示以下消息:
type=AVC msg=audit(1548166862.066:2419): avc: 拒绝 { execheap } for pid=11171 comm="myProgram" scontext=system_u:system_r:container_t:s0:c426,c629 tcontext=:system_containr_system c426,c629 tclass=进程许可=0
我非常犹豫是否要完成此操作,audit2allow
因为我不想在其他任何地方允许这种特定行为(因为那会非常冒险)。
由于我最近在 Ubuntu 上更新了基于 snap 的 Firefox,因此每当某个应用程序绘制画布时,我都会看到它向日志报告 SECCOMP_RET_TRAP 消息。
由于绘制画布的应用程序通常以每秒 30 帧的速度进行绘制,因此日志中会填充大量无用的垃圾邮件,而且实际上还会消耗大量 CPU 使用率。
我能挖掘到的是,这种行为以前曾被报道过,但双方都试图推卸责任,然后又回到了简单的“不会修复”。(https://bugzilla.mozilla.org/show_bug.cgi?id=1465152,https://bugzilla.redhat.com/show_bug.cgi?id=1507282,https://linux-audit.redhat.narkive.com /BnWpkAXa/limiting-seccomp-audit-events)
那么,如何才能防止日志中充斥着无用的“浏览器中已绘制了画布!哦,快跑寻求帮助”消息呢?是否有一些配置可以过滤特定的 SECCOMP 消息,或者更好:阻止 Firefox 生成这些消息?
(补充:样品线
Sep 13 16:01:48 MYHOST audit[97745]: SECCOMP auid=1000 uid=1000 gid=1000 ses=3 subj=? pid=97745 comm="CanvasRenderer" exe="/snap/firefox/1775/usr/lib/firefox/firefox" sig=0 arch=c000003e syscall=312 compat=0 ip=0x7f48ae38573d code=0x50000
)
编辑:我不想
我想通过配置以可重现的方式降低/关闭垃圾邮件,因此遇到相同问题的每个人都可以应用该解决方案。例如,删除与特定“comm”字段值匹配的消息。