Posts

Showing posts with the label Spring Boot

Integrate HashiCorp Vault with Spring Boot application

Image
In this section, we will learn how to integrate HashiCorp Vault with Spring Boot application and how to use HashiCorp vault to store secret in Spring Boot application. Assume in production environment we need to setup secure storage for our application database credentials, passwords, API keys or any other secret and sensitive data. HashiCorp vault allows us to secure applications and protect sensitive data with reduce the risk of breaches and data exposure with identity-based security automation and encryption-as-a-service. Let's begin, 1. HashiCorp vault local installation First, you should install hashicorp vault in your local machine.   Please refer installation guide (macOS, Windows, Linux) to setup vault locally. 2. Start the vault server After installed the vault, execute following command to start vault server: vault server - dev If everything goes fine, you will find similar output in the console like below :  Copy Root token for future purpose. If you need to set custom

Spring Boot, Google Cloud Key Management Service (KMS) - Encryption Decryption Example

Image
In this section,  we will learn  how to use the Spring Boot on Google Cloud Key Management Service (KMS) integration and how to encrypt and decrypt data using symmetric Cloud KMS keys. Cloud Key Management Service (Cloud KMS) allows you to create, import, and manage cryptographic keys and perform cryptographic operations in a single centralized cloud service. You can use these keys and perform these operations by using Cloud KMS directly, by using Cloud HSM or Cloud External Key Manager, or by using Customer-Managed Encryption Keys (CMEK) integrations within other Google Cloud services. More Info - click here Let's begin, 1. Create a GCP Project First, Sign into the Google console at  https://console.cloud.google.com . You can create a new project by first selecting the project dropdown in the top left and selecting " New Project ". Next, specify your GCP  Project name  and  Project ID . Then  Click on the " CREATE " button. Copy " Project ID " and ke