Gentoo Archives: gentoo-hardened

From: xake@×××××××××.net
To: gentoo-hardened@l.g.o
Subject: Re: [gentoo-hardened] SELinux and NFS
Date: Sun, 24 Feb 2008 21:30:35
Message-Id: 23952.193.11.246.158.1203888629.squirrel@webmail.rymdraket.net
In Reply to: [gentoo-hardened] SELinux and NFS by Loren Bandiera
1 Why do you want mountd to tuch /dev/sdb1 to start with? I thing you have a
2 missconfiguration somewhere...
3
4 For me most/all NFS denials went away when I restructured the folder
5 placments on my system to acctually follow "the standard" (i.e. place
6 stuff where NFS are supposed to read/write to them) and configure NFS
7 thereafter.
8
9 >
10 > I've got a server setup with the selinux/2007.0/amd64 profile. I've got
11 > most of my services working but I'm having an issue with NFS.
12 >
13 > # uname -a
14 > Linux foo 2.6.24-gentoo-r2 #3 SMP Tue Feb 19 17:58:43 EST 2008 x86_64
15 > Intel(R) Xeon(R) CPU E5310 @ 1.60GHz GenuineIntel GNU/Linux
16 >
17 > # sestatus
18 > SELinux status: enabled
19 > SELinuxfs mount: /selinux
20 > Current mode: permissive
21 > Mode from config file: enforcing
22 > Policy version: 21
23 > Policy from config file: targeted
24 >
25 > # semodule -l
26 > apache 1.8.0
27 > bind 1.5.0
28 > clamav 1.5.0
29 > courier 1.3.0
30 > local 1.1.0
31 > ldap 1.5.0
32 > logrotate 1.6.0
33 > mysql 1.5.0
34 > ntp 1.4.0
35 > portmap 1.5.0
36 > postfix 1.7.0
37 > rpc 1.6.0
38 > samba 1.6.0
39 > screen 1.3.0
40 >
41 >
42 > When a client machine tries to connect/read an NFS share, it gets denied
43 > on the server:
44 >
45 > audit(1203882126.165:173): avc: denied { read } for pid=6553
46 > comm="rpc.mountd" name="sdb1" dev=tmpfs ino=2553
47 > scontext=user_u:system_r:nfsd_t
48 > tcontext=system_u:object_r:fixed_disk_device_t tclass=blk_file
49 >
50 > I fed that in audit2allow and added this to my local policy:
51 >
52 > require {
53 > class blk_file read;
54 > type fixed_disk_device_t;
55 > type nfsd_t;
56 > role system_r;
57 > };
58 >
59 > allow nfsd_t fixed_disk_device_t:blk_file read;
60 >
61 > It builds okay, but I get the following error trying to load it:
62 >
63 > # make
64 > Compiling targeted local module
65 > /usr/bin/checkmodule: loading policy configuration from tmp/local.tmp
66 > /usr/bin/checkmodule: policy configuration loaded
67 > /usr/bin/checkmodule: writing binary representation (version 6) to
68 > tmp/local.mod
69 > Creating targeted local.pp policy package
70 > rm tmp/local.mod tmp/local.mod.fc
71 >
72 > # semodule -u local.pp
73 > libsepol.check_assertion_helper: assertion on line 0 violated by allow
74 > nfsd_t fixed_disk_device_t:blk_file { read };
75 > libsepol.check_assertions: 1 assertion violations occured
76 > libsemanage.semanage_expand_sandbox: Expand module failed
77 > semodule: Failed!
78 >
79 > Is this being blocked by another policy? I'm new to SELinux and I'm not
80 > sure how to debug that further.
81 >
82 > Does anyone know how I can resolve this?
83 >
84 > --
85 > Loren Bandiera <lorenb@××××××××××××××.com>
86 > LB Technology Services, Inc.
87 >
88 >
89 > --
90 > gentoo-hardened@l.g.o mailing list
91 >
92 >
93
94
95 --
96 gentoo-hardened@l.g.o mailing list

Replies

Subject Author
Re: [gentoo-hardened] SELinux and NFS Loren Bandiera <lorenb@××××××××××××××.com>