Articles of selinux

尝试设置布尔值时,SElinux进程被终止

我有一个奇怪的问题。 我不能让我的CentOC 6.4框的Apache连接到数据库: [root@centos6 ~]# setsebool -P httpd_can_network_connect on Killed [root@centos6 ~]# sestatus -b | grep httpd_can_network_connect httpd_can_network_connect off httpd_can_network_connect_cobbler off httpd_can_network_connect_db off 我看了日志文件,但是没有日志消息: tail -f /var/log/audit/audit.log 更新: /var/log/messages有一些信息: Nov 9 19:07:16 centos6 kernel: setsebool invoked oom-killer: gfp_mask=0x280da, order=0, oom_adj=0, oom_score_adj=0 Nov 9 19:07:16 centos6 kernel: setsebool cpuset=/ mems_allowed=0 Nov 9 19:07:16 centos6 kernel: Pid: […]

configurationSElinux以允许来自远程机器的rsync

我已经build立了一个与SElinux的Debian机器,除了从远程机器的rsync ,一切工作正常。 我已经使用audit2allow创build了一些具有额外权限的模块,现在审计日志中的所有错误都消失了。 当我尝试rsync到机器,但不幸的是,连接仍然是不允许的。 设置selinux宽容,一切都按预期工作。 我没有运行rsync作为守护进程,这通常会导致networking中的问题报告出现更多的问题。 rsync只是默认的Debian 7configuration。 远程rsync失败并显示以下消息: user1@othermachine:~$ rsync -vv servermachine:/home/user1/some/file . opening connection using: ssh servermachine rsync –server –sender -vve.Lsf . /home/user1/some/file rsync: connection unexpectedly closed (0 bytes received so far) [Receiver] rsync error: error in rsync protocol data stream (code 12) at io.c(605) [Receiver=3.0.9] 这是rsync的权限如何: root@host:~# ls -Z /usr/bin/rsync system_u:object_r:rsync_exec_t:SystemLow /usr/bin/rsync […]

Linux安全模块(LSM)在虚拟服务器(vServer)上运行吗?

我有一个从1und1 10欧元/月的vServer,我知道这不是一个专用的机器(这意味着我有更less的控制)。 我知道我可以使用一些系统作为根,但内核是不可接触的。 所以我想知道LSM是否可以使用? 因为我期望LSM是一个内核特性,在我看来,这样的LSM只有在内核被提供了特性的时候才可以使用,对吧? 也许给出这个推理的问题可以被分解成: 第1部分)是否总是不可能有一个vServer做一些LSM的东西? 第2部分)还是有时可能在这样的vServer上有apparmor / sellinux等? 甚至3)有没有一种方法可以检查内核中是否启用了LSM 如果问题不明确,请随时添加评论。 如果问题是错误的(即如果不能清楚地说出是否可能,请帮助我指出问题!) 最后但并非最不重要的,如果这个问题似乎不合适(即如果它应该在U&L SE)告诉我!

SELinux访问拒绝了由perl-cgi脚本触发的bash脚本的错误

我有一个自动化框架,使用Perl-CGI在服务器上运行脚本。 正如我们启用SELinux,当脚本尝试运行bash脚本时,我得到访问被拒绝的错误。 以下是我可以在脚本的audit.log中find的错误日志 type=AVC msg=audit(1397170377.265:109255): avc: denied { execute } for pid=23776 comm="run_step.sh" name="step.sh" dev=sda1 ino=795126 scontext=system_u:system_r:httpd_sys_script_t:s0 tcontext=system_u:object_r:httpd_sys_rw_content_t:s0 tclass=file type=AVC msg=audit(1397170377.265:109255): avc: denied { execute_no_trans } for pid=23776 comm="run_step.sh" path="/var/www/html/test/generated.5465/step.sh" dev=sda1 ino=795126 scontext=system_u:system_r:httpd_sys_script_t:s0 tcontext=system_u:object_r:httpd_sys_rw_content_t:s0 tclass=file 当我在宽容模式下设置SELinux时,我能够运行这些脚本,没有任何错误。 但是在执行的时候,我不能这样做。 此外,我已经设置了文件的httpd标签,但仍然得到这些错误。 任何想法如何解决它。

如何在CentOS上的audit.log中修复这个dovecot SELinux错误?

我在dovecot /var/log/audit/audit.log遇到了这些SELinux错误。 type=USER_AUTH msg=audit(1404794536.249:100679): user pid=28375 uid=0 auid=0 ses=2700 subj=unconfined_u:system_r:dovecot_auth_t:s0 msg='op=PAM:authentication acct="starrychloe" exe="/usr/libexec/dovecot/auth" hostname=99.99.99.99 addr=99.99.99.99 terminal=dovecot res=success' type=USER_ACCT msg=audit(1404794536.260:100680): user pid=28375 uid=0 auid=0 ses=2700 subj=unconfined_u:system_r:dovecot_auth_t:s0 msg='op=PAM:accounting acct="starrychloe" exe="/usr/libexec/dovecot/auth" hostname=99.99.99.99 addr=99.99.99.99 terminal=dovecot res=success' type=AVC msg=audit(1404794537.473:100681): avc: denied { read } for pid=30020 comm="imap" name="starrychloe" dev=xvde ino=152404 scontext=unconfined_u:system_r:dovecot_t:s0 tcontext=unconfined_u:object_r:home_root_t:s0 tclass=dir type=SYSCALL msg=audit(1404794537.473:100681): arch=c000003e syscall=2 success=no exit=-13 a0=7fc64f910eb0 […]

