Summary
In the past week I worked on the security model and getting the SandBox creation model straight.
In the past days I refactored the auto connect mechanism as a consequence. I also found some bugs in the code for Remote Objects written in the current prototype code for Phase 1.
Next steps
In the next weeks I will:
- Finalize the Security layer, part of Phase 2
- Test, debug and clean up the prototype code for Phase 1 and 2.
- Test and debug the framework with some basic applications
The goal is to have something demo-able before August.
Finalizing Database access and working with databases is moved – for now – after getting the basic framework running and tested to satisfaction.
Older Status Updates
- June 1: Prototype code for first phase of HotForestGreen almost done, implementing authentication
- June 13: First round trip successful
- June 19: This post
What is this Framework about?
I am building an “Internet of Things” / Distributed Applications framework called “HotForestGreen”. The basics of this Framework are:
- Simplicity – Why have complex libraries doing very advanced stuff and still not solving your main issues when you can have it all and can keep it stupid simple?
- Simplification - To simplify building Distributed Applications.
- Hot plugging – To allow hot-plugging and dropping out of Servers
- Scalability – To provide maximum scalability
- Security -To provide maximum security within Application Cluster with mimimal effort
Distributed Applications
A brief definition of Distributed Applications:
Software that executes on two or more computers in a network.
See also more here.
Revised auto connect mechanism
When a Client wants to connect to a SandBox, it needs to connect to a Server and the Server needs to provide the IP number of the Server in the Cluster that serves that SandBox.
From a complex spaghetti-wired process, moving in all directions I simplified that to a “per sandbox process”.
Here is the new process:
- Each Sandbox has a heartbeat.
- The heartbeat has a default delay of 5 seconds.
- On each beat, the Sandbox checks if all Server Connections are OK
- If a connection within a specific IP range is down, it will start scanning the network to find a new Server Connection
Each Server Connection has its own hearbeat as well. The default delay for a connection is 1 second. Here is the process per Server Connection
- On each heartbeat, the Server Connection checks if it is still connected
- If the connection is down, it will notify the Sandbox it is part of: to do a rescan.
Old rules
- A Sandbox has to be created after a Server is available
- If there is no Server available, the Sandbox will fail to initialize
New rules
- A Sandbox can be created before any Server is up
- On each heartbeat it will check each IP range for an active connection
- If there is an active connection on an IP range, it will skip and go to the next range to scan
- If there is no active Server Connection the Sandbox will scan that IP range to discover any Server
New: Implemented Server/Client System of Trust
In the past days I have been working on the Server to Server commuinication. This communication includes a lot of information you do not want to share to Hijackers.
To make sure Servers can communicate safely without unwanted eavesdroppers, I started to implement a Security Layer.
See the full TechDoc article here.
Rules of the security system
- Security can be done on Server and SandBox level
- Servers can be set to only allow Trusted Clients
- Sandboxes can be set to be Trusted – meaning that only other Verified Trusted SandBox Connections can send and receive data within that Trusted Sphere
- Security is done on a system of establishing Mutual Trust between Client and Server
- If one of both parties does not trust the other, it will disconnect the Socket
The Server has extra mechanisms built in to avoid Eavesdropping by injecting a Sandbox that pretends to be Secured.
- Each Trusted Sandbox will receive a flag from the Server stating that it is Verified and Trusted
- Any injected Public SandBox pretending to be Trusted, will be killed by the Trusted SandBoxes
Update on roadmap
Phase 1: Building the basis – In progress per May 4, 2011
Before June 10, 2011 I hope to finish Phase 1, which covers the basics on data, data conversion and Client/Server and Client/Client messaging. This includes:
- Remote Objects – Sending and updating Remote Objects to all Remote clients
- Status: June 19, 2011
- Basis is tested last week. Found some bugs in retrieving persistant objects, leading to creation of news ones instead of retrieving the old
- Need to be retested. Will be done in the next 2 weeks.
- Server feedback – Including IP numbers of Servers serving specific sandboxes
- Status: June 19, 2011
- Tested and in revision now. Refactored to make the message in standard BaseMessage format. Will do more refactoring today to revise the process of: “knock knock, who’s there?”
- Heartbeats and auto-reconnect – Including auto-discovery of services and sandboxes and auto-reconnects when a Client connection drops or a Server drops out
- Status: June 19, 2011
- Revised to be independent of Servers running. To be tested in a Server Cluster.
- User Authentication – Including a basic “plug and play” scenario for logging into SandBoxes and assuring messages sent from a Client are “signed” by the user Credentials
- Status: June 19, 2011
- No further progress
- Data manipulation – Using a “plug and play” approach via: “Transparant Data Access Layers” to access, change and store data in databases
- Status: June 19, 2011
- Tested first version three weeks ago. To be revisited after finalizing items 1 to 4.
- Data Conversion – Including the conversions of Objects to “Comma Separated Values” vice versa, in order to:
- Send updates – On Remote Objects through the network
- Reduce code for working with Databases – As we can inject data from databases into objects and database records
Phase 2: Securing the framework – Started per June 16
Phase 2 is about making the Framework more solid and more protected against people who want to hijack data and events.
- Server to Server updates – Including: “I am currently serving Sandboxes A, B and C with a total of N connections”
- Status: June 19, 2011
- Started implementation of Secured SandBoxes to make this possible and simple
- Implemented Server Sate Manifest as a Remote Object that contains the data per Server and automatically updates all other Servers when the state on that Server changes
- Load Balancing – Including a smart distribution of Sandboxes so that the load to serve Clients is shared by many
- Status: June 19, 2011
- Implemented, not tested yet. When a Client requests an IP number, the Client Socket will provide the IP of the Server that is least loaded.
- Server to Server security – Using handshakes and shared keys. Assuring that when a user plugs in a “Server” to intercept messages and sandboxes, this “Server” is refused by the network
- Status: June 19, 2011
- Work in progress. Servers now build up a Secured SandBox using the exact same mechanism as Clients, with the difference that they use an internal Shared Keyword to test if they can Trust the other Server
- SSL encryption – Currently all data sent is in Clear Text, making it extremely easy to hijack and abuse the system
- Status: June 19, 2011
- Not started yet
When these items are done, the Framework can withstand most basic attacks, can be scaled up by hot-plugging new Servers in the network and will continue to work even when multiple servers drop out.
Phase 3: Opening up the framework – Not started yet
While the basis is for specific use in a controlled environment, some things are missing to make the framework even more useful. These include:
- The use of Web-sockets – For Socket-communication over port 80 in environments behind firewalls
- Porting the code from C# to Java and ActionScript – To provide a broader use base, allowing you to run the framework on:
- Android, Apple, Linux and in Flash
- Intel and ARM-based devices
Phase 4: Testing and cleaning up – Not started yet
In Phase 4 all crap and remaining leaks will be filtered out of the system. During phase 2, most issues have been tested and addressed, but as a part of the process.
The work includes:
- Testing specific use-cases for performance - By running as much connections and messages as possible, until the system collapses
- Testing possible ways to hijack users and data – By scrutinizing the security model and implementing code that should break it
- Improving performance – By taking away data-hogs and
Posted on June 19, 2011
0