richardartoul / nola

MIT License
74 stars 6 forks source link

Implement actor resource control mechanisms #19

Open richardartoul opened 1 year ago

richardartoul commented 1 year ago

Things that should be constrainable:

  1. CPU usage
  2. Memory usage
  3. Number of scheduled timers (and size of their payload)
  4. Number of scheduled reminders (and size of their payload)
  5. Payload sizes in general
richardartoul commented 1 year ago

Wazero has been updated to support context cancellation so this should be relatively easy now :)

gedw99 commented 1 year ago

Awesome . This gives capabilities for resource usage ?

richardartoul commented 1 year ago

It allows webassembly functions to run with a “deadline” and once the deadline elapses, the webassembly runtime will stop running the function.

it’s not everything you need, but it’s a pretty good start!

richardartoul commented 1 year ago

I have not integrated that into NOLA yet though

gedw99 commented 1 year ago

Just a brain storm... Ideation, etc .

what ya think ??

richardartoul commented 1 year ago

Sorry, I’m not sure what the question is

gedw99 commented 1 year ago

my fault... here goes...

Resource management is a type of Capability Security.

File access, Network access are types of Capability Security.

There seems to be few sides to the coin here perhaps:

PII is also a type of Capability too, where the data flows through the WASM functions or Logging does not have names, addresses, etc. Use Case examples from history are:

WASM computing at the edge is disruptive and PII is part of the danger. Science and Medical need to do WASM compute on others data. Very often in Medical / Science / ML you take the WASM compute to others Data, but you as the data owner want to limit what data flows back to the WASM Compute provider. This is emerging in many other vertical domains.

Virus protection is also a Capability for Operators and Users.
This is a classic Hack opportunity that in a WASM Sandbox world is even worse. Once an Operator or Users allow File and Network access, It's easy to slip in a virus or C&C handler.

https://github.com/corazawaf/coraza is related to this area but i presume does not cover this.

gedw99 commented 1 year ago

Maybe a new Discussion or Issue for this - as soon as i saw Resource Control i remember al the other side channels ...