This page describes the architecture of Yona.
High level overview
On network level, this is how it looks like:
Initial support is limited to mobile devices. These devices will access the internet through a VPN tunnel that is terminated on the web traffic classification server (SmoothWall). The server will not filter, in the sense of blocking sites, but just classify the sites. This classification will happen for HTTP and HTTPS traffic, see this page. The requests will be passed on to the target web server. For requests that in categories of interest to Yona, the classification server will post a message on a queue to the Yona server. The Yona server is responsible for maintaining the user and buddy administration and to inform users about events that conflict the goals defined by the users. The Yona app on the device interacts with the Yona server to see buddy events and everything supported by Yona.
Subsequent sections zoom in on the app, the web traffic classification server and the Yona server.
The mobile app is the only user interface provided for Yona. There are no plans to provide a web site. The mobile app has the following high level responsibilities:
- Provide the user interface for all features provided to Yona users
- Configure the VPN connection
- Reconnect the VPN in case it disconnects
- Send a request to the Yona server to inform the buddy in case:
- The user uninstalls
- The user disables the app
- The user disables or otherwise hampers the VPN connection
The app generates and stores a key in the secret storage of the app, that is required for all interactions with the server.
Web traffic classification server
The heart of this server is SmoothWall. Kliksafe uses this product to filter requests. For Yona, it will be deployed as a classification server. The SmoothWall server provides us with the following features:
- VPN server
- Classification engine
- Man-in-the-middle proxy for HTTPS servers. See this page.
Every request passed through the filter engine is logged in the DansGuardian log. Given the constraints of the Linux OS of the SmoothWall server, we will use a Perl script to filter the events that are of relevance to Yona and post these on the queue to the Yona server. The log file (
access.log) is normally written in a file. Instead of the file, we will create a named pipe and have the Perl script read from it. See an example log file parser here. The named pipe approach is chosen for two reasons: it is a very efficient mechanism that does not required disk reads/writes and it prevents from storing sensitive data.
The Perl script will read all SmoothWall log events and match them with a list of Yona-relevant web site categories. If the category is relevant, a message with the relevant data is posted on the queue to the Yona server. Otherwise, the message is discarded.
The Yona server is responsible for:
- Providing the web services that back the mobile app
- Administration of users and buddy relationship
- Producing notifications in case users access websites that conflict their objectives
Given that objective of Yona is to help people that "do the very thing they hate" (Romans 7:15), the system by nature stores sensitive information, so security is a prime concern.
Global architecture, drafted after discussion with Bert and Ron.
- We believe that the URL Hits table needs to be encrypted using asymmetric keys.
- can these keys be derived from a client certificate?
- can the client certificate be used in SmoothWall, or should it be the other way around?
- we assume that the URL hits are created for the actor and his buddies. Only them should be able to see the actual URLs. But the actor/buddy column should be encrypted as well!
- Do we need the Account table to be encrypted as well?