All of lore.kernel.org
 help / color / mirror / Atom feed
* policy question
@ 2002-04-18  9:22 Tom
  2002-04-18 10:44 ` Russell Coker
  2002-04-18 15:22 ` Stephen Smalley
  0 siblings, 2 replies; 22+ messages in thread
From: Tom @ 2002-04-18  9:22 UTC (permalink / raw)
  To: SE Linux

After the 3rd reading, I think I finally "got it" - the policy part,
that is. Objects, Domains, Types, Roles, you name it.

So, I'm now at the "learning by example" stage. I'm looking through the
example policy files, trying to understand what they do. I use that
apol tool to analyse it as well as looking through the raw files.


Now a question: One thing I'd like to write a policy about is a
seperated webserver. I *think* it can be done.

Scenario: Webhosting with PHP, multiple users (possibly many)
Danger: PHP runs as a module, i.e. with apache's user and permissions.
that means it is trivial for every user to acess other user's files,
including .php files that may include things like database passwords.

Solution: domain transition to individual user's domain when reading a
file of that user. something like
domain_auto_trans(httpd_t, user_webdata_t, user_t)
should do the trick (I say "something like" because this macro expands
to include only execution, but I see no reason why the same can't be
done for file open or read).

The tricky part is that the apache will have to revert BACK to its
original domain once the operation is done, i.e. something like "on
socket close, domain transition to httpd_t". however, the user_t domain
should not have the general ability to make a transition to httpd_t.

Am I making any sense? Or do I need to read the papers again? :)


-- 
http://web.lemuria.org/pubkey.html
pub  1024D/D88D35A6 2001-11-14 Tom Vogt <tom@lemuria.org>
     Key fingerprint = 276B B7BB E4D8 FCCE DB8F  F965 310B 811A D88D 35A6

--
You have received this message because you are subscribed to the selinux 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] 22+ messages in thread
* Policy question
@ 2002-05-02 10:11 Reino Wallin
  0 siblings, 0 replies; 22+ messages in thread
From: Reino Wallin @ 2002-05-02 10:11 UTC (permalink / raw)
  To: SELinux

I have defined a few nodes as well as a few interfaces in network.te,
and net_contexts.

In the te files for the standalone proxies (http and generic) the
following will do:

# Allow the domain to send to any node.
allow http_proxy_t node_type:node { tcp_send tcp_recv };

However, the same approach doesn't work in the inetd.te. Avc error
messages appears, and the following rules are supposed to be added.

# Allow the domain to send to any node.
allow inetd_t node_admin_t:node { tcp_send tcp_recv };
allow inetd_t node_dmz_t:node { tcp_send tcp_recv };
allow inetd_t node_vpn_t:node { tcp_send tcp_recv };
allow inetd_t node_internal_t:node { tcp_send tcp_recv };
allow inetd_t node_external_t:node { tcp_send tcp_recv };

If I add theese rules, then also the proxies that is executed from the
inetd works fine in enforcing mode.

Why are theese fine grained rules needed in the inetd.te but not in the
other te files?

Reino



--
You have received this message because you are subscribed to the selinux 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] 22+ messages in thread

end of thread, other threads:[~2002-05-02 10:11 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-04-18  9:22 policy question Tom
2002-04-18 10:44 ` Russell Coker
2002-04-18 12:25   ` Tom
2002-04-18 14:51     ` Russell Coker
2002-04-18 15:15       ` Tom
2002-04-18 15:32         ` Stephen Smalley
2002-04-18 16:21           ` Tom
2002-04-18 18:28             ` Russell Coker
2002-04-18 20:40               ` Tom
2002-04-18 21:47                 ` Russell Coker
2002-04-19  6:30                   ` Tom
2002-04-18 16:08         ` Russell Coker
2002-04-18 16:32           ` Tom
2002-04-18 18:47             ` Russell Coker
2002-04-18 20:49               ` Tom
2002-04-18 21:44                 ` Russell Coker
2002-04-19  6:14                   ` Tom
2002-04-19  9:10                     ` Russell Coker
2002-04-19 12:27                       ` Tom
2002-04-19 15:02             ` Stephen Smalley
2002-04-18 15:22 ` Stephen Smalley
  -- strict thread matches above, loose matches on Subject: below --
2002-05-02 10:11 Policy question Reino Wallin

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.