oppia / oppia-android

A free, online & offline learning platform to make quality education accessible for all.
https://www.oppia.org
Apache License 2.0
310 stars 511 forks source link

[Feature Request]: Enable AppCheck on Production #5084

Open adhiamboperes opened 1 year ago

adhiamboperes commented 1 year ago

Is your feature request related to a problem? Please describe.

As part of the Android NPS survey, we are uploading some of the user responses to Firestore. Firestore by itself does not offer adequate security, and Firebase AppCheck provides a solution that protects our database from malicious abuse by verifying the authenticity of writing apps and devices.

Describe the solution you'd like

The Setup steps for AppCheck from the documentation are as follows:

In the Release section, click Setup > App integrity.

On the Integrity API page, click Link project, then select your Firebase project from the list of Google Cloud projects.

The project you select here must be the same Firebase project as the one in which you register your app.

Init block

Firebase.initialize(context = this)
Firebase.appCheck.installAppCheckProviderFactory(
    PlayIntegrityAppCheckProviderFactory.getInstance(),
)

Per the documentation, this code needs to run before any other Firebase SDKs.

Once we have a good view of metrics, we can then enforce AppCheck.

To enable enforcement for Firestore:

Describe alternatives you've considered

N/A

Additional context

Additional Resources:

  1. Firebase App Check
  2. Play Integrity
  3. Securing Firebase
  4. Firebase App Check,
  5. Attestation with Play Integrity
seanlip commented 1 year ago

@adhiamboperes I've done the first two steps, but I can't see the graphs so I can't do the last one.

This page suggests that there are other steps that need to be followed first (2 and 3). Should I wait for the dev team to do that before proceeding?

adhiamboperes commented 1 year ago

@adhiamboperes I've done the first two steps, but I can't see the graphs so I can't do the last one.

This page suggests that there are other steps that need to be followed first (2 and 3). Should I wait for the dev team to do that before proceeding?

Yes, step 2 and 3 are dev side, and the last step on this issue will be done post-release so I will re-assign you then.