Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Provide secure implementation of AccountStorage #2229

Closed
csadilek opened this issue Mar 1, 2019 · 9 comments
Closed

Provide secure implementation of AccountStorage #2229

csadilek opened this issue Mar 1, 2019 · 9 comments
Assignees
Labels
E8 Estimation points: 8 🌟 feature New functionality and improvements <firefox-accounts> Component: FxA <sync> Component: sync-logins
Milestone

Comments

@csadilek
Copy link
Contributor

csadilek commented Mar 1, 2019

This is so we have an encrypted AccountStorage implementation to be used by Fenix.

┆Issue is synchronized with this Jira Task

@csadilek csadilek added 🌟 feature New functionality and improvements <firefox-accounts> Component: FxA <sync> Component: sync-logins labels Mar 1, 2019
@csadilek
Copy link
Contributor Author

csadilek commented Mar 1, 2019

/cc @grigoryk

@rfk
Copy link
Contributor

rfk commented Mar 4, 2019

Related: mozilla-mobile/reference-browser#121

Would this mean that the user has to "unlock" the app before it can sync, rather than syncing periodically in the background?

@csadilek
Copy link
Contributor Author

csadilek commented Mar 5, 2019

I forgot that lib-dataprotect requires API 23. Changing the title for now.

@csadilek csadilek changed the title Provide implementation of AccountStorage based on lib-dataprotect Provide secure implementation of AccountStorage Mar 5, 2019
@pocmo
Copy link
Contributor

pocmo commented Mar 5, 2019

I forgot that lib-dataprotect requires API 23. Changing the title for now.

I came here to mention that :D

@grigoryk
Copy link
Contributor

grigoryk commented Apr 8, 2019

Marking as "maybe" right now because the current behaviour is in-line with what Fennec does. This will be an improvement.

@ghost ghost removed the MaybeFenix? label Apr 12, 2019
@ghost ghost added this to the After Fenix MVP milestone Apr 12, 2019
@ghost
Copy link

ghost commented Apr 12, 2019

Moving out of Fenix backlog - we will document this choice.

@vesta0 vesta0 added the P2 label May 6, 2019
@vesta0 vesta0 removed the P2 label Jul 9, 2019
@rfk
Copy link
Contributor

rfk commented Oct 21, 2019

I forgot that lib-dataprotect requires API 23

From slack conversations, I got the impression that we may have found a way to lower this requirement by falling back to a different crypto method (RSA instead of AES maybe?).

@mcomella
Copy link
Contributor

I forgot that lib-dataprotect requires API 23

From slack conversations, I got the impression that we may have found a way to lower this requirement by falling back to a different crypto method (RSA instead of AES maybe?).

Here's a list of the supported ciphers at which API levels. Before deciding, please also test on Fire TV hardware which may support a different subset at various API levels.

@Amejia481 Amejia481 added E5 Estimation points: 5 E8 Estimation points: 8 E3 Estimation points: 3 and removed E5 Estimation points: 5 labels Oct 28, 2019
@rocketsroger rocketsroger removed the E3 Estimation points: 3 label Oct 28, 2019
@grigoryk
Copy link
Contributor

grigoryk commented Nov 7, 2019

Blocked on #5004

grigoryk pushed a commit to grigoryk/android-components that referenced this issue Nov 14, 2019
grigoryk pushed a commit to grigoryk/android-components that referenced this issue Nov 14, 2019
grigoryk pushed a commit to grigoryk/android-components that referenced this issue Nov 14, 2019
This patch adds a version of `AccountStorage` which is backed by an encrypted-at-rest shared-prefs implementation,
`SecureAbove22Preferences`. As the name suggests, encryption at rest is enabled only for Android API levels 23+.
Otherwise, plaintext storage is used. `SecureAbove22Preferences` will handle API level upgrades behind the scenes,
if necessary.

In order to support rolling this out, `SecureAbove22AccountStorage` automatically migrates account state if it was
present in `SharedPrefAccountStorage`. And vice-versa, `SharedPrefAccountStorage` will automatically migrate account
state if it was present in `SecureAbove22AccountStorage`. This allows applications to easily switch between two
implementations, without any ill-effects.

In order to monitor storage implementations for abnormalities (such as disappearing encryption keys), an optional
`CrashReporter` instance may be configured now via FxaAccountManager.

`DeviceConfig` gained a `secureStateAtRest` flag, which allows applications to specify if they'd like to encrypt
account state. This config object isn't a perfect fit for this flag, but it's close enough conceptually.
grigoryk pushed a commit to grigoryk/android-components that referenced this issue Nov 14, 2019
This patch adds a version of `AccountStorage` which is backed by an encrypted-at-rest shared-prefs implementation,
`SecureAbove22Preferences`. As the name suggests, encryption at rest is enabled only for Android API levels 23+.
Otherwise, plaintext storage is used. `SecureAbove22Preferences` will handle API level upgrades behind the scenes,
if necessary.

