Skip to content

mamori-io/dynamo-db-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mamori.io DynamoDb database proxy

Project Brief/Requirements:

Build a secure, responsive J2SE DynamoDb/HTTP proxy that proxies communication between DynamoDb clients, DynamoDb databases (local or installed on AWS) and the mmamori.io external security system. The proxy should utilise and communicate using the DynamoDb on-the-wire client-server network protocol (HTTP/S). You may use the AWS DynamoDb SDK and Netty libraries for handling network communication.

Targets:

The purpose of the proxy is to support:

  1. mamori.io authentication
  2. mamori.io notification of session and statement events. e.g connections and queries
  3. mamori.io notification of session and query errors
  4. mamori.io rewriting of queries
  5. mamori.io masking of query results

Interaction Diagram

img_1.png

mamori.io external system interfaces and helper classes are available at https://github.com/mamori-io/base-db-proxy (access will be provided on request)

To incorporate the mamori.io db proxy into your project use:

<dependency>
    <groupId>io.mamori</groupId>
    <artifactId>proxy-base</artifactId>
    <version>1.0-SNAPSHOT</version>
</dependency>

To incorporate the Amazon DynamoDb SDK dependency in your project:

<dependency>
        <groupId>software.amazon.awssdk</groupId>
        <artifactId>dynamodb</artifactId>
        <version>2.33.0</version> 
</dependency>

Note, use the latest SDK version:

DynamoDb Resources

Definition of done

Your project should include the following deliverables:

Note, you are free to use the AWS SDK DynamoDB driver https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.SDKOverview.html inside the proxy to communicate with DynamoDb instances. Communication with DynamoDB clients can use either NETTY and/or Amazon SDK libraries provided the licence permits use.

Reference Redis Project

A reference Redis database proxy project is available as a guide to implementation and how to incorporate the mamori.io external interfaces and classes into your proxy code https://github.com/mamori-io/redis-db-proxy (access will be provided on request)

Throughput/Scaling Targets

  • Support 500 Concurrently Connected Clients/Sessions.
  • Add no more than a 5% overhead on network/HTTP operations.
  • Scale linearly

What's provided in this project

  • Sample maven file pom.xml
  • Base packages (empty)
  • OWASP configuration
  • SpotBugs configuration

External System interfaces

The mamori.io Proxy base interfaces, classes and unit test helpers are available at https://github.com/mamori-io/base-db-proxy

  • TargetSystemConnectionDetailProvider. Main interface for connecting, authenticating and logging.
  • Session. Implement this interface for DynamoDb sessions.
  • SessionEvent. Session events. Use the Session.event callback to notify of session events.
  • Query interface. Implement this interface for DynamoDb queries. Invoke the rewrite and mask functions for rewriting and masking queries.
  • StatementEvent. Query events. Use the Query.progress callback to notify of Query/Statement Events.

Technology Stack

  • Java 24+
  • JUnit 5.X for testing
  • maven for builds.
  • logback and slf4j for logging
  • Netty and AWS SDK for handling client and server HTTP operations.

Design/Implementation Guidelines

  • Use Asynchronous/non-blocking programming and structures e.g CompletableFutures.
  • Catch and log all exceptions. No empty catch clauses.
  • The base package for all proxy classes is io.mamori.proxy.dynamo.
  • Use Netty threading model/platform threads.
  • Minimise 3rd party dependencies. No inclusion of 3rd party libraries with viral licences e.g GPL, AGPL etc. Note use of the AWS SDK is acceptable and expected.
  • Do not use Spring.

See pom.xml

Need more Info?

Contacts: omasri@mamori.io and dparnell@mamori.io

About

mamori.io dynamo-db-proxy

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published