Sponsored Content
Full Discussion: Sandboxing
Top Forums Programming Sandboxing Post 302965351 by jim mcnamara on Wednesday 27th of January 2016 04:11:23 PM
Old 01-27-2016
Direct answer: not really feasible

Simple usable answer:
As root create the environment
Code:
groupadd no-int
useradd -g no-int testuser
mkdir /home/testuser # if dir does not exist.

#Add iptables entry:
iptables -A OUTPUT -m owner --gid-owner no-int -j DROP

For each time you want to run a new file
Code:
#To set up for a test run as root 
cp filetotest /home/testuser
chown testuser:no-int /home/testuser/filetotest
chmod 755 /home/testuser/filetotest

Code:
#to test the file in protected mode (as root)
su - testuser -c 'sg ./filetotest "parm1 parm2 ..." '

 
iptables-apply(8)					      System Manager's Manual						 iptables-apply(8)

NAME
iptables-apply - a safer way to update iptables remotely SYNOPSIS
iptables-apply [-hV] [-t timeout] ruleset-file DESCRIPTION
iptables-apply will try to apply a new ruleset (as output by iptables-save/read by iptables-restore) to iptables, then prompt the user whether the changes are okay. If the new ruleset cut the existing connection, the user will not be able to answer affirmatively. In this case, the script rolls back to the previous ruleset after the timeout expired. The timeout can be set with -t. When called as ip6tables-apply, the script will use ip6tables-save/-restore instead. OPTIONS
-t seconds, --timeout seconds Sets the timeout after which the script will roll back to the previous ruleset. -h, --help Display usage information. -V, --version Display version information. SEE ALSO
iptables-restore(8), iptables-save(8), iptables(8). LEGALESE
iptables-apply is copyright by Martin F. Krafft. This manual page was written by Martin F. Krafft <madduck@madduck.net> Permission is granted to copy, distribute and/or modify this document under the terms of the Artistic License 2.0. 2006-06-04 iptables-apply(8)
All times are GMT -4. The time now is 06:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy