All Projects → GrapheneOS → AttestationServer

GrapheneOS / AttestationServer

Licence: MIT license
Server code for use with the Auditor app: https://github.com/GrapheneOS/Auditor. It provides two services: submission of attestation data samples and a remote attestation implementation with email alerts to go along with the local implementation based on QR code scanning in the app.

Programming Languages

java
68154 projects - #9 most used programming language
HTML
75241 projects
javascript
184084 projects - #8 most used programming language
shell
77523 projects
CSS
56736 projects
kotlin
9241 projects

Projects that are alternatives of or similar to AttestationServer

AttestationSamples
A small subset of the submitted sample data from https://github.com/GrapheneOS/Auditor. It has a sample attestation certificate chain per device model (ro.product.model) along with a subset of the system properties from the sample as supplementary information.
Stars: ✭ 25 (-60.94%)
Mutual labels:  integrity, hsm, secure-boot, authenticity, attestation, verifiedboot, remote-attestation, secureboot, strongbox
libkeccak
[Basically feature complete] Keccak-family hashing library
Stars: ✭ 53 (-17.19%)
Mutual labels:  integrity, authenticity
SELoader
Secure EFI Loader designed to authenticate the non-PE files
Stars: ✭ 38 (-40.62%)
Mutual labels:  integrity, secure-boot
meta-secure-core
OpenEmbedded layer for the use cases on secure boot, integrity and encryption
Stars: ✭ 80 (+25%)
Mutual labels:  integrity, secure-boot
multizone-linux
MultiZone® Security Enclave for Linux
Stars: ✭ 18 (-71.87%)
Mutual labels:  secure-boot
confidential-computing-zoo
Confidential Computing Zoo provides confidential computing solutions based on Intel SGX, TDX, HEXL, etc. technologies.
Stars: ✭ 177 (+176.56%)
Mutual labels:  attestation
platform bionic
Hardened Android standard C library. Some of the past hardening has not yet been ported from Marshmallow, Nougat and Oreo to this Android Pie repository. Most is available via archived tags in https://github.com/AndroidHardeningArchive/platform_bionic (check both the most recent Oreo and Nougat tags).
Stars: ✭ 66 (+3.13%)
Mutual labels:  grapheneos
hsm
C++ framework library to simplify state-driven code
Stars: ✭ 88 (+37.5%)
Mutual labels:  hsm
Pkcs11Interop.X509Store
Easy to use PKCS#11 based X.509 certificate store
Stars: ✭ 24 (-62.5%)
Mutual labels:  hsm
kernel google wahoo
Pixel 2 and Pixel 2 XL kernel sources.
Stars: ✭ 13 (-79.69%)
Mutual labels:  grapheneos
hsmwiz
HSMWiz is a frontend for OpenSC, pkcs11tool and pkcs15tool to ease handling of HSM smartcards
Stars: ✭ 27 (-57.81%)
Mutual labels:  hsm
opencryptoki
PKCS#11 library and tools for Linux. Includes tokens supporting TPM and IBM crypto hardware as well as a software token.
Stars: ✭ 100 (+56.25%)
Mutual labels:  hsm
lemur
Lustre HSM tools
Stars: ✭ 20 (-68.75%)
Mutual labels:  hsm
arch-secure-boot
UEFI Secure Boot for Arch Linux + btrfs snapshot recovery
Stars: ✭ 60 (-6.25%)
Mutual labels:  secure-boot
yubihsm-rs
Pure Rust client for YubiHSM2 devices
Stars: ✭ 70 (+9.38%)
Mutual labels:  hsm
strongbox
a World of Warcraft Addon Manager aimed at Linux players
Stars: ✭ 131 (+104.69%)
Mutual labels:  strongbox
tsm
A Hierarchical State Machine Framework in C++
Stars: ✭ 30 (-53.12%)
Mutual labels:  hsm
checksum-command
Verifies file integrity by comparing to published checksums.
Stars: ✭ 29 (-54.69%)
Mutual labels:  integrity
exynos-usbdl
Unsigned code loader for Exynos BootROM
Stars: ✭ 57 (-10.94%)
Mutual labels:  secure-boot
platform build
Make Build System (being phased out upstream)
Stars: ✭ 53 (-17.19%)
Mutual labels:  grapheneos

