Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requirements for Managment APIs #298

Open
relu91 opened this issue Feb 8, 2021 · 5 comments
Open

Requirements for Managment APIs #298

relu91 opened this issue Feb 8, 2021 · 5 comments
Labels
for next iteration Planned or postponed topics for the future priority: low Issues that might be deferred for later Security use case Describes a scenario that may be useful for technical decisions

Comments

@relu91
Copy link
Member

relu91 commented Feb 8, 2021

As disccussed in today's security call with @mmccool. We need to identify a set of requirements for APIs that handles runtime configuration and security initialization (i.e., fill secrets). Prescribing those requirements can help to make assumptions in the description of the Scripting API. For example in the newly added ExposedThingInit algorithm we could refer to the presence of a set of securityDefinitions configured with such API.

I think this addition could help also implementers to know how to handle out-of-band security data and protocol binding configurations.

Related work (kindof): https://github.com/w3c/wot-scripting-api/tree/master/applications/script-manager

Related:
#289 (comment)

@relu91 relu91 changed the title Requirements for _Managment_ APIs Requirements for Managment APIs Feb 8, 2021
@danielpeintner danielpeintner added the for next iteration Planned or postponed topics for the future label Mar 8, 2021
@relu91
Copy link
Member Author

relu91 commented Apr 26, 2021

In the last call, we decided that it is best to start from use cases and think more about practical problems. In this comment, I'll try to report our needs for APIs that configure security parameters.

In practice, the use case is pretty simple, in our applications the set of the web things is never static. We can't know at the dev time or at deployment time which thing will be consumed by a particular script. The reason is pretty simple: discovery. So script A uses a particular discovery method to find and consume X WebThings. To keep things simple let's assume that at least we know that in our deployment ALL WebThings uses a user and password security scheme. However, each one of them may use different pairs of user&password, some of them it maybe even unknown (it needs to be provided at runtime).

With the current API, we don't have any means to provide user&password at runtime. Notice that we are talking about ConsumedThings so even in light of the recent development we are in the lowest privilege regime (so we can't access system resources). Therefore, I agree that we should allow scripts to arbitrarily manipulate security information passing to the underlying runtime. However, we CAN improve the situation providing API enppoints to request security configuration to the runtime.

I see this pretty similar to what a browser does when you are trying to connect to an HTTP resource protected with user&password. The platform prompts the user a form to fill in the required information. In our context, we can reproduce this behavior and let choose the implementation the preferred method to retrieve the security information it needs, (command line prompt, email, open a web page, etc.).

@zolkis
Copy link
Contributor

zolkis commented Apr 26, 2021

One group of functions would be script management, tied to relevant permissions.

typedef ScriptHandle USVString;  // opaqie id, e.g. UUID, hash, ...

interface WoTScriptManager {
  Promise<ScriptHandle> install(USVString script, optional unsigned long bootSequence); 
  Promise<undefined> run(ScriptHandle handle);
  Promise<undefined> stop(ScriptHandle handle); 
  Promise<undefined> uninstall(ScriptHandle handle);  // stop, unmark for boot, delete
};

The attached permissions could be permissions.script.{install, run}.

When bootSequence is provided to install(), the script should be marked to run at startup with specified priority (lower number = higher priority).

We could have a use case for suspend() as well, not really needed for now.

@danielpeintner
Copy link
Contributor

With the current API, we don't have any means to provide user&password at runtime. Notice that we are talking about ConsumedThings so even in light of the recent development we are in the lowest privilege regime (so we can't access system resources).

@relu91 do you use addCredentials() from node-wot to add those credentials at runtime?

Having said that, from the security point of view this is not secure.
We need a well defined and secure way to add credentials... for server and client side...

@egekorkan
Copy link
Contributor

Related issue in node-wot by the way: eclipse-thingweb/node-wot#301

@mmccool
Copy link
Contributor

mmccool commented Nov 8, 2021

Thoughts:

  • Use of MUDS to control network accesses from devices
  • Managing key material using existing standards for secure storage: Vaults, TPMs, etc.
  • Putting management API in a separate repo might be a good idea; current "scripting API" can be focused on "isolated" and "controlled" code.

@mmccool mmccool added the security-tracker Group bringing to attention of security, or tracked by the security Group but not needing response. label Dec 13, 2021
@danielpeintner danielpeintner removed the security-tracker Group bringing to attention of security, or tracked by the security Group but not needing response. label Oct 3, 2023
@relu91 relu91 added use case Describes a scenario that may be useful for technical decisions priority: low Issues that might be deferred for later labels Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for next iteration Planned or postponed topics for the future priority: low Issues that might be deferred for later Security use case Describes a scenario that may be useful for technical decisions
Projects
None yet
Development

No branches or pull requests

5 participants