审计表示什么都不做,但木偶将不会运行SELinux强制执行

我决定让我的木偶大师与SELinux设置强制执行。 如果我放任它,它运行良好。 我在RHEL 7,systemd,apache2,乘客4和木偶3。 我已经使用审计日志和audit2allow通过了几遍,以制作覆盖审计日志的semodules。 (这是一个很大的混乱,乘客从apache模块运行,作为apache用户,执行木偶主代码。) 这是一个全新的configuration,所以puppet清单是一个默认的空节点,没有什么可做的。 如果我在远程计算机上运行“puppet agent -t”,它将成功执行setenforce 0.审计日志非常空。 (audit2allow报告“无事可做”。) 但是如果我把setenforce 1,我得到这些: Aug 20 23:14:28 puppet002 puppet-master[1544]: Permission denied – /etc/puppet/auth.conf Aug 20 23:14:29 puppet002 puppet-master[1544]: Permission denied – /etc/puppet/manifests/site.pp on node agentserver.example.com 我试过在/ etc / puppet / *上更改所有权,se上下文看起来很好: [root@puppet002 log]# cd /etc/puppet [root@puppet002 puppet]# ls -lZ -rw-r–r–. apache apache system_u:object_r:puppet_etc_t:s0 auth.conf -rw-r–r–. […]

svn:无法打开文件'/ var / www / svn / repo / db / txn-current-lock':权限被拒绝

在Fedora操作系统上,我有访问SVN Repo的问题,并通过HTTP提交。 这是我的configuration文件 /etc/httpd/conf.d/subversion.conf LoadModule dav_svn_module modules/mod_dav_svn.so LoadModule authz_svn_module modules/mod_authz_svn.so LoadModule dontdothat_module modules/mod_dontdothat.so <Location /svn> DAV svn SVNParentPath /var/www/svn SVNListParentPath On SVNPathAuthz Off AuthType Basic AuthName "myRepos" AuthUserFile /etc/svn-pass AuthzSVNAccessFile /etc/svn-authz Require valid-user </Location> 错误: 共享项目失败。 svn:无法打开文件'/ var / www / svn / repo / db / txn-current-lock':Permission deniedsvn: '/ svn / repo /!svn / […]

selinux,文件不匹配file_contexts.local

semanage fcontext -a -t puppet_etc_t "/etc/puppet/environments(/.*)?" cat /etc/selinux/targeted/contexts/files/file_contexts.local # This file is auto-generated by libsemanage # Do not edit directly. /etc/puppet/environments(/.*)? system_u:object_r:puppet_etc_t:s0 touch /etc/puppet/environments/hello1 ls -Z /etc/puppet/environments/hello1 -rw-r–r–. root root unconfined_u:object_r:puppet_etc_t:s0 /etc/puppet/environments/hello1 为什么这个文件创build为“unconfined_u”而不是“system_u”? 我怎样才能改变它? 谢谢。

nginx突然将所有内容redirect到403页,这可以debugging或跟踪?

我不知道我的nginx安装发生了什么事。 突然,所有的页面请求都被redirect到403页面。 昨天我试图添加一个用户代理来阻止,从这一点重新启动服务一切都被发送到403.我退出了这一变化,重新启动nginx ,一切仍然被导向到403页面。 即使我删除$http_user_agent和$http_referer if语句,一切仍然发送到403。 我甚至还从备份恢复整个nginx文件夹,我所有的页面请求继续被定向到403页面…. 不知道如何解决这个问题,conf文件回来干净。 有请求进来时,我可以为nginx做些什么? [root@soupcan nginx]# nginx -t nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful 这里是网站conf: server { listen 80; server_name localhost; #charset koi8-r; access_log /var/log/nginx/website1/access.log main; error_log /var/log/nginx/website1/error.log; root /srv/www/website1; ## Block http user agent – morpheus fucking scanner ## if […]

SELinux允许启用; httpd错误报告

我一直在apache / var / log / messages和其他许多相同的消息得到以下通知: kernel: type=1400 audit(1422862414.790:3222): avc: denied { getattr } for pid=2484 comm="deliver" path="/var/panel/sieve/globalfilter.sieve" dev=dm-0 ino=659172 scontext=system_u:system_r:dovecot_deliver_t:s0 tcontext=system_u:object_r:var_t:s0 tclass=lnk_file Kernel : type=1400 audit(1422862549.898:3244): avc: denied { getattr } for pid=2320 comm="httpd" path="/var/panel/hostdata/admin/public_html/Mywebsite_com$$ai_com/admin/ajax.php" dev=dm-0 ino=5625763 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:var_t:s0 tclass=file kernel: type=1400 audit(1422862414.813:3229): avc: denied { lock } for pid=2484 comm="deliver" path="/var/panel/vmail/website.com/fail2ban/dovecot.index" index" […]