All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: Single home directory type for all roles.
@ 2004-12-09 18:50 Alex Ackerman
  2004-12-09 19:29 ` Russell Coker
  0 siblings, 1 reply; 52+ messages in thread
From: Alex Ackerman @ 2004-12-09 18:50 UTC (permalink / raw)
  To: Russell Coker, Colin Walters
  Cc: Daniel J Walsh, Stephen Smalley, SE Linux list, Joshua Brindle,
	Jim Carter, Nalin Dahyabhai



> On Thur, December 09, 2004 1:02 PM, Russell Coker wrote:
> > Hmm.  But the fact that in the default strict policy user_r and
staff_r
> > are nearly equivalent in terms of functionality is really a special
> > case, no?
> 
> A bug IMHO.  If we have two roles that become almost equivalent then
the
> sensible thing to do is remove one.  If we decide that for Fedora
strict
> policy we don't want to have any regular users be denied the ability
> perform administrative tasks then the correct thing to do is to make
> staff_r the default user role.
> 
> It's easy enough for anyone to add a new role if they need more roles
> than the default policy provides.

As a novice Fedora SELinux user, this sounds like a bad idea (even if it
was only hypothetical). There is currently a boolean in the strict
policy which disables the ability for normal user_r users from
transitioning to the sysadm_r, thus requiring only those users who may
have need of sysadm_r functions to be a member of staff_r. Any default
changes to this (by eliminating one role or the other) would require
users, like myself, who are not overly comfortable with developing new
user roles to regenerate a restricted user_r-type role for non-trusted
users.

As basic feedback, please do not go this route for the strict policy,
which is a nice secure default for workstation-level systems.

My $0.02,
Alex Ackerman

http://www.darkhonor.com



--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 52+ messages in thread
* patch: add can_create() macro, allow file_type_auto_trans(a,b,c, { file dir })
@ 2004-12-07  0:08 Thomas Bleher
  2004-12-08 19:32 ` James Carter
  0 siblings, 1 reply; 52+ messages in thread
From: Thomas Bleher @ 2004-12-07  0:08 UTC (permalink / raw)
  To: SELinux ML


[-- Attachment #1.1: Type: text/plain, Size: 803 bytes --]

After the boring cleanup stuff, now for something a little bit more
interesting :-)

The goal of the following patch is to allow one to write
file_type_auto_trans(foo_t, var_run_t, foo_var_run_t, { dir file sock_file }) 

This makes it much easier to eg lock down /tmp (this will follow later
as a separate patch)

How does it work? The m4 magic inside can_create() parses its last 
parameter via a regex into separate tokens which it passes to 
can_create_internal() one by one and recurses over the rest.

The interface to file_type_{,auto_}trans() is unchanged, except that the
fourth parameter can now contain multiple object classes.

Thomas

-- 
http://www.cip.ifi.lmu.de/~bleher/selinux/ - my SELinux pages
GPG-Fingerprint: BC4F BB16 30D6 F253 E3EA  D09E C562 2BAE B2F4 ABE7

[-- Attachment #1.2: can_create.patch --]
[-- Type: text/plain, Size: 1977 bytes --]

--- orig/macros/core_macros.te
+++ mod/macros/core_macros.te
@@ -445,6 +445,31 @@
 allow $1 $2:file { rx_file_perms execute_no_trans };
 ')
 
+# this is an internal macro used by can_create
+define(`can_create_internal', `
+ifelse(`$3', `dir', `
+allow $1 $2:$3 create_dir_perms;
+', `$3', `lnk_file', `
+allow $1 $2:$3 create_lnk_perms;
+', `
+allow $1 $2:$3 create_file_perms;
+')dnl end if dir
+')dnl end can_create_internal
+
+
+#################################
+#
+# can_create(domain, file_type, object_class)
+#
+# Permissions for creating files of the specified type and class
+#
+define(`can_create', `
+ifelse(regexp($3, `\w'), -1, `', `
+can_create_internal($1, $2, regexp($3, `\(\w+\)', `\1'))
+
+can_create($1, $2, regexp($3, `\w+\(.*\)', `\1'))
+')
+')
 #################################
 #
 # file_type_trans(domain, dir_type, file_type)
@@ -463,19 +488,9 @@
 # Allow the process to create the file.
 #
 ifelse(`$4', `', `
-allow $1 $3:{ file sock_file fifo_file } create_file_perms;
-allow $1 $3:lnk_file create_lnk_perms;
-allow $1 $3:dir create_dir_perms;
+can_create($1, $3, `{ file lnk_file sock_file fifo_file dir }')
 ', `
-ifelse(`$4', `dir', `
-allow $1 $3:$4 create_dir_perms;
-', `
-ifelse(`$4', `lnk_file', `
-allow $1 $3:$4 create_lnk_perms;
-', `
-allow $1 $3:$4 create_file_perms;
-')dnl end ifelse lnk_file
-')dnl end if dir
+can_create($1, $3, $4)
 ')dnl end if param 4 specified
 
 ')
--- orig/macros/program/crontab_macros.te
+++ mod/macros/program/crontab_macros.te
@@ -45,8 +45,7 @@
 dontaudit $1_crontab_t selinux_config_t:dir search;
 
 # Type for temporary files.
-file_type_auto_trans($1_crontab_t, tmp_t, $1_tmp_t, file)
-file_type_auto_trans($1_crontab_t, tmp_t, $1_tmp_t, dir)
+file_type_auto_trans($1_crontab_t, tmp_t, $1_tmp_t, { dir file })
 
 # Use the type when creating files in /var/spool/cron.
 allow sysadm_crontab_t $1_cron_spool_t:file { getattr read };

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 52+ messages in thread

end of thread, other threads:[~2004-12-13 14:19 UTC | newest]

Thread overview: 52+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-09 18:50 Single home directory type for all roles Alex Ackerman
2004-12-09 19:29 ` Russell Coker
  -- strict thread matches above, loose matches on Subject: below --
2004-12-07  0:08 patch: add can_create() macro, allow file_type_auto_trans(a,b,c, { file dir }) Thomas Bleher
2004-12-08 19:32 ` James Carter
2004-12-09 16:50   ` Single home directory type for all roles Daniel J Walsh
2004-12-09 17:20     ` Stephen Smalley
2004-12-09 17:40       ` Stephen Smalley
2004-12-09 17:47       ` Russell Coker
2004-12-09 17:53         ` Stephen Smalley
2004-12-09 18:12           ` Russell Coker
2004-12-09 18:18             ` Stephen Smalley
2004-12-09 18:45               ` Stephen Smalley
2004-12-09 19:08               ` Russell Coker
2004-12-09 20:03             ` Casey Schaufler
2004-12-10 12:20               ` Russell Coker
2004-12-10 15:22                 ` Valdis.Kletnieks
2004-12-10 16:19                   ` Casey Schaufler
2004-12-10 17:00                     ` Valdis.Kletnieks
2004-12-10 17:06                       ` Stephen Smalley
2004-12-10 17:29                       ` Casey Schaufler
2004-12-09 20:40             ` Valdis.Kletnieks
2004-12-10  3:03               ` Russell Coker
2004-12-10 14:09                 ` Daniel J Walsh
2004-12-10 14:31                   ` Stephen Smalley
2004-12-10 15:43                   ` Colin Walters
2004-12-10 16:33                   ` Casey Schaufler
2004-12-13 13:25                   ` Russell Coker
2004-12-13 13:56                     ` Daniel J Walsh
2004-12-13 14:19                       ` Russell Coker
2004-12-09 19:07           ` Thomas Bleher
2004-12-09 19:19             ` Russell Coker
2004-12-09 17:28     ` Colin Walters
2004-12-09 18:02       ` Russell Coker
2004-12-09 19:45         ` Daniel J Walsh
2004-12-09 20:07           ` Stephen Smalley
2004-12-09 20:13           ` Russell Coker
2004-12-09 20:22             ` Daniel J Walsh
2004-12-09 20:30               ` Russell Coker
2004-12-09 21:38               ` Thomas Bleher
2004-12-10  2:56                 ` Russell Coker
2004-12-09 22:29               ` Colin Walters
2004-12-10 13:11                 ` Stephen Smalley
2004-12-10 16:28                   ` Colin Walters
2004-12-09 21:16           ` Thomas Bleher
2004-12-10  2:58             ` Russell Coker
2004-12-09 22:43         ` Colin Walters
2004-12-10  2:23           ` Russell Coker
2004-12-10 15:48             ` Colin Walters
2004-12-10 21:58               ` Luke Kenneth Casson Leighton
2004-12-09 19:38       ` Daniel J Walsh
2004-12-09 19:58         ` Stephen Smalley
2004-12-09 20:09           ` Daniel J Walsh
2004-12-09 20:17         ` Russell Coker
2004-12-09 20:38           ` Daniel J Walsh

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.