I want to test/automate some repositories, the basic flow is something like:
repos := []string{"repo 1", "repo 2", ...}
for r := range repos {
// git clone the repo
// cd repo dir
// make test
// make build
// ...
}
I am doing this with GO using os.exec
to call the all the series of commands, something like:
exec.Command("sh", "-c", "git clone project")
So far so good, but I would like to know if there is a way to secure/protect against something miswriting on the Makefile that could be doing something like rm -rf /
. and break my host.
Basically I would like to use the system libraries/tools but restrict/chroot only the output to a specific workdir
, so that I can avoid pre-build a chroot for this.
A working solution is to use a FreeBSD jail, but I would like to know if there an alternative/secure way of doing this without the need of containers,virtualbox,etc; and using a basic Mac OS X workstation. so that anyone could "safely" run & test without worries.
Any ideas ?