Effective Password Management in Source Code: Secure Solutions with sops and AWS KMS

About the Client:

Our client, specialized in the development of applications for processing sensitive data, attaches great importance to security, especially in the management of passwords in their source codes. The client was looking for efficient and reliable solutions to ensure that sensitive information is protected while ensuring a smooth operation.


The new solution is developed with a focus on AWS Serverless Services. Users gain access to the web frontend via a centralized user management provided by AWS Cognito in combination with SSO and Azure AD. Provisioning is done via ECS Fargate and NEXT JS, the content is stored in S3. Lambda functions serve as an interface to external data sources, S3 and the Aurora Serverless RDS database.


To address this challenge, our customer decided to implement sops (Secrets Operator) in combination with AWS Key Management Service (KMS). Sops is an open source tool that simplifies the encryption of files,1 while KMS from AWS enables secure management of encryption keys.

The process began with the creation of an IAM user and a KMS key in the customer’s existing AWS account. Then sops was installed and configured to work with the KMS key.

Once the user and key were set up, our client was able to encrypt and decrypt password files. The files that contained environment variables (.yaml, .env, .json, etc.) were encrypted, specifying the KMS key and AWS profile to allow seamless integration with different environments and work profiles.

An example command to encrypt a file is:

Sops -k $SOPS_KMS_ARN -aws-profile myProfile -e -i myFile.env

With this approach, the keys remained readable while the passwords were securely encrypted. This allowed the team to store sensitive data securely in the source code without compromising security.

Benefits for our Client:

The implementation of sops in conjunction with AWS KMS brought several benefits to our customer:

Improved Security

Sensitive information such as passwords are securely encrypted, significantly reducing the risk of unauthorized access.

Smooth Workflow

Thanks to the seamless integration with AWS and the user-friendly handling of sops, the development process was not affected. The team was able to work efficiently without having to worry about security concerns.

Flexibility and Scalability

The solution can be easily adapted to different use cases and environments and grows with the company’s requirements.


Overall, the successful implementation of sops in conjunction with AWS KMS enabled our client to securely manage sensitive password files in source code. This solution not only enhanced security, but also enabled a smooth workflow and provided remarkable flexibility for different use cases and environments. The successful implementation of these measures illustrates the effectiveness and strategic value that innovative security initiatives bring to software development.

Have questions about this project or are you looking to modernize your own cloud infrastructure?

Contact our cloud expert, Robert Hackenfort.

Quelle Icons: Graphic’s Art, Haka Studio, Freepik