All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Policy tests failed
@ 2006-11-02 10:01 Daniel Gil Mayol
  2006-11-02 13:50 ` Stephen Smalley
  0 siblings, 1 reply; 10+ messages in thread
From: Daniel Gil Mayol @ 2006-11-02 10:01 UTC (permalink / raw)
  To: selinux

Hello, I still have some problems with the policy tests.

I am testing that a domain can execute files that are defined in the 
policy. For example, lets take tripwire. In the policy is defined that:

    can_exec($1_t, shell_exec_t);
    can_exec($1_t, bin_t);

That means that tripwire_t domain is allowed to execute files labeled 
with shell_exec_t and bin_t.

The test first relabel as shell_exec_t a copy that I made previously of 
/bin/ls (this copy is under my test directory):

    [root@cnsu PolicyTest]# chcon -u system_u -r object_r -t shell_exec_t ls

Then I try to execute ls (under the domain tripwire_t) over a file 
called '/policytest' defined as:

    -rw-r--r--  root     root     system_u:object_r:policy_test_t 
    policytest

where policy_test_t is:

    type policy_test_t, file_type;
    allow * policy_test_t:file getattr;

But this execution fail:

    [root@cnsu PolicyTest]# runcon -t tripwire_t ./ls /policytest
    execvp: Permission denied

The /var/log/messages shows this:

Nov  2 11:06:46 cnsu kernel: audit(1162465606.392:25664): avc:  denied  
{ entrypoint } for  pid=27705 comm="runcon" name="ls" dev=hda2 
ino=240308 scontext=root:system_r:tripwire_t 
tcontext=system_u:object_r:shell_exec_t tclass=file

The question is... should I define for all the services this file 
entrypoint or I am doing something wrong in my test?
I would like to avoid to write all these entrypoints.


Thanks for your help

Dani






--
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] 10+ messages in thread
* Policy tests failed
@ 2006-10-19 15:00 Daniel Gil Mayol
  2006-10-19 18:30 ` Stephen Smalley
  0 siblings, 1 reply; 10+ messages in thread
From: Daniel Gil Mayol @ 2006-10-19 15:00 UTC (permalink / raw)
  To: selinux

I am writting a policy over a RHEL4 customized kernel. I want to extend the 
current targeted policy (there are some new services to define a policy).

I want to test the policy, that is, the services should not have access 
(read/write/execute) to data that are not allowed. 
So I have written a script "exectest.py" labelled with a security context 
"system_u:object_r:XXX_t" where "type XXX_t, file_type;".

Lets say that we are testing the service "crond", so I execute "exectest.py 
crond". The first that do this script is execute an "id" and become the next:

uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6
(disk),10(wheel) context=root:system_r:unconfined_t

Then the script try to read, write and execute files out of "crond_t" domain, 
that is, files labelled with types that I haven't allowed (for example bin_t, 
httpd_t). And the result is that it can.

I have tried also to write in the policy for example "neverallow crond_t 
bin_t : file { read write execute };" but still can access to these data.

When I execute this script, which domain it has? 
Can it be that it works in the unconfined domain and it has access to 
everything?

Thanks

--
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] 10+ messages in thread

end of thread, other threads:[~2006-11-02 14:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-02 10:01 Policy tests failed Daniel Gil Mayol
2006-11-02 13:50 ` Stephen Smalley
2006-11-02 14:07   ` Daniel Gil Mayol
  -- strict thread matches above, loose matches on Subject: below --
2006-10-19 15:00 Daniel Gil Mayol
2006-10-19 18:30 ` Stephen Smalley
2006-10-20 12:58   ` Daniel Gil Mayol
2006-10-20 17:40     ` Stephen Smalley
2006-10-23  8:50       ` Daniel Gil Mayol
2006-10-23 12:59         ` Stephen Smalley
2006-10-25  5:44       ` Nayak Debabrata-a22788

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.