All of lore.kernel.org
 help / color / mirror / Atom feed
* Confining a Java process reading file
@ 2017-04-04 15:50 Rahmadi Trimananda
  2017-04-04 16:26 ` Stephen Smalley
  0 siblings, 1 reply; 12+ messages in thread
From: Rahmadi Trimananda @ 2017-04-04 15:50 UTC (permalink / raw)
  To: selinux

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

Hey Guys,

I am trying to confine a Java process that I have so that it will be able
to read only certain files. This is my experiment setup for my folder.
Basically a.out (C program) and Test.class (Java class) are coded to read
and print out the text in test.txt.

    unconfined_u:object_r:httpd_t:SystemLow a.out
unconfined_u:object_r:user_home_t:SystemLow test.c
    unconfined_u:object_r:httpd_t:SystemLow Test.class
unconfined_u:object_r:user_home_t:SystemLow Test.java
unconfined_u:object_r:user_home_t:SystemLow test.txt

I tried to change the type label for a.out from user_home_t to httpd_t just
for the sake of the experiment. With this setup, a.out is no longer able to
read test.txt in enforcing mode. However, I seem to not be able to do it
for Test.class as it's running on a JVM. The java label is "bin_t". And I
checked using this:

sesearch -s bin_t -t user_home_t -c file -p read -Ad

And it doesn't seem to have a rule that allows bin_t to read a file with
user_home_t label.

What's the right way to do this if any? Then, I also try to confine port
accesses for Test.class, e.g. I only allow it to access ports 1234 and
2345. Same question, what's the right way to do this?

Kind regards,
Rahmadi

[-- Attachment #2: Type: text/html, Size: 1562 bytes --]

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

end of thread, other threads:[~2017-04-05 16:17 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-04 15:50 Confining a Java process reading file Rahmadi Trimananda
2017-04-04 16:26 ` Stephen Smalley
2017-04-04 16:37   ` Rahmadi Trimananda
2017-04-04 17:17     ` Stephen Smalley
2017-04-04 17:44       ` Rahmadi Trimananda
2017-04-04 17:54         ` Stephen Smalley
2017-04-04 19:15           ` Stephen Smalley
2017-04-04 22:51             ` Rahmadi Trimananda
2017-04-04 22:52               ` Rahmadi Trimananda
2017-04-04 22:53                 ` Rahmadi Trimananda
2017-04-05 14:00                 ` Stephen Smalley
2017-04-05 16:17                   ` Rahmadi Trimananda

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.