Re: Programmatic and security models for IoT

Mike Stay <[email protected]> Thu, 5 Feb 2015 13:49:23 -0800
Newsgroups gmane.comp.capabilities.general
Message-ID <CAAvuwX-SJxv_zCtEpFv_r6aQf_eiG3p8GeNZ8ycw67TU1ZWSDw@mail.gmail.com>
It seems like you're specifically ignoring things like cross-site
request forgery attacks, which are prevented using web-keys and the
like; basically you solve those problems by thinking of your web pages
as objects where the UI is the public API.

As far as security on the page:

1) Are you rendering user-submitted content? E.g. will you be echoing
back the name of "Robert<script>alert(1)</script>"?

If so, use Soy with strict contextual auto-escaping or jslayout with
strict mode enabled and a frame with default-src or script-src CSP
(https://developer.mozilla.org/en-US/docs/Web/Security/CSP/CSP_policy_directives)
that prevents scripts like textual onclick and onerror handlers.

2) Are you running code from third parties (other than the libraries
you're using) AND do you need confinement, i.e. do you need to prevent
the plugins from contacting the network?  E.g. you've written a
photoshop clone and you're using JavaScript as a scripting language
for plugins, but you don't want the plugins to leak the images you're
working on.

If so, use initSES on the client side and provide your ocap API to the
global scope of the plugin code.  You should not directly expose the
DOM unless you want the headache of an incomplete emulation of the
DOM; if you're OK with that, use Caja.

If you need plugins but don't need confinement, then you can run the
user code in a web worker or a sandboxed iframe with a random
subdomain and communicate with it via postMessage.

If you can manage to think of your libraries as user code and interact
with them via SES or a separate iframe, all the better.

On Thu, Feb 5, 2015 at 10:46 AM, Raoul Duke <[email protected]> wrote:
> Someone pretty please summarize: If I want to write (a) secure as
> possible today (b) yet still interop with the libraries I will want
> [yes, that will probably insert security holes, I know] all (c) in
> javascript and (d) won't dry up over night leaving me stranded with an
> unsupported compiler...
>
> ...then what do I download & install? Caja? SE5? SES? Waterken?
> Something else? :-) As a Joe Programmer In The Street, what is the
> simplest way to get started?
>
> thank you!
> _______________________________________________
> cap-talk mailing list
> [email protected]
> http://www.eros-os.org/mailman/listinfo/cap-talk



-- 
Mike Stay
[email protected]