In order to support rolling this out, `SecureAbove22AccountStorage` automatically migrates account state if it was
present in `SharedPrefAccountStorage`. And vice-versa, `SharedPrefAccountStorage` will automatically migrate account
state if it was present in `SecureAbove22AccountStorage`. This allows applications to easily switch between two
implementations, without any ill-effects.

In order to monitor storage implementations for abnormalities (such as disappearing encryption keys), an optional
`CrashReporter` instance may be configured now via FxaAccountManager.

`DeviceConfig` gained a `secureStateAtRest` flag, which allows applications to specify if they'd like to encrypt
account state. This config object isn't a perfect fit for this flag, but it's close enough conceptually.
grigoryk pushed a commit to grigoryk/android-components that referenced this issue Nov 14, 2019
This patch adds a version of `AccountStorage` which is backed by an encrypted-at-rest shared-prefs implementation,
`SecureAbove22Preferences`. As the name suggests, encryption at rest is enabled only for Android API levels 23+.
Otherwise, plaintext storage is used. `SecureAbove22Preferences` will handle API level upgrades behind the scenes,
if necessary.

In order to support rolling this out, `SecureAbove22AccountStorage` automatically migrates account state if it was
present in `SharedPrefAccountStorage`. And vice-versa, `SharedPrefAccountStorage` will automatically migrate account
state if it was present in `SecureAbove22AccountStorage`. This allows applications to easily switch between two
implementations, without any ill-effects.

In order to monitor storage implementations for abnormalities (such as disappearing encryption keys), an optional
`CrashReporter` instance may be configured now via FxaAccountManager.

`DeviceConfig` gained a `secureStateAtRest` flag, which allows applications to specify if they'd like to encrypt
account state. This config object isn't a perfect fit for this flag, but it's close enough conceptually.
grigoryk pushed a commit to grigoryk/android-components that referenced this issue Nov 14, 2019
This patch adds a version of `AccountStorage` which is backed by an encrypted-at-rest shared-prefs implementation,
`SecureAbove22Preferences`. As the name suggests, encryption at rest is enabled only for Android API levels 23+.
Otherwise, plaintext storage is used. `SecureAbove22Preferences` will handle API level upgrades behind the scenes,
if necessary.

In order to support rolling this out, `SecureAbove22AccountStorage` automatically migrates account state if it was
present in `SharedPrefAccountStorage`. And vice-versa, `SharedPrefAccountStorage` will automatically migrate account
state if it was present in `SecureAbove22AccountStorage`. This allows applications to easily switch between two
implementations, without any ill-effects.

In order to monitor storage implementations for abnormalities (such as disappearing encryption keys), an optional
`CrashReporter` instance may be configured now via FxaAccountManager.

`DeviceConfig` gained a `secureStateAtRest` flag, which allows applications to specify if they'd like to encrypt
account state. This config object isn't a perfect fit for this flag, but it's close enough conceptually.
grigoryk pushed a commit to grigoryk/android-components that referenced this issue Nov 15, 2019
This patch adds a version of `AccountStorage` which is backed by an encrypted-at-rest shared-prefs implementation,
`SecureAbove22Preferences`. As the name suggests, encryption at rest is enabled only for Android API levels 23+.
Otherwise, plaintext storage is used. `SecureAbove22Preferences` will handle API level upgrades behind the scenes,
if necessary.

In order to support rolling this out, `SecureAbove22AccountStorage` automatically migrates account state if it was
present in `SharedPrefAccountStorage`. And vice-versa, `SharedPrefAccountStorage` will automatically migrate account
state if it was present in `SecureAbove22AccountStorage`. This allows applications to easily switch between two
implementations, without any ill-effects.

In order to monitor storage implementations for abnormalities (such as disappearing encryption keys), an optional
`CrashReporter` instance may be configured now via FxaAccountManager.

`DeviceConfig` gained a `secureStateAtRest` flag, which allows applications to specify if they'd like to encrypt
account state. This config object isn't a perfect fit for this flag, but it's close enough conceptually.
grigoryk pushed a commit to grigoryk/android-components that referenced this issue Nov 19, 2019
This patch adds a version of `AccountStorage` which is backed by an encrypted-at-rest shared-prefs implementation,
`SecureAbove22Preferences`. As the name suggests, encryption at rest is enabled only for Android API levels 23+.
Otherwise, plaintext storage is used. `SecureAbove22Preferences` will handle API level upgrades behind the scenes,
if necessary.

