Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No exception raised when testing #45

Open
odevia opened this issue Jun 19, 2016 · 1 comment
Open

No exception raised when testing #45

odevia opened this issue Jun 19, 2016 · 1 comment

Comments

@odevia
Copy link

odevia commented Jun 19, 2016

Hi,
I'm trying to install codejail.
I followed all the instructions but when i run this code

import codejail.jail_code
codejail.jail_code.configure('python', '/home/jail/env/sandenv/bin/python', 'sandbox')
import codejail.safe_exec
codejail.safe_exec.safe_exec("import os\nos.system('ls /etc')", {})

It runs but doesn't raise any exceptions or error.
Here is my configurations:

ls -al
total 16
drwxrwxr-x 4 jail jail 4096 19 18:37 .
drwxr-xr-x 22 jail jail 4096 19 18:39 ..
drwxrwxr-x 7 jail jail 4096 19 18:37 main
drwxr-xr-x 7 jail jail 4096 19 14:49 sandenv

/etc/apparmor.d/home.jail.env.sandenv.bin.python

#include <tunables/global>

/home/jail/env/sandenv/bin/python {
    #include <abstractions/base>
    #include <abstractions/python>

    /home/jail/env/sandenv/** mr,
    # If you have code that the sandbox must be able to access, add lines
    # pointing to those directories:
    /home/jail/env/sandenv/lib/python2.7/site-packages/** r,

    /tmp/codejail-*/ rix,
    /tmp/codejail-*/** wrix,
}

/etc/sudoers.d/01-sandbox

jail ALL=(sandbox) SETENV:NOPASSWD:/home/jail/env/sandenv/bin/python
jail ALL=(sandbox) SETENV:NOPASSWD:/usr/bin/find
jail ALL=(ALL) NOPASSWD:/usr/bin/pkill

Any idea?

@shubhamjain0594
Copy link

shubhamjain0594 commented Feb 27, 2018

Me too. Unable to get exception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants