-
Notifications
You must be signed in to change notification settings - Fork 527
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
[Feature Request]: Enable AppCheck on Production #5084
Comments
@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. |
## Explanation Fixes Part of #5084. This is PR 6 of 6 Planned PRs. This PR adds Firebase AppCheck and Play Integrity dependencies to the project. It also initializes AppCheck. Once a new production build is released with this commit, requests to all our Firebase resources will include an attestation token, and we will be able to begin monitoring the type of requests we receive. We will use this data to inform when we will fully enforce AppCheck for all Firebase access, after gaining an understanding of how many active users would be impacted(unable to upload logs to Firestore). To test this, I added a [debug token](https://firebase.google.com/docs/app-check/android/debug-provider#emulator) to the firebase console, to be used to verify our requests to Firestore. <img width="1405" alt="Screenshot 2024-01-24 at 09 33 25" src="https://github.com/oppia/oppia-android/assets/59600948/034f3176-b5cf-465a-858d-d55fd6495987"> <img width="918" alt="Screenshot 2024-01-24 at 09 45 54" src="https://github.com/oppia/oppia-android/assets/59600948/19295576-8540-4890-b30b-0c6defb0a670"> #### The Appcheck console <img width="1062" alt="Screenshot 2024-01-24 at 09 06 17" src="https://github.com/oppia/oppia-android/assets/59600948/30c09bd1-f9bd-412d-8510-9fc8f9f5dd65"> <img width="1062" alt="Screenshot 2024-01-24 at 09 06 02" src="https://github.com/oppia/oppia-android/assets/59600948/d4c3a8b0-fb4a-4531-89d3-c2783b9d702f"> <img width="1062" alt="Screenshot 2024-01-24 at 09 05 48" src="https://github.com/oppia/oppia-android/assets/59600948/0423ea9d-db48-47c6-bbeb-7af905fc0785"> #### Test on the release token fetch <img width="1377" alt="Screenshot 2024-01-24 at 08 57 10" src="https://github.com/oppia/oppia-android/assets/59600948/0deee04b-ca34-482f-9663-b3959dbdda6d"> ## Essential Checklist <!-- Please tick the relevant boxes by putting an "x" in them. --> - [x] The PR title and explanation each start with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".) - [x] Any changes to [scripts/assets](https://github.com/oppia/oppia-android/tree/develop/scripts/assets) files have their rationale included in the PR explanation. - [x] The PR follows the [style guide](https://github.com/oppia/oppia-android/wiki/Coding-style-guide). - [x] The PR does not contain any unnecessary code changes from Android Studio ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#undo-unnecessary-changes)). - [x] The PR is made from a branch that's **not** called "develop" and is up-to-date with "develop". - [x] The PR is **assigned** to the appropriate reviewers ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#clarification-regarding-assignees-and-reviewers-section)). ## For UI-specific PRs only <!-- Delete these section if this PR does not include UI-related changes. --> If your PR includes UI-related changes, then: - Add screenshots for portrait/landscape for both a tablet & phone of the before & after UI changes - For the screenshots above, include both English and pseudo-localized (RTL) screenshots (see [RTL guide](https://github.com/oppia/oppia-android/wiki/RTL-Guidelines)) - Add a video showing the full UX flow with a screen reader enabled (see [accessibility guide](https://github.com/oppia/oppia-android/wiki/Accessibility-A11y-Guide)) - Add a screenshot demonstrating that you ran affected Espresso tests locally & that they're passing --------- Co-authored-by: Ben Henning <[email protected]>
This is enabled now for production and should start affecting the new NPS Firestore datastore (only--events are unaffected). |
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 Google Play Console, select your app.
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.
Register your apps to use App Check with the Play Integrity provider in the App Check section of the Firebase console.
Developer: Add the App Check library to the app
Add the Appcheck and play integrity dependencies to the app(gradle and bazel) and initialize app check in the code.
Init block
Per the documentation, this code needs to run before any other Firebase SDKs.
Monitor App Check request metrics
After adding the App Check SDK to the app, but before enabling App Check enforcement, we should make sure that doing so won't disrupt our existing legitimate users. To view the App Check request metrics for a product, open the App Check section of the Firebase console.
Enable App Check enforcement
This step will not be enabled from the onset for production apps, because we need to ensure that doing so won't disrupt our existing legitimate users. We will first deploy the app with AppCheck configured so that we can monitor the metrics and be able to see usages from Verified, Outdated clients, Unknown origin and Invalid requests. See here for more information on metrics. Reference.
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:
The text was updated successfully, but these errors were encountered: