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

Script tag extension: Per-Module Network Isolation #6547

Closed
ghost opened this issue Apr 1, 2021 · 1 comment
Closed

Script tag extension: Per-Module Network Isolation #6547

ghost opened this issue Apr 1, 2021 · 1 comment
Labels
addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest

Comments

@ghost
Copy link

ghost commented Apr 1, 2021

Context

Ongoing discussions are being made around the idea that Web Applications should be secure by default, and thus offline first.

That is, when distributed as downloadable Web Bundles, they should not have internet access by default, and network access should be granted based on user permissions. However, in order to not compromise the security of the application when allowing network access, developers should also be able to scope that access to specific parts of the application.

This is the goal of the present proposal of extending the script tag for per-module network isolation in the context of Web Applications.

Proposal

Similarly to Deno's permissions model, the allow-net attribute could be used to restrict network access to specific domain(s) on a per-module basis. In the following example, in the context of an offline first Web Application, the module index.js has gained network access only for the hosting domain https://application.com:

<script type="module" src="index.js" allow-net="https://application.com"></script>

Per-Module Network isolation would allow to better isolate the parts of the application that need internet access from the others, also enhancing the audit of the application by third-party controls.

Example

An offline application could only use network access for the login.js module, in order to log in a user, while the rest of the application would stay offline:

<script type="module" src="login.js" allow-net="https://login.application.com"></script>
@domenic
Copy link
Member

domenic commented Apr 6, 2021

Closing per whatwg/fetch#1209 (comment).

@domenic domenic closed this as completed Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition/proposal New features or enhancements needs implementer interest Moving the issue forward requires implementers to express interest
Development

No branches or pull requests

1 participant