Skip to content

mcpride/servicefabric-vault-integration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project: servicefabric-vault-integration

Description

Integrates Hashicorp's Vault into Microsoft Service Fabric, e.g. for on-prem scenarios.

Hint

This project is just a very basic example - it works - but IT IS NOT READY FOR PRODUCTION USE! No waranties! Sorry for this, but I don't have much spare time.

Getting Started

Requirements

  1. Microsoft Visual Studio 2019 or higher
  2. Microsoft Azure ServiceFabric SDK installed
  3. A ServiceFabric cluster running (Cloud, 1-Node or 5-Node)
  4. HashiCorp's vault tool (Windows: vault.exe)

Build

  1. Copy the vault tool (vault.exe) into the 'VaultService' project directory.
  2. Open the solution with Visual Studio
  3. Ensure platform is set to x64
  4. Restore all NuGet packages
  5. Build solution
  6. Run unit tests
  7. Deploy project to ServiceFabric cluster

Details

Why Microsoft Service Fabric?

If you have project requirements like high availability, scalability, independency (development, build, deployment) etc. then the microservice approach might be a solution. There are a lot of orchestrators for microservices but most of them are more or less strongly tied to linux as os and docker/ kubernetes as platform. But what if cloud deployment is just an option and on-premises deployability is required but your customer is not prepared for a linux and docker infrastructure? Here comes the outsider Microsoft Service Fabric into play which can be hosted on Linux or Windows, in the (Azure) cloud or locally and can handle docker services but can also manage pure processes.

Why HashiCorp's Vault?

Azure ServiceFabric has a rich tooling for cloud scenarios but just poor support for on-premises deployments - e.g. the key manager Azure KeyVault isn't available there. The independent tool "Vault" - available for diverse platforms - can fill such gaps because it is the "swiss army-knife" (in german: "eierlegende Wollmilchsau" ) for configuration, secrets and key management.

But ...

Vault has a lot of storage providers - some of them are enabled fo HA. Some of them are lesser stable e.g. the mssql provider makes heavy usage of inefficient "like" based search queries. Service Fabric manages it's own strategies for high availability and statefulness - unfortunately vault's possibilities doesn't integrate very well with Service Fabric.

The challenge: Use vault with Service Fabric's HA features

This project provides a Service Fabric stateful service with one named partition, which configures, starts, stops and monitors the vault tool as an external process. It also provides a partial AWS S3 web interface, which will be configured as vaults storage stanza. The service then stores the received encrypted values from vault into Service Fabric's reliable dictionaries and also handles queries and deletions over it.

ToDos

  • Extend unit tests
  • Add integration tests
  • Implement consistent error handling
  • Extend documentation
  • Add build script's
  • Add automated builds
  • Add linux compatibility
  • Improve security
    • SSL/TLS encryption
    • Manage authentication / authorizaion for local S3 web interface
  • Auto-initialize, unseal and bootstrap vault
  • Refactor code (e.g. use options for configuration etc.)

Credits

This project uses some ideas and source code from Gokhan Demir's (yadazula) S3Emulator project Credits also goes to Hashicorp for the vault tool and to Microsoft for the Service Fabric orchestration environment and all the programming tools around.

License

The source code of this repository is under MIT license. See the LICENSE file for details.

About

Integrates Hashicorp's Vault into Microsoft Service Fabric, e.g. for on-prem scenarios

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published