2005-04-20 19:07:16 +00:00
|
|
|
|
2005-04-26 17:00:25 +00:00
|
|
|
policy_module(filesystem,1.0)
|
|
|
|
|
2005-06-30 18:54:08 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
2005-06-28 17:48:59 +00:00
|
|
|
attribute filesystem_type;
|
2005-06-09 15:20:31 +00:00
|
|
|
attribute noxattrfs;
|
2005-04-14 20:18:17 +00:00
|
|
|
|
2005-06-30 18:54:08 +00:00
|
|
|
##############################
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
|
|
|
# fs_t is the default type for persistent
|
|
|
|
# filesystems with extended attributes
|
|
|
|
#
|
2005-06-28 17:48:59 +00:00
|
|
|
type fs_t, filesystem_type;
|
2005-06-02 15:39:10 +00:00
|
|
|
sid fs context_template(system_u:object_r:fs_t,s0)
|
|
|
|
|
|
|
|
# Use xattrs for the following filesystem types.
|
|
|
|
# Requires that a security xattr handler exist for the filesystem.
|
|
|
|
fs_use_xattr ext2 context_template(system_u:object_r:fs_t,s0);
|
|
|
|
fs_use_xattr ext3 context_template(system_u:object_r:fs_t,s0);
|
|
|
|
fs_use_xattr jfs context_template(system_u:object_r:fs_t,s0);
|
2005-09-15 21:03:29 +00:00
|
|
|
fs_use_xattr reiserfs context_template(system_u:object_r:fs_t,s0);
|
2005-06-02 15:39:10 +00:00
|
|
|
fs_use_xattr xfs context_template(system_u:object_r:fs_t,s0);
|
|
|
|
|
|
|
|
# Use the allocating task SID to label inodes in the following filesystem
|
|
|
|
# types, and label the filesystem itself with the specified context.
|
|
|
|
# This is appropriate for pseudo filesystems that represent objects
|
|
|
|
# like pipes and sockets, so that these objects are labeled with the same
|
|
|
|
# type as the creating task.
|
|
|
|
fs_use_task pipefs context_template(system_u:object_r:fs_t,s0);
|
|
|
|
fs_use_task sockfs context_template(system_u:object_r:fs_t,s0);
|
2005-04-14 20:18:17 +00:00
|
|
|
|
2005-06-30 18:54:08 +00:00
|
|
|
##############################
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
|
|
|
# Non-persistent/pseudo filesystems
|
|
|
|
#
|
2005-06-28 17:48:59 +00:00
|
|
|
type bdev_t, filesystem_type;
|
2005-05-20 20:43:18 +00:00
|
|
|
genfscon bdev / context_template(system_u:object_r:bdev_t,s0)
|
2005-04-14 20:18:17 +00:00
|
|
|
|
2005-06-28 17:48:59 +00:00
|
|
|
type binfmt_misc_fs_t, filesystem_type;
|
2005-09-13 13:06:07 +00:00
|
|
|
files_mountpoint(binfmt_misc_fs_t)
|
2005-05-20 20:43:18 +00:00
|
|
|
genfscon binfmt_misc / context_template(system_u:object_r:binfmt_misc_fs_t,s0)
|
2005-04-14 20:18:17 +00:00
|
|
|
|
2005-06-28 17:48:59 +00:00
|
|
|
type eventpollfs_t, filesystem_type;
|
2005-05-20 20:43:18 +00:00
|
|
|
genfscon eventpollfs / context_template(system_u:object_r:eventpollfs_t,s0)
|
2005-04-14 20:18:17 +00:00
|
|
|
|
2005-06-28 17:48:59 +00:00
|
|
|
type futexfs_t, filesystem_type;
|
2005-05-20 20:43:18 +00:00
|
|
|
genfscon futexfs / context_template(system_u:object_r:futexfs_t,s0)
|
2005-04-14 20:18:17 +00:00
|
|
|
|
2005-09-13 13:06:07 +00:00
|
|
|
type hugetlbfs_t, filesystem_type;
|
|
|
|
files_mountpoint(hugetlbfs_t)
|
|
|
|
allow hugetlbfs_t self:filesystem associate;
|
2005-09-15 21:03:29 +00:00
|
|
|
genfscon hugetlbfs / context_template(system_u:object_r:hugetlbfs_t,s0)
|
2005-09-13 13:06:07 +00:00
|
|
|
|
|
|
|
type inotifyfs_t, filesystem_type;
|
|
|
|
allow inotifyfs_t self:filesystem associate;
|
2005-09-15 21:03:29 +00:00
|
|
|
genfscon inotifyfs / context_template(system_u:object_r:inotifyfs_t,s0)
|
2005-09-13 13:06:07 +00:00
|
|
|
|
2005-06-28 17:48:59 +00:00
|
|
|
type nfsd_fs_t, filesystem_type;
|
2005-05-20 20:43:18 +00:00
|
|
|
genfscon nfsd / context_template(system_u:object_r:nfsd_fs_t,s0)
|
2005-04-14 20:18:17 +00:00
|
|
|
|
2005-06-28 17:48:59 +00:00
|
|
|
type ramfs_t, filesystem_type;
|
2005-04-14 20:18:17 +00:00
|
|
|
allow ramfs_t self:filesystem associate;
|
2005-05-20 20:43:18 +00:00
|
|
|
genfscon ramfs / context_template(system_u:object_r:ramfs_t,s0)
|
2005-04-14 20:18:17 +00:00
|
|
|
|
2005-06-28 17:48:59 +00:00
|
|
|
type romfs_t, filesystem_type;
|
2005-04-14 20:18:17 +00:00
|
|
|
allow romfs_t self:filesystem associate;
|
2005-05-20 20:43:18 +00:00
|
|
|
genfscon romfs / context_template(system_u:object_r:romfs_t,s0)
|
|
|
|
genfscon cramfs / context_template(system_u:object_r:romfs_t,s0)
|
2005-04-14 20:18:17 +00:00
|
|
|
|
2005-06-28 17:48:59 +00:00
|
|
|
type rpc_pipefs_t, filesystem_type;
|
2005-05-20 20:43:18 +00:00
|
|
|
genfscon rpc_pipefs / context_template(system_u:object_r:rpc_pipefs_t,s0)
|
2005-04-14 20:18:17 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# tmpfs_t is the type for tmpfs filesystems
|
|
|
|
#
|
2005-06-28 17:48:59 +00:00
|
|
|
type tmpfs_t, filesystem_type;
|
2005-06-29 14:26:41 +00:00
|
|
|
files_type(tmpfs_t)
|
2005-09-16 19:36:10 +00:00
|
|
|
files_mountpoint(tmpfs_t)
|
2005-05-30 21:17:20 +00:00
|
|
|
|
2005-06-02 15:39:10 +00:00
|
|
|
# Use a transition SID based on the allocating task SID and the
|
|
|
|
# filesystem SID to label inodes in the following filesystem types,
|
|
|
|
# and label the filesystem itself with the specified context.
|
|
|
|
# This is appropriate for pseudo filesystems like devpts and tmpfs
|
|
|
|
# where we want to label objects with a derived type.
|
2005-09-16 19:36:10 +00:00
|
|
|
fs_use_trans mqueue context_template(system_u:object_r:tmpfs_t,s0);
|
2005-06-02 15:39:10 +00:00
|
|
|
fs_use_trans shm context_template(system_u:object_r:tmpfs_t,s0);
|
2005-09-15 21:03:29 +00:00
|
|
|
fs_use_trans tmpfs context_template(system_u:object_r:tmpfs_t,s0);
|
2005-06-02 15:39:10 +00:00
|
|
|
|
2005-04-14 20:18:17 +00:00
|
|
|
allow tmpfs_t self:filesystem associate;
|
2005-06-09 15:20:31 +00:00
|
|
|
allow tmpfs_t noxattrfs:filesystem associate;
|
2005-04-14 20:18:17 +00:00
|
|
|
|
2005-06-30 18:54:08 +00:00
|
|
|
##############################
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
|
|
|
# Filesystems without extended attribute support
|
|
|
|
#
|
2005-06-28 17:48:59 +00:00
|
|
|
type autofs_t, filesystem_type, noxattrfs;
|
2005-04-14 20:18:17 +00:00
|
|
|
allow autofs_t self:filesystem associate;
|
2005-05-20 20:43:18 +00:00
|
|
|
genfscon autofs / context_template(system_u:object_r:autofs_t,s0)
|
|
|
|
genfscon automount / context_template(system_u:object_r:autofs_t,s0)
|
2005-04-14 20:18:17 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# cifs_t is the type for filesystems and their
|
|
|
|
# files shared from Windows servers
|
|
|
|
#
|
2005-06-28 17:48:59 +00:00
|
|
|
type cifs_t alias sambafs_t, filesystem_type, noxattrfs;
|
2005-04-14 20:18:17 +00:00
|
|
|
allow cifs_t self:filesystem associate;
|
2005-05-20 20:43:18 +00:00
|
|
|
genfscon cifs / context_template(system_u:object_r:cifs_t,s0)
|
|
|
|
genfscon smbfs / context_template(system_u:object_r:cifs_t,s0)
|
2005-04-14 20:18:17 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# dosfs_t is the type for fat and vfat
|
|
|
|
# filesystems and their files.
|
|
|
|
#
|
2005-06-28 17:48:59 +00:00
|
|
|
type dosfs_t, filesystem_type, noxattrfs;
|
2005-04-14 20:18:17 +00:00
|
|
|
allow dosfs_t self:filesystem associate;
|
2005-05-20 20:43:18 +00:00
|
|
|
genfscon fat / context_template(system_u:object_r:dosfs_t,s0)
|
2005-09-15 21:03:29 +00:00
|
|
|
genfscon msdos / context_template(system_u:object_r:dosfs_t,s0)
|
2005-05-20 20:43:18 +00:00
|
|
|
genfscon ntfs / context_template(system_u:object_r:dosfs_t,s0)
|
2005-09-15 21:03:29 +00:00
|
|
|
genfscon vfat / context_template(system_u:object_r:dosfs_t,s0)
|
2005-04-14 20:18:17 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# iso9660_t is the type for CD filesystems
|
|
|
|
# and their files.
|
|
|
|
#
|
2005-06-28 17:48:59 +00:00
|
|
|
type iso9660_t, filesystem_type, noxattrfs;
|
2005-04-14 20:18:17 +00:00
|
|
|
allow iso9660_t self:filesystem associate;
|
2005-05-20 20:43:18 +00:00
|
|
|
genfscon iso9660 / context_template(system_u:object_r:iso9660_t,s0)
|
|
|
|
genfscon udf / context_template(system_u:object_r:iso9660_t,s0)
|
2005-04-14 20:18:17 +00:00
|
|
|
|
2005-04-21 22:46:49 +00:00
|
|
|
#
|
|
|
|
# removable_t is the default type of all removable media
|
|
|
|
#
|
2005-06-28 17:48:59 +00:00
|
|
|
type removable_t, filesystem_type, noxattrfs;
|
2005-06-09 15:20:31 +00:00
|
|
|
allow removable_t noxattrfs:filesystem associate;
|
2005-04-21 22:46:49 +00:00
|
|
|
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
|
|
|
# nfs_t is the default type for NFS file systems
|
|
|
|
# and their files.
|
|
|
|
#
|
2005-06-28 17:48:59 +00:00
|
|
|
type nfs_t, filesystem_type, noxattrfs;
|
2005-06-13 17:35:46 +00:00
|
|
|
files_mountpoint(nfs_t)
|
2005-04-14 20:18:17 +00:00
|
|
|
allow nfs_t self:filesystem associate;
|
2005-05-20 20:43:18 +00:00
|
|
|
genfscon nfs / context_template(system_u:object_r:nfs_t,s0)
|
|
|
|
genfscon nfs4 / context_template(system_u:object_r:nfs_t,s0)
|
|
|
|
genfscon afs / context_template(system_u:object_r:nfs_t,s0)
|