Security/Contextual Identity Project/Containers: Difference between revisions

Updating to match most recent implementation details
(Minor rewording of first paragraph)
(Updating to match most recent implementation details)
Line 2: Line 2:
{{warning|This is just a draft proposal of how [[Security/Contextual Identity Project|contextual identities]] might be implemented in Firefox}}
{{warning|This is just a draft proposal of how [[Security/Contextual Identity Project|contextual identities]] might be implemented in Firefox}}
[[File:Containers.png|200px|thumb|right|Mock-up of what this might look like]]  
[[File:Containers.png|200px|thumb|right|Mock-up of what this might look like]]  
==Description==
==Description==


Individuals behave differently in the world when they are in different contexts. The way they act at work may differ from how they act with their family. Similarly, users have different contexts when they browse the web.  They may not want to mix their social network context with their work context. The goal of this project is to allow users to separate these different contexts while browsing the web on Firefox. Each context will have its own local state which is separated from the state of other contexts.
Individuals behave differently in the world when they are in different contexts. The way they act at work may differ from how they act with their family. Similarly, users have different contexts when they browse the web.  They may not want to mix their social network context with their work context. The goal of this project is to allow users to separate these different contexts while browsing the web on Firefox. Each context will have its own local state which is separated from the state of other contexts.


[[File:Containers-side-by-side-cropped.png|500px|frameless]]
[[File:Containers-side-by-side-cropped.png|700px|frameless]]
 
==How to Use Containers==
 
The containers feature can be enabled in Nightly by going to `about:config` and setting the `privacy.userContext.enabled` pref to true. Once enabled, containers will integrate seamlessly into your current browsing experience.  You will have the option to open entirely new browsing contexts, which will have their browser storage (such as cookies or localStorage) separated from other containers. Your normal tabs, which we consider to exist in the ''default container'', will still look and act as you'd expect them to before enabling containers.
 
Container tabs operate just as you would expect a normal tab to, except for the fact that the sites you visit will have access to a separate slice of the browser's storage. This means your site preferences, logged in sessions, and advertising tracking data won't carry over to the new container. Likewise, any browsing you do within the new container will not affect the preferences, logged in sessions, or tracking data of your other containers.
 
There are several ways to open new containers:
 
===File Menu===
 
In the OS menu bar, click "File" -> "New Container Tab". From here you can choose from one of the four pre-defined containers (Home, Work, Banking, and Shopping). After choosing one of these, you will see a new tab from that container appear in the tab strip.
 
===Hamburger Menu===
 
To access the hamburger menu, you must restart your browser after setting `privacy.userContext.enabled` to true. Once this is done, click the hamburger menu (three horizontal bars on the right hand side of the browser), and then click "Customize". From here, you'll find the "Open Container Tab" icon under the "Additional Tools and Features" section of the icons.
 
You can drag this icon to the right side of the URL bar.


Separated by Containers:
Alternatively, you can place the icon in the dropdown hamburger menu.
* Cookies
 
* localStorage
===Open links in new tabs and containers===
* indexedDB
 
