我在我的apache / linux服务器上有一个文件。 ls -Z给出: drwxr-xr-x. apache apache unconfined_u:object_r:httpd_sys_rw_content_t:s0 localization.smicloud.org 我需要像所有其他dirs一样将unconfined_u更改为system_u。 我一直在谷歌search,并在几个地方,我发现信息,这是如何做到这一点: semanage fcontext -a -t httpd_sys_content_t localization.smicloud.org 和 semanage fcontext -a -t httpd_sys_rw_content_t localization.smicloud.org 那些给出以下错误: libsemanage.get_home_dirs:netbeans homedir / var / www / html或其父目录与已经在策略中指定的文件上下文冲突。 这通常表示一个错误定义的系统帐户。 如果是系统帐户,请确保其uid小于500或其loginshell是/ sbin / nologin。 我不确定为什么提到netbeans。 这是我的开发工具,但它不存在于有关目录的信息。 目录是空的! 我怎样才能解决这个问题? 更新 我不清楚我的真正的问题:我想使用Netbeans来将我的文件ftp到这个文件夹。 它适用于所有其他文件夹,唯一的区别是我可以看到这和这些是这个部分。
新鲜的centos 6.5与更新安装。 由于我们用splunk或logstash捕获了所有的东西,所以我们希望将auditdlogging到一个非永久性的卷中。 目标目录是/ mnt / ephemeral / audit / # ls -l /var/log lrwxrwxrwx. 1 root root 21 Dec 9 12:11 audit -> /mnt/ephemeral/audit 有了这个,auditd无法启动,据推测selinux拒绝了。 我假设/ var / log / messages中的日志包含创build新策略所需的avc拒绝。 所以我 semanage permissive -a auditd_t 然后再试一次 Dec 9 12:50:56 myhost kernel: type=1400 audit(1418129456.307:93): avc: denied { write } for pid=13174 comm="auditd" name="audit" dev=xvdb […]
在启用selinux的CentOS中,我有一台运行apache的web服务器。 我有一个运行gitlab的单独的服务器。 我试图创build一个工作stream使用gitlab的networking钩子,所以当代码被推到git,gitlab将请求我的生产服务器上,然后将拉最新版本的代码的页面。 脚本运行良好,但是selinux不允许从脚本运行git pull 。 它失败,退出码128。 简化的PHP脚本 <?php $data = json_decode(file_get_contents("php://input")); exec('./.hooks/received-push.sh ' . $data->repository->url); 简化的bash脚本 #!/bin/sh if [ "$#" -ne 1]; then echo "Repo URL must be provided" fi GIT=/usr/local/bin/git TMP=mktemp cd $TMP $GIT clone $1 || echo "git clone failed with exit code $?" 我已经发现httpd_can_network_connect被设置为closures,所以我打开了。 如果我禁用selinux,一切正常,所以我知道有一些东西在这里的方式。 手动运行时脚本工作正常。 看一下audit.log,我看到这行在git clone运行的时候出现(为了可读性,在这里放了多行) type=AVC msg=audit(1420243675.063:1041): avc: […]
好奇什么是守护进程。 维基在http://wiki.centos.org/TipsAndTricks/SelinuxBooleans说这是“soundd守护进程”,但我没有find更多的互联网信息。 要获得nginx(configuration为在unix套接字上绑定)以systemctl开头我需要在httpd_t上添加一个types强制规则到soundd_port_t:tcp_socket。 进一步来说: sudo systemctl status nginx.service 消息失败: nginx.service – The nginx HTTP and reverse proxy server Loaded: loaded (/usr/lib/systemd/system/nginx.service; disabled) Active: failed (Result: exit-code) since Mon 2015-07-13 19:53:57 EDT; 7s ago Process: 2699 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=1/FAILURE) Jul 13 19:53:57 localhost.localdomain nginx[2699]: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok Jul 13 19:53:57 […]
我有一个configuration为Squid代理的CentOS 7盒,带有clamav和Squidclamav。 通常我只是禁用SELINUX,但我试图理解和设置允许规则正确。 我已经设法创build了几个来解决与鱿鱼确定的问题,但是,与clamd有关的套接字的一个错误是造成问题。 键入= AVC msg = audit(1436899859.808:9282):avc:denied {unlink} for pid = 22802 comm =“clamd”name =“clamd.sock”dev =“tmpfs”ino = 729382 scontext = system_u:system_r:antivirus_t: s0 tcontext = system_u:object_r:var_run_t:s0 tclass = sock_file 我需要哪些模块/允许规则来修复audit.log中报告的条目?
我已经安装在CentOS 7.1上。 在过去,我经常只是禁用了SELinux,但是现在我想要一个带SELinux的服务器。 无论如何,我有邮件存储在/ home / USER / Maildir,由于我不明白的原因,我得到以下错误: Jul 25 22:32:03 server dovecot: imap(dean): Error: open(/home/dean/Maildir/dovecot.index.log) failed: Permission denied (euid=1000(dean) egid=1000(dean) missing +r perm: /home/dean/Maildir/dovecot.index.log stat(/home/dean/Maildir/dovecot.index.log) failed: Permission denied) Jul 25 22:32:03 server dovecot: imap(dean): Error: file_dotlock_create(/home/dean/Maildir/dovecot-uidlist) failed: Permission denied (euid=1000(dean) egid=1000(dean) missing +w perm: /home/dean/Maildir, UNIX perms appear ok (ACL/MAC wrong?)) 我使用以下方法检查了SELinux: grep […]
题 什么SELinux上下文我需要什么文件来获得apache ldap(通过SSL)auth工作? 或者它是一个networking协议或系统调用或其他什么东西? 环境 Centos 7上的Apache 2.4使用基于ssl的基本ldap身份validation。 有了SELinux许可( setenforce 0 ),一切运行良好。 我可以用ldap完美地login到受保护的目录。 当启用SELinux( setenforce 1 )时,apache不能执行ldapsearch并允许用户通过。 这与ssl或证书有关,我无法弄清楚。 在/ var /日志/的httpd / ssl_error_log [Thu Mar 17 15:33:32.529755 2016] [authnz_ldap:debug] [pid 6412] mod_authnz_ldap.c(501): [client 158.158.193.232:17386] AH01691: auth_ldap authenticate: using URL ldaps://ldap-ad.example.org:636/ou=Auto-Accounts,dc=example,dc=org?sAMAccountname?sub [Thu Mar 17 15:33:32.530792 2016] [ldap:debug] [pid 6412] util_ldap.c(372): AH01278: LDAP: Setting referrals to On. […]
我在我的CentOS 7机器上运行了nginx。 我每天运行一个cron作业,生成新的Diffie-Hellman参数。 它们保存在/etc/ssl/dh/dhparam.pem 。 但SELinux阻止nginx读取这个文件。 这是nginx错误日志中的行: nginx[3189]: nginx: [emerg] BIO_new_file("/etc/ssl/dh/dhparam.pem") failed (SSL: error:0200100D:system library:fopen:Permission denied:fopen('/etc/ssl/dh/dhparam.pem','r') error:2006D002:BIO routines:BIO_new_file:system lib) 这是审计日志: type=AVC msg=audit(1473285202.181:334): avc: denied { open } for pid=1393 comm="nginx" path="/etc/ssl/dh/dhparam.pem" dev="dm-1" ino=101646309 scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:user_tmp_t:s0 tclass=file type=AVC msg=audit(1473285832.647:743): avc: denied { open } for pid=2958 comm="nginx" path="/etc/ssl/dh/dhparam.pem" dev="dm-1" ino=101646309 scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:user_tmp_t:s0 tclass=file type=AVC msg=audit(1473287010.821:803): avc: […]
尝试更新我的cifs安装的安全上下文types时,我不断收到'Operation not supported'消息。 我使用logrotate将我的服务器上的日志推送到networking位置,但是在cifs mount上执行的脚本的上下文是'system_u:object_r:cifs_t:s0' 这里是我的CIFS文件夹的装载标志: (rw,relatime,vers=1.0,cache=strict,username=cifsuser,domain=.,uid=1000,forceuid,gid=1000,forcegid,addr=10.1.3.97,file_mode=0755,dir_mode=0755,nounix,rsize=61440,wsize=16580,actimeo=1) 我有我的logrotate从cron.hourly运行,每次它试图将文件移动到这个安装我会得到一个selinux政策错误。 我试图运行以下来解决: sealert -l b9263b3e-d2f9-4b33-ba48-af9b3b7695fd grep logrotate /var/log/audit/audit.log | audit2allow -M mypol semodule -i mypol.pp 但是我仍然有问题,并且不再给我/ var / log / messages中的sealert错误。 检查我的/var/log/audit/audit.log日志我看到这个: type=SYSCALL msg=audit(1474114505.460:25005): arch=c000003e syscall=21 success=no exit=-13 a0=10f33a0 a1=4 a2=7ffd34025160 a3=7ffd34025080 items=0 ppid=16240 pid=16241 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=2773 comm="sh" exe="/usr/bin/bash" […]
我尝试了,但它给了一个错误。 # ls -l opendkim.pp -rw-r–r–. 1 root root 1569 Jan 8 01:20 opendkim.pp # ls -l /etc/selinux/targeted/modules/active/modules/opendkim.pp -rw-r–r–. 1 root root 344 Jan 8 01:33 /etc/selinux/targeted/modules/active/modules/opendkim.pp # semodule -r opendkim.pp SELinux: Could not load policy file /etc/selinux/targeted/policy/policy.24: Invalid argument /sbin/load_policy: Can't load policy: Invalid argument libsemanage.semanage_reload_policy: load_policy returned error code 2. SELinux: Could not […]