See the overview of the project at https://attestation.app/about.

Installation guide

This is a generic guide on setting up the attestation server.

You need to set up nginx using the nginx configuration in the nginx directory in this repository. You'll need to adjust it based on your domain name. The sample configuration relies on certbot, nginx-rotate-session-ticket-keys, and certbot-ocsp-fetcher. Setting up the web server is out-of-scope for this guide.

Install a headless Java 18 runtime environment. The package name on Debian-based distributions is openjdk-18-jre-headless or jre-openjdk-headless on Arch Linux. Install sqlite3 in order to set up the email configuration for the database.

As root, on the server:

useradd -m -s /bin/bash -b /var/lib attestation

mkdir -p /opt/attestation/deploy_{a,b}
ln -s /opt/attestation/deploy_a /opt/attestation/deploy

mkdir -p /srv/attestation.app_{a,b}
ln -s /srv/attestation.app_a /srv/attestation.app

Set up ssh authorized_keys for the attestation user.

Copy attestation.service to /etc/systemd/system/attestation.service.

On your development machine, you will need to change the remote variable in the scripts to your server. Then deploy the attestation server and static content:

./deploy-server
./deploy-static

As root on the server, enable and start the attestation server:

systemctl enable attestation
systemctl start attestation

The server will be listening on [::1]:8080 by default which can be changed.

Email alert configuration

In order to send email alerts, AttestationServer needs to be configured with valid credentials for an SMTP server. The configuration is stored in the Configuration table in the database and can be safely modified while the server is running to have it kick in for the next email alert cycle.

Only SMTPS (SMTP over TLS) with a valid certificate is supported for remote email servers. STARTTLS is deliberately not supported because it's less secure unless encrypted is enforced, in which case it makes more sense to use SMTPS anyway. The username must also be the full address for sending emails.

For example, making an initial configuration:

sqlite3 attestation.db "INSERT INTO Configuration VALUES ('emailUsername', '[email protected]'), ('emailPassword', '<password>'), ('emailHost', 'mail.grapheneos.org'), ('emailPort', '465')"

The attestation.service unit only allows the service to communicate over localhost by default so the IPAddressDeny/IPAddressAllow configuration either needs to be removed or extended to include your DNS server and mail server IP addresses when using a remote mail server.

Handling abuse

The emailBlacklistPatterns array in src/main/java/app/attestation/server/AttestationServer.java can be used to blacklist email addresses using regular expressions. We plan to move this to a table in the database so that it can be configured dynamically without modifying the sources, rebuilding and redeploying. For now, this was added to quickly provide a way to counter abuse.

API for the Auditor app

QR code

The scanned QR code contains space-separated values in plain-text: <domain> <userId> <subscribeKey> <verifyInterval>. The subscribeKey should be treated as an opaque string rather than assuming base64 encoding. Additional fields may be added in the future.

/challenge

  • Request method: POST
  • Request headers: n/a
  • Request body: n/a
  • Response body:

Returns a standard challenge message in the same format as the Auditor app QR code. The challenge can only be used once and expires in 1 minute.

The server challenge index is always zeroed out and the userId should be used instead.

/verify

  • Request method: POST
  • Request headers:

The Authorization header needs to be set to Auditor <userId> <subscribeKey> for an unpaired attestation. That will also work for a paired attestation if the subscribeKey matches, but it should be set to Auditor <userId> to allow for subscribeKey rotation.

  • Request body:

Standard attestation message in the same format as the Auditor app QR code.

  • Response body:

Returns space-separated values in plain text: <subscribeKey> <verifyInterval>. Additional fields may be added in the future.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].