LIGHT

  • News
  • Docs
  • Community
  • Reddit
  • GitHub

Config Server Design

Security Interaction

There will be a lot of sensitive info in the config files such as database password, private key store password etc. The security design is very crucial for the config server and the interaction during the service startup.

As the sensitive info in the config file is encrypted, we need to pass the encryption key to the service as an environmental variable in the deployment file. The same encryption key must be previously set up on the config server for the service from the same operator so that the config server will use it to encrypt the sensitive info.

To allow the service to start automatically, the encryption key must be put into the deployment config file for the Kubernetes cluster. And it will be revealed to someone who has access to the deployment script. To prevent an attacker to steal the encryption key to decrypt the sensitive info from the config files manually, there are two extra variables that need to be built into the service itself.

  • The encryption algorithm

There will be numeric encryption algorithms supported by both config server and light-4j services. Each service will pick up one to be built in and only the development team knows it. When the service is initialized on the config server, the product owner of the service will provide the right algorithm for the service.

  • Salt

Each service will have a random number built in as salt. The salt will be applied to the encryption key in order to work. The service owner will also need to provide the salt to the config server during service initialization.

For deployment operators, they cannot see the algorithm and salt for the service they are deploying. So the encryption key is not enough to do any damage. For the product owner, they are not able to access the encryption key. For a big organization, there is a separate team that is responsible for different tasks. For a small organization, to limit the information spread to more people, you can turn off the salt for the test environment so that secret will only be revealed to a limited number of people.

Database Encryption

To protect the interaction between the config server and services is not enough. We need to encrypt the database values so that even the database file is stolen, no sensitive info will be leaked. This requires that an encryption key must be available for the config server and it must be saved in the server instance instead in the database itself. We cannot generate random key as this key is needed to recover database if the current instance is down and we have to start another instance. To maximize the security, the key is splitted into two parts for two operators. Both of them will input their key to recover the real encryption key for the database values.

Framework

There are a lot interaction with the UI and only our team is accessing the API of config server. It is a lot easily to utilize light-hybrid-4j with react-schema-form for the UI. The other benefit is that it can be integrated seamlessly with light-portal in our deployment. But for customers who doesn’t want to use light-portal, they can still use the light-config-server independently.

Database

The light-portal is using ArangoDB by default. As we are dealing with key/value most of the case, it would be natural to use ArangoDB; however, we need to provide another plugin layer to access SQL database in case someone wants to use it independently. Once the database layer is abstracted, it would be very easy to replace it with service.yml configuration change.

Model and Schema

The latest model-schema can be found at https://github.com/networknt/model-config/tree/develop/hybrid/config-server

  • About Light
    • Overview
    • Testimonials
    • What is Light
    • Features
    • Principles
    • Benefits
    • Roadmap
    • Community
    • Articles
    • Videos
    • License
    • Why Light Platform
  • Getting Started
    • Get Started Overview
    • Environment
    • Light Codegen Tool
    • Light Rest 4j
    • Light Tram 4j
    • Light Graphql 4j
    • Light Hybrid 4j
    • Light Eventuate 4j
    • Light Oauth2
    • Light Portal Service
    • Light Proxy Server
    • Light Router Server
    • Light Config Server
    • Light Saga 4j
    • Light Session 4j
    • Webserver
    • Websocket
    • Spring Boot Servlet
  • Architecture
    • Architecture Overview
    • API Category
    • API Gateway
    • Architecture Patterns
    • CQRS
    • Eco System
    • Event Sourcing
    • Fail Fast vs Fail Slow
    • Integration Patterns
    • JavaEE declining
    • Key Distribution
    • Microservices Architecture
    • Microservices Monitoring
    • Microservices Security
    • Microservices Traceability
    • Modular Monolith
    • Platform Ecosystem
    • Plugin Architecture
    • Scalability and Performance
    • Serverless
    • Service Collaboration
    • Service Mesh
    • SOA
    • Spring is bloated
    • Stages of API Adoption
    • Transaction Management
    • Microservices Cross-cutting Concerns Options
    • Service Mesh Plus
    • Service Discovery
  • Design
    • Design Overview
    • Design First vs Code First
    • Desgin Pattern
    • Service Evolution
    • Consumer Contract and Consumer Driven Contract
    • Handling Partial Failure
    • Idempotency
    • Server Life Cycle
    • Environment Segregation
    • Database
    • Decomposition Patterns
    • Http2
    • Test Driven
    • Multi-Tenancy
    • Why check token expiration
    • WebServices to Microservices
  • Cross-Cutting Concerns
    • Concerns Overview
  • API Styles
    • Light-4j for absolute performance
    • Style Overview
    • Distributed session on IMDG
    • Hybrid Serverless Modularized Monolithic
    • Kafka - Event Sourcing and CQRS
    • REST - Representational state transfer
    • Web Server with Light
    • Websocket with Light
    • Spring Boot Integration
    • Single Page Application
    • GraphQL - A query language for your API
    • Light IBM MQ
    • Light AWS Lambda
    • Chaos Monkey
  • Infrastructure Services
    • Service Overview
    • Light Proxy
    • Light Mesh
    • Light Router
    • Light Portal
    • Messaging Infrastructure
    • Centralized Logging
    • COVID-19
    • Light OAuth2
    • Metrics and Alerts
    • Config Server
    • Tokenization
    • Light Controller
  • Tool Chain
    • Tool Chain Overview
  • Utility Library
  • Service Consumer
    • Service Consumer
  • Development
    • Development Overview
  • Deployment
    • Deployment Overview
    • Frontend Backend
    • Linux Service
    • Windows Service
    • Install Eventuate on Windows
    • Secure API
    • Client vs light-router
    • Memory Limit
    • Deploy to Kubernetes
  • Benchmark
    • Benchmark Overview
  • Tutorial
    • Tutorial Overview
  • Troubleshooting
    • Troubleshoot
  • FAQ
    • FAQ Overview
  • Milestones
  • Contribute
    • Contribute to Light
    • Development
    • Documentation
    • Example
    • Tutorial
“Config Server Design” was last updated: April 2, 2019: fixes #62 add Chinese language for the document site (5c820aa)
Improve this page
  • News
  • Docs
  • Community
  • Reddit
  • GitHub
  • About Light
  • Getting Started
  • Architecture
  • Design
  • Cross-Cutting Concerns
  • API Styles
  • Infrastructure Services
  • Tool Chain
  • Utility Library
  • Service Consumer
  • Development
  • Deployment
  • Benchmark
  • Tutorial
  • Troubleshooting
  • FAQ
  • Milestones
  • Contribute