In order to support rolling this out, `SecureAbove22AccountStorage` automatically migrates account state if it was
present in `SharedPrefAccountStorage`. And vice-versa, `SharedPrefAccountStorage` will automatically migrate account
state if it was present in `SecureAbove22AccountStorage`. This allows applications to easily switch between two
implementations, without any ill-effects.

In order to monitor storage implementations for abnormalities (such as disappearing encryption keys), an optional
`CrashReporter` instance may be configured now via FxaAccountManager.

`DeviceConfig` gained a `secureStateAtRest` flag, which allows applications to specify if they'd like to encrypt
account state. This config object isn't a perfect fit for this flag, but it's close enough conceptually.
bors bot pushed a commit that referenced this issue Nov 19, 2019
5053: Closes #2229: Encrypted-at-rest FxA state storage support r=csadilek a=grigoryk

This patch adds a version of `AccountStorage` which is backed by an encrypted-at-rest shared-prefs implementation,
`SecureAbove22Preferences`. As the name suggests, encryption at rest is enabled only for Android API levels 23+.
Otherwise, plaintext storage is used. `SecureAbove22Preferences` will handle API level upgrades behind the scenes,
if necessary.

In order to support rolling this out, `SecureAbove22AccountStorage` automatically migrates account state if it was
present in `SharedPrefAccountStorage`. And vice-versa, `SharedPrefAccountStorage` will automatically migrate account
state if it was present in `SecureAbove22AccountStorage`. This allows applications to easily switch between two
implementations, without any ill-effects.

In order to monitor storage implementations for abnormalities (such as disappearing encryption keys), an optional
`CrashReporter` instance may be configured now via FxaAccountManager.

`DeviceConfig` gained a `secureStateAtRest` flag, which allows applications to specify if they'd like to encrypt
account state. This config object isn't a perfect fit for this flag, but it's close enough conceptually.




Co-authored-by: Grisha Kruglov <[email protected]>
bors bot pushed a commit that referenced this issue Nov 19, 2019
5053: Closes #2229: Encrypted-at-rest FxA state storage support r=csadilek a=grigoryk

This patch adds a version of `AccountStorage` which is backed by an encrypted-at-rest shared-prefs implementation,
`SecureAbove22Preferences`. As the name suggests, encryption at rest is enabled only for Android API levels 23+.
Otherwise, plaintext storage is used. `SecureAbove22Preferences` will handle API level upgrades behind the scenes,
if necessary.

In order to support rolling this out, `SecureAbove22AccountStorage` automatically migrates account state if it was
present in `SharedPrefAccountStorage`. And vice-versa, `SharedPrefAccountStorage` will automatically migrate account
state if it was present in `SecureAbove22AccountStorage`. This allows applications to easily switch between two
implementations, without any ill-effects.

In order to monitor storage implementations for abnormalities (such as disappearing encryption keys), an optional
`CrashReporter` instance may be configured now via FxaAccountManager.

`DeviceConfig` gained a `secureStateAtRest` flag, which allows applications to specify if they'd like to encrypt
account state. This config object isn't a perfect fit for this flag, but it's close enough conceptually.




Co-authored-by: Grisha Kruglov <[email protected]>
@bors bors bot closed this as completed in 3061e01 Nov 19, 2019
@pocmo pocmo modified the milestones: After Fenix MVP, 22.0.0 💡 Nov 19, 2019
sblatz pushed a commit to sblatz/android-components that referenced this issue Dec 19, 2019
This patch adds a version of `AccountStorage` which is backed by an encrypted-at-rest shared-prefs implementation,
`SecureAbove22Preferences`. As the name suggests, encryption at rest is enabled only for Android API levels 23+.
Otherwise, plaintext storage is used. `SecureAbove22Preferences` will handle API level upgrades behind the scenes,
if necessary.

In order to support rolling this out, `SecureAbove22AccountStorage` automatically migrates account state if it was
present in `SharedPrefAccountStorage`. And vice-versa, `SharedPrefAccountStorage` will automatically migrate account
state if it was present in `SecureAbove22AccountStorage`. This allows applications to easily switch between two
implementations, without any ill-effects.

In order to monitor storage implementations for abnormalities (such as disappearing encryption keys), an optional
`CrashReporter` instance may be configured now via FxaAccountManager.

`DeviceConfig` gained a `secureStateAtRest` flag, which allows applications to specify if they'd like to encrypt
account state. This config object isn't a perfect fit for this flag, but it's close enough conceptually.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
E8 Estimation points: 8 🌟 feature New functionality and improvements <firefox-accounts> Component: FxA <sync> Component: sync-logins
Projects
None yet
Development

No branches or pull requests

8 participants