All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel J Walsh <dwalsh@redhat.com>
To: jwcart2@epoch.ncsc.mil
Cc: Russell Coker <russell@coker.com.au>,
	Thomas Bleher <bleher@informatik.uni-muenchen.de>,
	SELinux <selinux@tycho.nsa.gov>
Subject: Re: can_network patch.
Date: Wed, 24 Nov 2004 15:24:26 -0500	[thread overview]
Message-ID: <41A4EDFA.3060407@redhat.com> (raw)
In-Reply-To: <1101325733.12859.37.camel@moss-lions.epoch.ncsc.mil>

James Carter wrote:

>Merged with some changes.
>
>After talking with Steve, I removed can_network_server_udp and
>can_network_client_udp, and just used can_network_udp.  There is no
>security gained for udp in not allowing the connect if they already can
>send and receive.
>  
>
Ok,  this might be a candidate for a boolean

>Also removed, for now, the mozilla_macros.te chunk that allowed mozilla
>to execute userhelper and the rules giving mozilla more execute
>permissions.  
>
>I missed the userhelper stuff yesterday.  Letting mozilla run userhelper
>has some serious security implications.
>
>Isn't it possible to give the JRE the execute permisisons without giving
>it to $1_mozilla_t?
>
>  
>
Yes, although it will probably need alot of the same privs as mozilla, 
and be quite complicated.

