-
Notifications
You must be signed in to change notification settings - Fork 80
Description
Hi,
Thanks a lot for making this code open source.
I have problems when creating the AppArmor profile. I am using a fresh installation of Ubuntu 14.04 LTS in a machine hosted at Linode.
When I try to run the apparmor_parser, I get the error Warning: unable to find a suitable fs in /proc/mounts, is it mounted?.
Here is my AppArmor profile:
(prueba-sandbox)pepe@li911:~$ cat /etc/apparmor.d/home.pepe.prueba-sandbox.bin.python
#include <tunables/global>
/home/pepe/prueba-sandbox/bin/python {
#include <abstractions/base>
#include <abstractions/python>
/home/pepe/prueba-sandbox/** mr,
# If you have code that the sandbox must be able to access, add lines
# pointing to those directories:
#/the/path/to/your/sandbox-packages/** r,
/tmp/codejail-*/ rix,
/tmp/codejail-*/** wrix,
}
And the error:
(prueba-sandbox)pepe@li911:~$ sudo apparmor_parser /etc/apparmor.d/home.pepe.prueba-sandbox.bin.python
Warning: unable to find a suitable fs in /proc/mounts, is it mounted?
Use --subdomainfs to override.
Also, when I try to use aa-enforce I get this error.
pepe@li911:~$ sudo aa-enforce /etc/apparmor.d/home.pepe.prueba-sandbox.bin.python
Setting /etc/apparmor.d/home.pepe.prueba-sandbox.bin.python to enforce mode.
Traceback (most recent call last):
File "/usr/sbin/aa-enforce", line 30, in <module>
tool.cmd_enforce()
File "/usr/lib/python3/dist-packages/apparmor/tools.py", line 166, in cmd_enforce
raise apparmor.AppArmorException(cmd_info[1])
apparmor.common.AppArmorException: 'Warning: unable to find a suitable fs in /proc/mounts, is it mounted?\nUse --subdomainfs to override.\n'
Note that apparmor is using "/usr/lib/python3/" instead of "/usr/lib/python2.7". Could this be the reason of the error?
Finally, when I try to run the example code I get an error, but I guess that it is related with the previous error:
>>> import codejail.jail_code
>>> codejail.jail_code.configure('python', '/home/pepe/prueba-sandbox/bin/python')
>>> import codejail.safe_exec
>>> codejail.safe_exec.safe_exec("import os\nos.system('ls /etc')", {})
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/pepe/prueba/local/lib/python2.7/site-packages/codejail/safe_exec.py", line 151, in safe_exec
extra_files=extra_files,
File "/home/pepe/prueba/local/lib/python2.7/site-packages/codejail/jail_code.py", line 237, in jail_code
realtime=LIMITS["REALTIME"], rlimits=create_rlimits(),
File "/home/pepe/prueba/local/lib/python2.7/site-packages/codejail/subproc.py", line 42, in run_subprocess
stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
raise child_exception
The only related issue that I found is: https://github.com/edx/configuration/issues/1312
Any help would be very much appreciated! Thanks!