unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Matthew Keeter <matt.j.keeter@gmail.com>
To: Roberto Baleno <roberto.baleno@gmail.com>
Cc: guile-user@gnu.org
Subject: Re: Embedding Guile with sandboxing
Date: Mon, 23 Nov 2015 09:55:47 -0500	[thread overview]
Message-ID: <C15AB3DE-EA3D-42F6-921F-933C49259A15@gmail.com> (raw)
In-Reply-To: <CAO5yBSk5CVXk31=hB_0VrerbJcv+SKRXvuQSf+2C-F7pyhbU=Q@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2998 bytes --]

Context: Antimony is a tool for computer-aided design that makes heavy use of
user-defined scripts (http://www.mattkeeter.com/projects/antimony).

I’m considering other languages, either for Antimony or future projects.
Python is great, but I’m running into two main issues:

It’s hard to distribute:
You need to include a full Python distribution in your application

It’s hard to sandbox:
chroot / unprivileged user works on Mac / Linux but not Windows, and makes the
application more complicated — do I need to write some kind of unprivileged daemon
that’s doing all of the dangerous evaluation and talking with the main application?

(also, it’s required that you include Python.h before any other headers, which is a
small but persistent nuisance).

Thanks to all for the tips: it sounds like Guile isn’t a silver bullet, but I’ll definitely keep it
in mind for future projects.

Regards,
Matt

On Nov 22, 2015, at 7:50 PM, Roberto Baleno <roberto.baleno@gmail.com> wrote:

> I've also been thinking about this issue with an embedded language I am developing in Guile.  How about the good old metacircular evaluator:
> 
> https://mitpress.mit.edu/sicp/full-text/sicp/book/node76.html
> 
> BTW, Matt, are you porting "Antimony" to Guile? :)
> 
> --Bert
> 
> 
> On Sun, Nov 22, 2015 at 3:51 PM, Christopher Allan Webber <cwebber@dustycloud.org> wrote:
> Matthew Keeter writes:
> 
> > I’m currently embedding Python in a C / C++ application that evaluates
> > user-provided scripts.
> >
> > Obviously, this is terribly unsafe: user-provided scripts can execute
> > arbitrary malicious actions, and there’s no good way to sandbox Python
> > in a desktop context.
> >
> > If I were to replace Python with Guile, is there a way to sandbox it
> > so that arbitrary (perhaps malicious) user-provided scripts can be run
> > safely?
> >
> > Regards,
> > Matt
> 
> I think there's nothing in Guile that provides sandboxing currently.
> 
> A path towards it is possible though: a limited subset of guile in a
> capability security based environment could probably provide the
> features desired.  See the Rees Thesis:
> 
>   http://mumble.net/~jar/pubs/secureos/secureos.html
> 
> Wingo has written about it with respect to Guile:
> 
>   http://wingolog.org/archives/2011/03/19/bart-and-lisa-hacker-edition
> 
> I have thought about how this could be achieved in the Guile-verse.  My
> suspicion is that the best way to achieve it is to provide a new
> language layer on the compiler tower which is "mostly scheme", but only
> exposes a number of deemed-safe operators by default, and provides a
> mechanism to add further procedures to the default environment.
> Everything from there on out takes the "capability security through
> lexical scope and the labmda calculus" approach described in the Rees
> Thesis.
> 
> However, this doesn't exist in Guile at present.  I'd love to see it
> exist, though.
> 
>  - Chris
> 
> 


[-- Attachment #2: Type: text/html, Size: 4442 bytes --]

  reply	other threads:[~2015-11-23 14:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-21 18:35 Embedding Guile with sandboxing Matthew Keeter
2015-11-21 21:39 ` Pascal J. Bourguignon
2015-11-24 16:35   ` Amirouche Boubekki
2015-11-21 21:40 ` Thompson, David
2015-11-22 10:06 ` Arne Babenhauserheide
2015-11-25 11:07   ` tomas
2015-11-22 15:51 ` Christopher Allan Webber
2015-11-23  0:50   ` Roberto Baleno
2015-11-23 14:55     ` Matthew Keeter [this message]
2015-11-25 14:36       ` Christopher Allan Webber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C15AB3DE-EA3D-42F6-921F-933C49259A15@gmail.com \
    --to=matt.j.keeter@gmail.com \
    --cc=guile-user@gnu.org \
    --cc=roberto.baleno@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).