26 KiB
+++ title="GrapheneOS for Anarchists" date=2023-04-05
[taxonomies] categories = ["Defensive"] tags = ["intro", "mobile", "easy"]
[extra] toc = true blogimage="/images/graphene.avif" +++
Anarchists shouldn't have phones. If you absolutely must use a phone, it should be as difficult as possible for an adversary to geotrack, intercept messages, or hack. This means using GrapheneOS.
What is GrapheneOS?
GrapheneOS is a private and secure version of the Android operating system. Standard Android smartphones have Google baked into them (for example, Google Play Services has irrevocable ability to access your files, call logs, location, etc.), and it is trivial to bypass standard Android authentication with physical access to the device. GrapheneOS uses hardware-based security to substantially increase the difficulty of bypassing the authentication, it is significantly hardened against hacking, and it has all Google apps and services removed by default. Other alternative Android operating systems exist but they are inferior. See the GrapheneOS documentation for an extensive list of the privacy and security improvements over standard Android. GrapheneOS is regularly audited.
Cellphones leave a geolocation history when they connect to cell towers, by nature of how the technology works. For this reason, we recommend using a smartphone which stays at home like a landline, and connects to the Internet through Wi-Fi rather than by using a SIM card to connect through cell towers. Even if you use an anonymously acquired SIM, if this is linked to your identity in the future, the service provider can be retroactively queried for all geolocation data. Additionally, it's insufficient to only leave a phone at home when you are going to a demo or action because this then stands out as an outlier, serving as an indication that there is conspiratorial activity in that time window.
Installation
Google Pixel phones are the only devices that currently meet GrapheneOS's hardware security requirements. Beginning with the Pixel 6, Pixel devices receive a minimum of 5 years of security updates from when they are released. End-of-life devices (GrapheneOS "extended support" devices) do not have full security updates so they are not recommended. Avoid carrier variants of the phone, meaning don't buy one from a mobile network operator, which can prevent you from installing GrapheneOS. The cheapest option is to buy the "a" model just after the next flagship model is released - for example, the Google Pixel 6a after the Pixel 7 is released.
Installing GrapheneOS can happen through a web browser, or through the command line. The command line method doesn't require trusting the server infrastructure, but is more technical. If you are uncomfortable with a command line, the web browser installer is fine; as the instructions note, "Even if the computer you used to flash GrapheneOS was compromised and an attacker replaced GrapheneOS with their own malicious OS, it can be detected with Auditor", which is explained below. Both methods list their officially supported operating systems. Neither list includes Qubes OS, but it is possible to install from Qubes OS with the following steps.
Installation on Qubes OS
TODO
- In a Whonix-Workstation disposable qube, open the command line installation guide using Tor Browser.
- You will read "Installing from an OS in a virtual machine is not recommended. USB passthrough is often not reliable." This means that we will do everything from sys-usb, which does not use USB passthrough. If during the post-installation of Qubes OS you set sys-usb to be disposable, it will reset after a reboot.
- For the sake of simplicity, we will enable networking in sys-usb temporarily. It is also possible to keep sys-usb offline by copying platform-tools and the factory image into sys-usb from a whonix disposable, and getting udev rules from Github rather than apt. In the Settings → Basic tab of sys-usb, make the follow changes:
- Private storage max size: 10.0 GB
- Net qube: sys-firewall
- Press Apply
- Follow the installation instructions from the sys-usb Terminal. When you get to Flashing factory images, don't run
./flash-all.sh
. Instead, scroll down to troubleshooting and run the command that uses a different temporary directory. It is expected for the flash script to output messages likearchive does not contain 'example.img'
. - Upon first booting Graphene, it will prompt you if you want to connect to Wi-Fi. Don't, we need to do hardware-based attestation first. Never set up the fingerprint authentication. Set a strong password. This will only have to be entered on boot - we will set a shorter password for unlocking throughout the day later on.
- When you are done, reboot sys-usb. If it is disposable, the changes you have made will be gone. Don't forget to change back the sys-usb qube settings:
- Net qube: (none)
System navigation
By default, GrapheneOS uses gesture navigation. The essentials are:
- The bottom of the screen is a reserved touch zone for system navigation.
- Swiping up from the navigation bar while removing your finger from the screen is the Home gesture.
- Swiping up from the navigation bar while holding your finger on the screen before releasing is the Recent Apps gesture.
- Swiping from either the left or the right of the screen within the app (not the navigation bar) is the Back gesture.
- The launcher uses a swipe up gesture starting anywhere on the screen to open the app drawer from the home screen. You need to start that gesture above the system navigation bar.
Auditor
In the post-installation instructions, Hardware-based attestation is the last step. The Auditor app included in GrapheneOS leverages hardware security features in order to provide integrity monitoring to the device's firmware and software. This is crucial because it will alert you if the device is maliciously tampered with. The Auditor app must be configured directly after GrapheneOS is installed, before any Internet connection.
How does it work? Your new device is the auditee, and the auditor can either be another instance of the Auditor app on a friend's phone or the Remote Attestation Service; we recommend doing both. The auditor and auditee pair to form a private key, and should tampering with the operating system of the auditee happen after the pairing is complete, the auditor will be alerted.
First, directly after the device has been installed and before connecting to the Internet, perform local verification. This requires having a friend present who you see semi-regularly and who has the Auditor app (on any Android device). The first pairing will show a brown background, and subsequent audits will show attestation results with a green background if nothing is remiss. There is no remote connection between your phones; you need to re-audit to benefit.
We recommend using the phone as a Wi-Fi only device. Turn on airplane mode, which will prevent your phone from being reached and tracked from the cellular network, and then enable Wi-Fi. You can now connect to Wi-Fi. Once you have an Internet connection, we recommend that you immediately set up the scheduled remote verification with an email that you check regularly. The default permitted delay until alerts is 48 hours; if you know your phone will be off for a longer amount of time, you can update the configuration to a maximum of two weeks. If your phone will be off for more than two weeks (for example, if you leave it at home during travel), just ignore the notification emails. You can log back in at any time to view the attestation history.
User Profiles
User profiles are a feature that allows you to compartmentalize your phone, similar to how Qubes OS will compartmentalize your computer. User profiles have their own instances of apps, app data, and profile data. Apps can't see the apps in other user profiles and can only communicate with apps within the same user profile. In other words, user profiles are isolated from one another - if one is compromised, the others aren't necessarily.
The Owner user profile is the default profile which is there when you turn on the phone. We will install only one app in the Owner user profile, RiseupVPN, our preferred VPN application. All default connections made by GrapheneOS will be forced through the Riseup VPN. First, browse to riseup.net/en/vpn/android using Vanadium. Download the .apk file. Navigate to the downloaded file with the Files app, and click on it to install. You will be prompted that you need to change the Vanadium setting for Install unknown apps: temporarily enable "Allow from this source". Once Riseup VPN is installed, accept the 'Connection request' prompt. A green display will mean that the VPN is successfully connected. Navigate to Advanced settings in the Riseup VPN menu, click Always-on VPN, and follow the instructions. Now before you forget, revert the Vanadium setting: Settings → Apps → Vanadium → Install unknown apps, and disallow. Moving forward, the Riseup VPN will automatically connect when you turn on your phone.
Additional user profiles can be created. Each profile is encrypted using its own encryption key and cannot access the data of any other profiles. Even the device owner cannot view the data of other profiles without knowing their password. We will now create a second user profile for installing applications: Settings → System → Multiple users, press Add user. You can name it Default, and press Switch to Default. Set a shorter password, which will allow you to enter your long diceware password at boot for the Owner, and a shorter password when using the phone throughout the day. A shortcut to switch between different user profiles is present on the bottom of Quick Settings (accessible by swiping down from the top of the screen, twice).
Later on, we will optionally create an additional user profile for applications that require Google Play Services.
How to Install Software
GrapheneOS's app store has the standalone applications built by the GrapheneOS project such as Vanadium, Auditor, Camera, and PDF Viewer. These are updated automatically.
For installing additional software, avoid F-Droid due to its numerous security issues. GrapheneOS has a Sandboxed Google Play which can be installed through the GrapheneOS app store, but this is unnecessary unless the application requires Google Play services to function properly (see below). For all apps that do not require Google Play services, use the Aurora Store, which is a client that allows you to install applications from the Google Play Store without a Google Account or Google Play services.
To install the Aurora Store in the Default user profile, download the apk file for AuroraStore (Stable) from auroraoss.com using the Vanadium web browser. Be aware that search results for 'Aurora Store' will feature many malicious websites, so type in the URL directly. Verifying the integrity of an .apk file is too technical for most users. The installation is the same process for Riseup VPN; temporarily enable "Allow from this source" for Vanadium. During the Aurora Store installer, you need to grant permissions:
- External Storage Access: Grant > Configure Storage Scopes
- External Storage Manager: this will be granted by Storage Scopes
- Installer Permissions: Grant
Before you forget, revert the Vanadium setting. You can now install and update applications. Log in using an anonymous account. Start by installing RiseupVPN from Aurora, and configuring it as we did for the Owner profile, and continue with any other apps - for ideas, see Encrypted Messaging for Anarchists. The Aurora Store does not yet support automatic updates, so change the settings so that updates are more visible when they become available in Aurora Store's Settings → Customization → Select default tab: Updates
The Aurora Store does not allow you to download paid apps with their anonymous account feature. You can optionally log in with your Google account with Aurora Store to download apps you have purchased, which does give access to the list of apps you've installed to Google, but you will still benefit from not requiring the full Google Play client and Google Play services on the Default user profile.
Software That Isn't On the Play Store
Some apps aren't on the Play Store (and thus can't be installed from Aurora), either because they are in development or they don't want users to have to interact with Google. Aurora can be used to update apps, but when you download individual .apk files you will need to remember to update them yourself (there are exceptions, for example Signal is designed to self-update). Obtainium is an app to keep track of what apks need to be updated, and is available on the GitHub Releases page; app-arm64-v8a-release.apk
of the latest release is what you want (arm64-v8a is the processor architecture).
For example, Molly-FOSS, a hardened version of Signal with no Google software, is available from Github Releases. In Obtanium press Add App, then copy the Github Releases URL. Obtanium can install the app, and when there is a new version you will get a system notification and an update icon will be present beside it, at which point you must manually update it.
Cwtch is not yet present on the Google Play Store, and can be added to Obtainium by entering the Download page URL.
Software That Requires Google Play Services
If there is an app you would like to use that requires Google Play services, create a specific user profile for it from the Owner user profile; you can name it Google. This is also a good solution for isolating any app you need to use that isn't open-source or reputable. This user profile can have the same password as the Default user profile - the advantage of using a separate passphrase is only in case an attacker records you entering it.
Within the new Google user profile, install Sandboxed Google Play by opening Apps and install Google Play services (this will also install Google Services Framework and the Google Play Store).
The Google Play Store requires a Google account to log in, but one with false info can be created for exclusive use with the Google Play Store.
Once installed and logged in, disable the advertising ID: Settings → Apps → Sandboxed Google Play → Google Settings → Ads, and select Delete advertising ID. You can now install applications through the Google Play Store within that profile. We recommend installing Riseup VPN again first, so that it is active in all user profiles. Automatic updates can be enabled in Google Play Store's Settings → Network Preferences → Auto-update apps. If you get notifications from the Play Store that it wants to update itself, accept them. Notifications for Google Play Store and Google Play Services need to be enabled for auto-updates to work.
Many banking apps will require Sandboxed Google Play. However, banking can simply be accessed through a computer to avoid needing this Google user profile.
VoIP
A Wi-Fi only smartphone doesn't require paying a monthly fee for a SIM card. As explained in Why Anarchists Shouldn't Have Phones, bureaucracies often require a phone number that can be called normally (without encryption). VoIP applications allow you to create a number and make phone calls over the Internet rather than through cell towers. A phone number is also occasionally required for applications, such as Signal registration, and a VoIP number will often work.
Some of the VoIP applications that work on computers also work on smartphones; the main advantage is that you will hear it ring even when your computer is off. The jmp.chat VoIP service works well with their client Cheogram and can be paid for in Bitcoin. In addition, there are paid options that are only present on mobile such as MySudo (although it only works in a handful of countries). A MySudo subscription can be anonymously purchased with Google Play gift cards, but this is likely unnecessary if the point is to give the number to bureaucracies. MySudo requires Google Play Services.
Tor
Perhaps you want to use Tor from a smartphone. However, if you need the anonymity of Tor rather than the privacy of Riseup VPN, you should use either Qubes OS or Tails on a computer. The Graphene docs recommend avoiding Gecko-based browsers like Tor Browser given that such browsers "do not have internal sandboxing on Android." Orbot is an app that can route traffic from any other app on your device through the Tor network, but simply using the Vanadium browser through Orbot is not recommended by the Tor Project.
Applications like Cwtch and Briar have Tor built in, and should not be used through a VPN like Orbot.
Recommended Settings and Habits
- Settings → Security → Auto reboot: 8 hours [Owner user profile]
- Auto reboot when no profile has been unlocked for several hours will put the device fully at rest again, where Full Disk Encryption is most effective. It will at minimum reboot overnight if you forget to turn it off. In the event of malware compromise of the device, Verified Boot will prevent and revert changes to the operating system files upon rebooting the device. If police ever manage to obtain your phone when it is in a lock-screen state, this setting will return it to effective encryption even if they keep it powered on.
- Keep the Global Toggles for Bluetooth, location services, the camera, and the microphone disabled when not in use. Apps cannot use disabled features (even if granted individual permission) until re-enabled.
- Settings → Connected devices → Bluetooth timeout: 2 minutes
- Quite a few applications allow you to "share" a file with them for media upload. For example, if you want to send a picture on Signal, do not grant Signal access to "photos and videos", because it will have access to all of your pictures then. Instead, in the Files app, long-press to select the picture, then share it with Signal.
- Once you have all the applications you need installed in a given user profile, disable app installation within it [Owner user profile].
- Settings → System → Multiple users → [Username]: Disallow installing apps (enabled)
- If an app asks for storage permissions, choose Storage Scopes. This makes the app assume that is has all of the storage permissions that were requested by it, despite not actually having any of them.
- It is convenient to be able to receive notifications from any user profile. Within the Owner user profile:
- Settings → System → Multiple users: Send notifications to current user (enabled)
How to Backup
Don’t use cloud backups. None of the corporate options offer encryption at rest, and it is the easiest avenue for police to access your data. If you need to backup your phone, backup onto your encrypted computer.
GrapheneOS currently provides Seedvault as a backup solution, but it's not very reliable. As the docs specify, connecting directly to a computer requires "needing to trust the computer with coarse-grained access", so it is best avoided. Instead, you can manually backup files by copying them to a USB-C flash drive with the Files app, or sending them to yourself via an encrypted messaging app like Element (Matrix).
Password Management
If you feel you need a password manager, KeePassDX is a good option. However, most app credentials can be kept on KeePassXC on a computer as they don't need to be entered regularly. The set up described in this guide requires memorizing two passwords:
- The Owner user profile (boot password)
- The weak password shared by all other user profiles. This can simply be the first word of the boot password.
- (Optional) Apps like Cwtch and Molly have their own passwords.
The weak password for secondary user profiles relies on the adversary obtaining physical access to your phone when it is turned off, which will force them to access the Owner user profile before they can attack secondary user profiles. Make sure to turn it off overnight and when you leave it at home. If they get access when the device is turned on (at a lock-screen), the "Auto reboot" setting will turn it off before they have much time to attempt a brute-force. For notes on password quality for 1, see Tails Best Practices.
The Baseband Chip and Linux Phones
The hardware used for cellphones is significantly less trustworthy than a ThinkPad running Tails or Qubes OS with open-source firmware. Components of the phone, such as the processor and radio technologies, rely on closed-source components. The baseband chip (GSM module, cellular modem) is closed-source, and integrated with the processor and memory; baseband attacks can read and alter data on the phone remotely. This is why cellphones can never be trusted to the extent of Tails, which is used for incriminating activities such as submitting a communique because it can be used on trusted hardware, and leaves no trace. In contrast, incriminating activities should never happen over a phone unless it is a burner phone acquired for a one-off use, no matter how secure the operating system. In GrapheneOS, the baseband is isolated.
Why recommend a Pixel, and not a Linux phone? Linux-based phones such as the PinePhone Pro have sought to address closed-source hardware and firmware but fall short. Open-source firmware is available to technical users, but the baseband firmware remains closed-source. Although slightly more trust can be placed in the hardware of some Linux-based phones, they are significantly easier to hack than GrapheneOS, as they do not have modern security features such as full system MAC policies, verified boot, strong app sandboxing, and modern exploit mitigations. For this reason, we don't recommend Linux-based phones.
Wrapping Up
With the set-up described, if a cop starts with your name, they won’t be able to simply look it up in a cellular provider database to get your phone number. If you use the phone as a Wi-Fi only device and always leave it at home, it cannot be used to determine your movement profile and history. If you use a VoIP number, it is accessed through a VPN so, even if this number is known, it can't be used to locate you. All communications with comrades use end-to-end encryption; thus, they do not assist network mapping. Even if you have the bad fortune of being the target of a highly resourced investigation, the hardened operating system makes it more difficult to compromise with spyware, and such a compromise should be able to be detected.
By storing the phone in a tamper-evident way when it is not in use, you'll be able to notice if it's been physically accessed. See the tutorial Making Your Electronics Tamper-Evident.
The forum is generally very helpful for any remaining questions you may have.