>On Wed, 2004-11-24 at 11:22, Daniel J Walsh wrote:
>  
>
>>    *   This patch includes the ugliness to get sun's jre plugin to work
>>      in Mozilla.  (otherwize mozilla crashes).
>>    * Removed distro_gentoo checks around proc_net since we want these also.
>>    * Futzed around with userhelper so that mozilla can run it.
>>    * Cleaned up stunnel.te so it should be usable for gentoo and other
>>      distributions.
>>    * Some cleanup of apache to allow starting of apache with ssl keys
>>    * Includes modification to global_macros to extract out
>>      network_macros.te
>>
>>
>>network_macros.te includes
>>
>>can_network - with all the current functionaility
>>
>>I added
>>
>>can_network_server (Has listen and accept, both udp and tcp)
>>can_network_server_udp
>>can_network_server_tcp
>>
>>can_network_client (Has connect, both udp and tcp)
>>can_network_client_tcp
>>can_network_client_udp
>>
>>can_network_udp  - Same as can_network but only for udp
>>can_network_tcp - Same as can_network but only for tcp
>>
>>
>>______________________________________________________________________
>>    
>>
><snip>
>  
>
>>diff --exclude-from=exclude -N -u -r nsapolicy/macros/network_macros.te policy-1.19.5/macros/network_macros.te
>>--- nsapolicy/macros/network_macros.te	1969-12-31 19:00:00.000000000 -0500
>>+++ policy-1.19.5/macros/network_macros.te	2004-11-24 10:57:51.328334858 -0500
>>@@ -0,0 +1,189 @@
>>+#################################
>>+#
>>+# can_network(domain)
>>+#
>>+# Permissions for accessing the network.
>>+# See types/network.te for the network types.
>>+# See net_contexts for security contexts for network entities.
>>+#
>>+define(`base_can_network',`
>>+#
>>+# Allow the domain to create and use $2 sockets.
>>+# Other kinds of sockets must be separately authorized for use.
>>+allow $1 self:$2_socket connected_socket_perms;
>>+
>>+#
>>+# Allow the domain to send or receive using any network interface.
>>+# netif_type is a type attribute for all network interface types.
>>+#
>>+allow $1 netif_type:netif { $2_send rawip_send };
>>+allow $1 netif_type:netif { $2_recv rawip_recv };
>>+
>>+#
>>+# Allow the domain to send to or receive from any node.
>>+# node_type is a type attribute for all node types.
>>+#
>>+allow $1 node_type:node { $2_send rawip_send };
>>+allow $1 node_type:node { $2_recv rawip_recv };
>>+
>>+#
>>+# Allow the domain to send to or receive from any port.
>>+# port_type is a type attribute for all port types.
>>+#
>>+ifelse($3, `', `
>>+allow $1 port_type:$2_socket { send_msg recv_msg };
>>+', `
>>+allow $1 $3:$2_socket { send_msg recv_msg };
>>+')
>>+
>>+# XXX Allow binding to any node type.  Remove once
>>+# individual rules have been added to all domains that 
>>+# bind sockets. 
>>+allow $1 node_type:$2_socket node_bind;
>>+#
>>+# Allow access to network files including /etc/resolv.conf
>>+#
>>+allow $1 net_conf_t:file r_file_perms;
>>+')dnl end can_network definition
>>+
>>+#################################
>>+#
>>+# can_network_server_tcp(domain)
>>+#
>>+# Permissions for accessing a tcp network.
>>+# See types/network.te for the network types.
>>+# See net_contexts for security contexts for network entities.
>>+#
>>+define(`can_network_server_tcp',`
>>+base_can_network($1, tcp, `$2')
>>+allow $1 self:tcp_socket { listen accept };
>>+')
>>+
>>+#################################
>>+#
>>+# can_network_server_udp(domain)
>>+#
>>+# Permissions for accessing a udp network.
>>+# See types/network.te for the network types.
>>+# See net_contexts for security contexts for network entities.
>>+#
>>+define(`can_network_server_udp',`
>>+base_can_network($1, udp, `$2')
>>+')
>>+
>>+#################################
>>+#
>>+# can_network_client_tcp(domain)
>>+#
>>+# Permissions for accessing a tcp network.
>>+# See types/network.te for the network types.
>>+# See net_contexts for security contexts for network entities.
>>+#
>>+define(`can_network_client_tcp',`
>>+base_can_network($1, tcp, `$2')
>>+allow $1 self:tcp_socket { connect };
>>+')
>>+
>>+#################################
>>+#
>>+# can_network_client_udp(domain)
>>+#
>>+# Permissions for accessing a udp network.
>>+# See types/network.te for the network types.
>>+# See net_contexts for security contexts for network entities.
>>+#
>>+define(`can_network_client_udp',`
>>+base_can_network($1, udp, `$2')
>>+allow $1 self:udp_socket { connect };
>>+')
>>+
>>+#################################
>>+#
>>+# can_network_tcp(domain)
>>+#
>>+# Permissions for accessing the network.
>>+# See types/network.te for the network types.
>>+# See net_contexts for security contexts for network entities.
>>+#
>>+define(`can_network_tcp',`
>>+
>>+can_network_server_tcp($1, `$2')
>>+can_network_client_tcp($1, `$2')
>>+
>>+')
>>+
>>+#################################
>>+#
>>+# can_network_udp(domain)
>>+#
>>+# Permissions for accessing the network.
>>+# See types/network.te for the network types.
>>+# See net_contexts for security contexts for network entities.
>>+#
>>+define(`can_network_udp',`
>>+
>>+can_network_client_udp($1, `$2')
>>+can_network_server_udp($1, `$2')
>>+
>>+')
>>+
>>+#################################
>>+#
>>+# can_network_server(domain)
>>+#
>>+# Permissions for accessing the network.
>>+# See types/network.te for the network types.
>>+# See net_contexts for security contexts for network entities.
>>+#
>>+define(`can_network_server',`
>>+
>>+can_network_server_tcp($1, `$2')
>>+can_network_server_udp($1, `$2')
>>+
>>+')dnl end can_network_server definition
>>+
>>+
>>+#################################
>>+#
>>+# can_network_client(domain)
>>+#
>>+# Permissions for accessing the network.
>>+# See types/network.te for the network types.
>>+# See net_contexts for security contexts for network entities.
>>+#
>>+define(`can_network_client',`
>>+
>>+can_network_client_tcp($1, `$2')
>>+can_network_client_udp($1, `$2')
>>+
>>+')dnl end can_network_client definition
>>+
>>+#################################
>>+#
>>+# can_network(domain)
>>+#
>>+# Permissions for accessing the network.
>>+# See types/network.te for the network types.
>>+# See net_contexts for security contexts for network entities.
>>+#
>>+define(`can_network',`
>>+
>>+can_network_tcp($1, `$2')
>>+can_network_udp($1, `$2')
>>+
>>+#
>>+# Allow the domain to send NFS client requests via the socket
>>+# created by mount.
>>+#
>>+allow $1 mount_t:udp_socket rw_socket_perms;
>>+
>>+')dnl end can_network definition
>>+
>>+define(`can_resolve',`
>>+can_network_client_udp($1, `dns_port_t')
>>+')
>>+
>>+define(`can_ldap',`
>>+can_network_client_tcp($1, `ldap_port_t')
>>+')
>>+
>>    
>>
>
><snip>
>
>  
>
>>diff --exclude-from=exclude -N -u -r nsapolicy/macros/program/mozilla_macros.te policy-1.19.5/macros/program/mozilla_macros.te
>>--- nsapolicy/macros/program/mozilla_macros.te	2004-11-24 07:00:51.000000000 -0500
>>+++ policy-1.19.5/macros/program/mozilla_macros.te	2004-11-24 10:57:51.332334406 -0500
>>@@ -29,7 +29,8 @@
>> 
>> allow $1_mozilla_t usr_t:{ lnk_file file } { getattr read };
>> allow $1_mozilla_t var_lib_t:file { getattr read };
>>-allow $1_mozilla_t urandom_device_t:chr_file { getattr ioctl read };
>>+allow $1_mozilla_t { random_device_t urandom_device_t }:chr_file { getattr ioctl read append };
>>+
>> allow $1_mozilla_t self:socket create_socket_perms;
>> allow $1_mozilla_t self:file { getattr read };
>> 
>>@@ -117,8 +118,20 @@
>> dontaudit $1_mozilla_t file_type:dir getattr;
>> allow $1_mozilla_t self:sem create_sem_perms;
>> 
>>+ifdef(`userhelper.te', `
>>+domain_auto_trans($1_mozilla_t, userhelper_exec_t, $1_userhelper_t)
>>+')
>> dontaudit $1_mozilla_t selinux_config_t:dir search;
>> 
>>+#
>>+# Rules needed to run java apps
>>+#
>>+allow $1_mozilla_t ld_so_cache_t:file execute;
>>+allow $1_mozilla_t locale_t:file execute;
>>+dontaudit $1_mozilla_t *:{ chr_file file } execute;
>>+dontaudit $1_t ld_so_cache_t:file execute;
>>+dontaudit $1_t locale_t:file execute;
>>+
>> ifdef(`xdm.te', `
>> allow $1_mozilla_t xdm_t:fifo_file { write read };
>> allow $1_mozilla_t xdm_tmp_t:dir search;
>>    
>>
>
>  
>


--
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.

  reply	other threads:[~2004-11-24 20:24 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-18 19:31 Adding alternate root patch to restorecon (setfiles?) Daniel J Walsh
2004-10-18 19:55 ` Stephen Smalley
2004-10-18 20:11   ` Daniel J Walsh
2004-10-18 20:51 ` Thomas Bleher
2004-10-19 13:33   ` Daniel J Walsh
2004-10-19 18:36     ` Luke Kenneth Casson Leighton
2004-10-19 18:26       ` Stephen Smalley
2004-10-19 20:27         ` Luke Kenneth Casson Leighton
2004-10-25 15:35       ` Russell Coker
2004-10-25 15:38   ` Russell Coker
2004-10-25 21:31     ` Thomas Bleher
2004-10-26 14:36       ` Russell Coker
2004-11-05 21:39         ` James Carter
2004-11-06  5:23           ` Remaining changes from my patch excluding can_network changes Daniel J Walsh
2004-11-08 17:33             ` Small patch to allow pam_console handle /dev/pmu Daniel J Walsh
2004-11-08 21:21               ` James Carter
2004-11-08 21:21             ` Remaining changes from my patch excluding can_network changes James Carter
2004-11-06  5:33           ` can_network patch Daniel J Walsh
2004-11-09 21:34             ` James Carter
2004-11-09 22:15               ` Daniel J Walsh
2004-11-06 10:40           ` Adding alternate root patch to restorecon (setfiles?) Thomas Bleher
2004-11-10 23:11           ` Patches without the can_network patch Daniel J Walsh
2004-11-10 23:38             ` Thomas Bleher
2004-11-17 20:15             ` James Carter
2004-11-18 14:32               ` Daniel J Walsh
2004-11-18 19:43                 ` Thomas Bleher
2004-11-18 19:50                   ` Daniel J Walsh
2004-11-18 19:59                     ` Thomas Bleher
2004-11-19 22:05                 ` James Carter
2004-11-18 14:33               ` Daniel J Walsh
2004-11-23 18:52                 ` James Carter
2004-11-23 19:06                   ` Stephen Smalley
2004-11-23 19:37                     ` Daniel J Walsh
2004-11-23 20:07                       ` Stephen Smalley
2004-11-25 19:40                         ` Russell Coker
2004-11-26 11:55                           ` Daniel J Walsh
2004-11-24 16:22                   ` Daniel J Walsh
2004-11-24 16:39                     ` Stephen Smalley
2004-11-24 16:54                       ` Daniel J Walsh
2004-12-10 15:43                         ` Stephen Smalley
2004-12-10 17:06                           ` Daniel J Walsh
2004-12-10 17:10                             ` Stephen Smalley
2004-12-10 18:01                               ` Daniel J Walsh
2004-12-10 18:02                                 ` Stephen Smalley
2004-12-10 18:13                                   ` Daniel J Walsh
2004-12-10 18:11                                 ` Russell Coker
2004-12-10 19:11                                   ` Thomas Bleher
2004-12-10 20:23                                     ` James Carter
2004-12-10 21:39                                     ` Valdis.Kletnieks
2004-12-13 12:18                                       ` David Caplan
2004-12-10 21:01                                   ` Valdis.Kletnieks
2004-12-10 23:47                                     ` Russell Coker
2004-11-24 19:48                     ` James Carter
2004-11-24 20:24                       ` Daniel J Walsh [this message]
2004-11-30 21:19                       ` Reissue previous patch Daniel J Walsh
2004-12-02 13:54                         ` James Carter
2004-12-02 14:16                           ` Daniel J Walsh
2004-12-02 15:51                             ` Stephen Smalley
2004-12-02 18:35                               ` Daniel J Walsh
2004-12-02 17:51                             ` James Carter
2004-12-02 19:27                               ` Latest patch Daniel J Walsh
2004-12-03 13:40                                 ` James Carter
2004-11-17 23:35             ` Patches without the can_network patch Kodungallur Varma

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=41A4EDFA.3060407@redhat.com \
    --to=dwalsh@redhat.com \
    --cc=bleher@informatik.uni-muenchen.de \
    --cc=jwcart2@epoch.ncsc.mil \
    --cc=russell@coker.com.au \
    --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.