All of lore.kernel.org
 help / color / mirror / Atom feed
From: antoine <antoine@nagafix.co.uk>
To: SELinux <selinux@tycho.nsa.gov>
Subject: mdadm policy
Date: Fri, 24 Jun 2005 00:27:23 +0100	[thread overview]
Message-ID: <1119569243.9390.77.camel@localhost> (raw)

[-- Attachment #1: Type: text/plain, Size: 433 bytes --]

I was looking for a policy for mdadm, I know there is one in Fedora, but
I use gentoo and I couldn't download it without getting the whole rpm,
so I ended up writing one (attached) - it is also a good learning
exercise. Shouldn't it be in serefpolicy.sourceforge.net?

Works for me (tm)
Is this any good? (I think it should probably use macros for shlib and
ptys, and use dontaudit instead of allow for some of the devices)

Antoine

[-- Attachment #2: mdadm.fc --]
[-- Type: text/plain, Size: 102 bytes --]

/etc/mdadm.conf					--	system_u:object_r:mdadm_etc_t
/sbin/mdadm					--	system_u:object_r:mdadm_bin_t

[-- Attachment #3: mdadm.te --]
[-- Type: text/plain, Size: 1887 bytes --]

# antoine@nagafix.co.uk

daemon_domain(mdadm, `, fs_domain')

type mdadm_etc_t, file_type, sysadmfile;
type mdadm_bin_t, file_type, sysadmfile;

domain_auto_trans(initrc_t, mdadm_bin_t, mdadm_t)
domain_auto_trans(sysadm_t, mdadm_bin_t, mdadm_t)

# role system_r types mdadm_t;

allow initrc_t mdadm_etc_t:file read;
allow mdadm_t mdadm_etc_t:file { getattr read };

allow mdadm_t etc_t:dir search;

allow mdadm_t ld_so_cache_t:file { getattr read };
allow mdadm_t lib_t:dir search;
allow mdadm_t lib_t:lnk_file read;
allow mdadm_t shlib_t:file { execute getattr read };

allow mdadm_t proc_mdstat_t:file { getattr read };
allow mdadm_t proc_t:dir search;
allow mdadm_t root_t:dir search;

allow mdadm_t tmpfs_t:dir { getattr read };


allow mdadm_t device_t:lnk_file read;

allow mdadm_t self:capability sys_admin;


# DEV:
allow mdadm_t clock_device_t:chr_file getattr;
allow mdadm_t console_device_t:chr_file { getattr read write };
allow mdadm_t cpu_device_t:chr_file getattr;
allow mdadm_t device_t:blk_file { getattr ioctl read };
allow mdadm_t device_t:chr_file getattr;
allow mdadm_t device_t:dir { getattr read search };
allow mdadm_t device_t:file getattr;
allow mdadm_t device_t:lnk_file getattr;
allow mdadm_t devlog_t:sock_file getattr;
allow mdadm_t devpts_t:dir { getattr read };
allow mdadm_t devtty_t:chr_file getattr;
allow mdadm_t fixed_disk_device_t:blk_file getattr;
allow mdadm_t init_t:fd use;
allow mdadm_t initctl_t:fifo_file getattr;
allow mdadm_t memory_device_t:chr_file getattr;
allow mdadm_t mouse_device_t:chr_file getattr;
allow mdadm_t null_device_t:chr_file { getattr read };
allow mdadm_t ptmx_t:chr_file getattr;
allow mdadm_t random_device_t:chr_file getattr;
allow mdadm_t tty_device_t:chr_file getattr;
#allow mdadm_t tun_tap_device_t:chr_file getattr;
allow mdadm_t zero_device_t:chr_file getattr;

allow mdadm_t fixed_disk_device_t:blk_file read;

             reply	other threads:[~2005-06-23 23:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-23 23:27 antoine [this message]
2005-06-24  1:50 ` mdadm policy Ivan Gyurdiev
2005-06-24  9:35   ` antoine
2005-06-24 15:41     ` Ivan Gyurdiev
2005-06-24 15:58       ` Colin Walters
2005-06-24 16:35       ` antoine
2005-06-24 17:46         ` Ivan Gyurdiev
2005-06-24 18:02           ` antoine
2005-06-24 19:05             ` Ivan Gyurdiev
2005-06-24 19:27               ` antoine
2005-06-24 19:29                 ` Ivan Gyurdiev
2005-06-24 19:43                 ` Stephen Smalley
2005-06-25  3:42                 ` Daniel J Walsh
2005-06-24 19:47               ` Stephen Smalley
2005-06-24 11:29 ` Stephen Smalley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1119569243.9390.77.camel@localhost \
    --to=antoine@nagafix.co.uk \
    --cc=selinux@tycho.nsa.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.