Posts

Showing posts with the label Vault

Manage configurations with ASP NET Core on Ubuntu

Manage configurations with ASP NET Core on Ubuntu Managing configurations can be challenging. We cannot simply check-in in our repository secrets and connection strings and at the same time we want an easy way to maintain them. Today we will see how we can manage secrets is am easy way on Ubuntu with systemd. Make secrets available on server with systemd Manage secrets locally with UserSecrets on ASP NET Core Manage UserSecrets for dotnet Console Application Goal We need to keep secrets out of the source code. Therefore we want to have our application get secrets locally for local testing and we want the application to get them in our hosted environment. In order to achieve that we will use systemd override configuration to hold configuration of secrets on our server and in our local machine we will use UserSecrets which holds configurations in the user app folder. Take note that UserSecrets file is not encrypted. The only protection we get is the OS user protection. If you...

Hashicorp Vault behind IIS

Image
Hashicorp Vault behind IIS Last week I talked about Hashicorp Vault and how it could be used to store secrets . Today I will continue on the same line and show how we can host Vault behind IIS and use what we learnt in the previous post to retrieve secrets from ASP.NET Core. Setup Vault Read secrets from Vault from ASP.NET Core 1. Setup Vault Vault is a webserver which comes with a complete API. In this example, we will show how to setup Vault and proxy calls from IIS to Vault. 1.1 Boot Vault To begin with, we can follow the same steps described in my previous post - Hashicorp Vault and how it could be used to store secrets . As a quick overview, here are the steps to be executed inside Windows Server: download Vault create the config.hcl file run the command vault.exe server -config=config.hcl In config.hcl, we configured Vault to listen on http://localhost:8200 so the next thing to do is to proxy calls from IIS to Vault process. 1.2 Configure IIS to direct calls to...

Manage secrets with Hashicorp Vault

Manage secrets with Hashicorp Vault During development it is common to save local connection string in the code via setting files. But when it comes the time to deploy, hosted environments should not have their secrets persisted as plain text in the code. Since those can’t be saved in the git repository, they have to be stored in a secure place where they can be managed easily, a vault . Hashicorp Vault is one of this software which allows us to store and retrieve secrets while providing a granular level of control over the secret accesses. Today we will see the basic configuration of Hashicorp Vault to store and retrieve secrets using the Vault CLI. This post will be composed by four parts: Start Vault Save secrets Create a role with a policy Retrieve secrets 1. Start Vault 1.1 Configure Vault Head to https://www.vaultproject.io/downloads.html and download the latest binaries of Vault then place it in a folder and add the folder to PATH. Before starting Vault we need to ...