Sharing Databases on the Web with Porter Proxy

Xin Wang, Aastha Madaan, Eugene Siow, Thanassis TiropanisWWW 2017

Abstract

Sharing large-scale datasets over the web often involves a trade-off between security and usability. While HTTP APIs provide a secure interface, they frequently require developers to abandon native database drivers and rewrite legacy code. This paper introduces Porter Proxy, a lightweight TCP reverse proxy that enables native database access through protocol mimicry and a novel "socket switching" technique. By decoupling credentials and managing authentication at the proxy level, Porter Proxy allows for secure, centralized access control without modifying the underlying database or the client application.

Introduction

In modern data-sharing ecosystems, such as the "Web Observatory," datasets are typically exposed via harmonized HTTP APIs. Although these APIs ensure security and interoperability, they introduce a significant barrier for researchers and developers who rely on native database libraries (e.g., for MySQL or MongoDB) or legacy analysis tools. Directly exposing databases via standard TCP proxies is often insufficient because it lacks the fine-grained, externalized access control required for multi-tenant environments.

Porter Proxy addresses this challenge by acting as a middle-layer architecture that sits between the client and the protected database. It provides a "native" experience by mimicking the database's wire protocol while maintaining a separate authentication layer.

Methodology

The core innovation of Porter Proxy lies in its multi-stage connection and redirection process, implemented using Node.js.

Credential Decoupling and the Auth DB

To manage access without modifying the target database's internal user tables, Porter Proxy utilizes an "Auth DB." This is a lightweight instance of the target database type that contains only virtual credentials. When a user attempts to connect, they provide these virtual credentials to the proxy.

Authentication and Socket Switching

The connection process occurs in two distinct phases:

  1. Authentication Phase: The client connects to the proxy and authenticates against the Auth DB. Simultaneously, the proxy initiates a separate connection to the real, protected database using administrative credentials.
  2. Socket Switching: Once both connections are successfully authenticated, the proxy detaches the client's socket from the Auth DB and "switches" it to the real database's socket.
The two-stage connection process: initial authentication followed by socket switching.

After the switch, TCP packets are redirected transparently between the client and the real database. The client perceives a standard connection to the target database, while the database sees traffic originating from a trusted internal source.

Protocol Handling

To support modern security standards like SCRAM-SHA-1 in MongoDB, the proxy includes logic to intercept and reconstruct authentication messages that may be split across multiple TCP chunks. This ensures the handshake is fully completed before the socket switch occurs.

Mapping of virtual user credentials to real database connection strings and profiles.

Evaluation and Case Study

The authors evaluated the Porter Proxy architecture using a MongoDB prototype. The system demonstrated its ability to handle complex, stateful TCP-based authentication protocols while remaining transparent to the client. In a case study involving social network data, the proxy allowed a researcher to share a large dataset with a colleague by providing an alias address and proxy-specific credentials, effectively hiding the real server's root credentials and IP address.

Discussion and Key Insights

The system highlights several key principles for data sharing:

  • Protocol Mimicry: By supporting native wire protocols, the proxy enables the use of existing tools like mongodump without modification.
  • Separation of Concerns: Access control is managed at the ecosystem level, reducing the administrative overhead for data providers.
  • Low Overhead: The proxy's computational burden is primarily limited to the initial handshake; once the socket switch is complete, it performs simple transparent redirection.

Limitations and Future Work

While effective for MongoDB, the current implementation requires specific logic for each database protocol's unique handshake. Future work will focus on generalizing the socket manipulation technique to support a wider array of databases (e.g., PostgreSQL, SQL Server) and integrating advanced features such as load balancing and IP filtering. Additionally, the authors note a tension between promoting native drivers and the adoption of harmonized HTTP APIs, which remain better suited for pure client-side web applications.

Conclusion

Porter Proxy provides a viable path for integrating legacy database workflows into modern, secure web-based data sharing platforms. By leveraging socket switching and protocol mimicry, it offers a lightweight solution that balances the needs of security administrators with the usability requirements of data consumers.

Metadata * Venue: WWW '17 Companion (International World Wide Web Conference) * Authors: Xin Wang, Aastha Madaan, Eugene Siow, Thanassis Tiropanis

Summary updated

BibTeX
@inproceedings{wang2017sharing,
  author = {Xin Wang and Aastha Madaan and Eugene Siow and Thanassis Tiropanis},
  title = {{Sharing Databases on the Web with Porter Proxy}},
  booktitle = {The Web Conference},
  year = {2017},
  doi = {10.1145/3041021.3051694},
}
Figure