* HTTP data cache
It's possible to open links in a new and/or different container. Right click on any link, select "Open link in New Container Tab", and then select the desired container tab.
* Image Cache
* Any other areas supported by OriginAttributes [https://bugzilla.mozilla.org/show_bug.cgi?id=1179985 Bug 1179985]


Not separated by Containers:
Holding the "Control" key on Windows or Linux (or the "Command" key on Mac) while clicking a link will open it in a new tab. The new tab will open within the same container as the previous tab. This includes both the default container and in any of the predefined containers.
* History
* Bookmarks
* Saved Passwords
* Saved Search and Form data
* HSTS Flags
* OCSP Responses
* Security Exceptions for Invalid TLS Certificates


==Benefits and Use Cases==
==Benefits and Use Cases==
Line 61: Line 71:
* Personal (to use at home)
* Personal (to use at home)
* Work (to use at the office)
* Work (to use at the office)
* Banking (for accessing sites with financial or sensitive informations)
* Banking (for accessing sites with financial or sensitive information)
* Shopping (for accessing ecommerce sites)
* Shopping (for accessing ecommerce sites)
* Custom (for future versions)
* Custom [available in future versions]


Through naming and onboarding, we gently encourage users to use different containers for different purposes, as the separation is necessary to gain the benefits above. A purpose-specific container can have many sites in it:
Through naming and onboarding, we gently encourage users to use different containers for different purposes, as the separation is necessary to gain the benefits above. A purpose-specific container can have many sites in it:
Line 70: Line 80:
* The Shopping container can be a place for Amazon, Alibaba, and other stores
* The Shopping container can be a place for Amazon, Alibaba, and other stores


===Default Container===
==Implementation Details==


By creating containers, we also create a notion of sites that exists ''outside'' of a container. By default, all of a user's browsing prior to enabling the feature is considered to be in the ''default'' container. Additionally, any browsing that occurs after the feature has been turned on, but not in a named container is considered to be in the default.
===What is (and isn't) separated between Containers===


Our goal is to match the navigation experience that users currently expect during a session without containers. This necessitates a few behaviors when you navigate from inside a container:
Separated by Containers:
* Cookies
* localStorage
* indexedDB
* HTTP data cache
* Image Cache
* Any other areas supported by originAttributes [https://bugzilla.mozilla.org/show_bug.cgi?id=1179985 Bug 1179985]
 
Not separated by Containers:
* History
* Bookmarks
* Saved Passwords
* Saved Search and Form data
* HSTS Flags
* OCSP Responses
* Security Exceptions for Invalid TLS Certificates
 
You can find more information on the implementation of the project by looking through the Contextual Identity / Containers meta-bug, [https://bugzilla.mozilla.org/show_bug.cgi?id=1191418 Bug 1191418].


Manually-invoked navigation:
===An extended origin===


* Right click menu will have two additional options
An origin is defined as a combination of a scheme, host and port. Browsers make numerous security decisions based off of the origin of a resource using the same-origin-policy.  Various features can be re-imagined as simply adding another key to the origin check. These include the Tor Browser’s work on [https://bugzilla.mozilla.org/show_bug.cgi?id=1260931 First Party Isolation], Private Browsing Mode, the [https://w3c.github.io/webappsec-suborigins/ SubOrigin Proposal], and Containers.
** Open Link in New Tab (this opens the link in the default container)
** Open Link in New Container Tab (this opens the link in a specified container)
* Command-clicking a link will open that link in a new tab in the same container


Site-invoked navigation:
Hence, Gecko has added additional attributes to the origin called OriginAttributes.  When trying to determine if two origins are same-origin, Gecko will not only check if they have matching schemes, hosts, and ports, but now also check if all their OriginAttributes match.


* window.open always open in the same container as the site that opened it, so as not to break single sign-on
Containers adds a userContextId OriginAttribute.  Each container has a unique userContextId.  Stored site data (like cookies) is now stored with a scheme, host, port, and userContextId.  So if a user has example.com cookies for the Shopping userContextId, they will not be accessible by example.com in the Banking Container.
 
Note that one of the motivations in enabling this feature in Nightly is to help ensure that we iron out any bugs that may exist in our OriginAttribute implementation before features that depend on it are rolled out to users.
 
===More information===
 
* OriginAttributes implementation [https://bugzilla.mozilla.org/show_bug.cgi?id=1179985 meta-bug]
* Containers implementation [https://bugzilla.mozilla.org/show_bug.cgi?id=1191418 meta-bug]


==Making containers look different==
==Making containers look different==
Line 91: Line 122:
[[File:Containers-comparison.png|900px|frameless]]
[[File:Containers-comparison.png|900px|frameless]]


Each container could have a different:
Each container has several visual indicators:


* Name: On the File Menu and location bar
* Name: On the location bar
* Icon: On the File Menu and location bar
* Icon: On the location bar
* Color: On the tab and location bar
* Color: On the tab and location bar


==Discovering the feature==
==Discovering the feature==


[[File:Containers-file-menu.PNG|668px|frameless]]
For the initial version, this feature is discoverable via the File menu and hamburger icon menu as discussed above. This makes the feature accessible for those who want to use it, and have no impact on the browsing experience of those who don't. Through user research, we’ve found that many people have only one account per website, and that they don’t currently separate their online selves into work/home/banking/etc.  Containers is not a feature for those users.
 
For the initial version, this feature is discoverable via the File menu and is limited to a few purpose-specific containers. However, on Windows, the File menu is hidden until the user hits the Alt key. In future versions, the Containers menu should be added as an item under the ‘Hamburger’ menu on the right side of the toolbar.
 
Containers are discoverable for those who want to use them, and have no impact on the browsing experience of those who don't. Through user research, we’ve found that many people have only one account per website, and that they don’t currently separate their online selves into work/home/banking/etc.  Containers is not a feature for those users.


However, we can hook into several user actions and present onboarding messages to encourage container use for users who can benefit from them. We can detect users logging in and out of a service like Twitter that doesn't have support for multiple logins, and offer the feature to them. We can also offer the feature to users when they first try to access their online banking after the feature has been enabled.
However, we can hook into several user actions and present onboarding messages to encourage container use for users who can benefit from them. We can detect users logging in and out of a service like Twitter that doesn't have support for multiple logins, and offer the feature to them. We can also offer the feature to users when they first try to access their online banking after the feature has been enabled.
Line 131: Line 158:
* The website I signed into saves a whole bunch of cookies that are outside of its origin. How will the browser know that these out-of-origin cookies are associated with a specific site container?
* The website I signed into saves a whole bunch of cookies that are outside of its origin. How will the browser know that these out-of-origin cookies are associated with a specific site container?
* Some sites may require that the user interact with multiple top-level origins during a session, or may require cookies from multiple origins.
* Some sites may require that the user interact with multiple top-level origins during a session, or may require cookies from multiple origins.
==Implementation Details==
You can find more information on the implementation of the project by looking through the Contextual Identity / Containers meta-bug, [https://bugzilla.mozilla.org/show_bug.cgi?id=1191418 Bug 1191418].


==Related work==
==Related work==
Confirmed users
25

edits