How to guarantee the security of your secrets with a limited budget?

How to guarantee the security of your secrets with a limited budget?

Introduction

Properly managing secrets throughout the code lifecycle is one of the parts that always stands out in a cloud development lifecycle assurance process. By secrets we mean assets like database credentials, API keys, connections strings, and other sensitive information. It is important to adopt security practices to securely and safely store secrets and access them from applications, services, or other resources in a controlled and trazable way. Secrets protection can be part of a zero trust strategy. Zero trust is a security approach that assumes that all resources, including applications, services, and data, are potentially compromised and should not be trusted by default. One of the fundamental principles of zero trust is to limit access to sensitive resources, including secrets, based on the identity of the requesting entity (who) and the context of the request (what).

Referring specifically to #AWS, we have a tool like "Secrets manager" that allows you to apply strong access controls to your secrets, ensuring that only authorized entities can access them.

We all know the benefits of using Secrets Manager on AWS. But when the budget is a constraint (or when there is no budget available to cover that cost) we can start to secure our secrets through "Parameter Store" practically for free.

AWS Parameter Store is a secure and scalable storage solution for managing configuration data and secrets. It allows you to store sensitive information such as secrets, tokens, API keys, and any kind of credentials in a centralized vault that can be easily accessed by your applications. With AWS Parameter Store, you can manage your configuration data and secrets across different environments and regions. This makes it easy to maintain consistency and avoid configuration drift, which can lead to security vulnerabilities and downtime.

Lets imagine we have the following scenario:

We came across a project with limited financial resources when it comes to the execution of technological projects, however this cannot be taken as an excuse to leave security aside, therefore we had to put ourselves in the task of finding cheaper ways to implement the controls designed for the project.

With that backgroud then we have the followin prequisites:

  • A security definition indicates that we shouldn't use sensitive data as a plain text across AWS services or in any CI/CD pipelines.
  • The Security Team must have complete control over who has access to sensitive data and be able to audit its access.
  • The sensitive data must be encrypted.


My proposal

As stated in the introduction, although the perfect tool for this task may be Secrets Manager, it is not the best when it comes to costs. AWS offers another option called AWS Systems Manager.

AWS Systems Manager is a service offered by AWS which can integrate with many other services to facilitate configuration and management. The “Parameter Store” is the most relevant part of this solution. It allows us to store encrypted strings and plain text parameters that can be easily accessed during runtime of our pipelines or scripts.

In order to facilitate the process, we developed a guideline to help, but the most important set up are “Type” and “Value”. Take a look:

No hay texto alternativo para esta imagen

  • Login to AWS Amazon Web Services (AWS) (awsapps.com) and select Account:


No hay texto alternativo para esta imagen

  • Select the environment where the task will be deployed and on the Administration profile, enter the "Management console" option:


No hay texto alternativo para esta imagen

  • In the search field, perform the query for the “Parameter Store” feature and select the resulting option:




No hay texto alternativo para esta imagen

  • Select the “Create parameter” option:




  • Complete the configuration of the parameter, based on the requirements detailed in the Task created in point 5.3.1. These must be:


No hay texto alternativo para esta imagen

# The “Name” is a random value with no restrictions. Obviously, the internally defined criteria must be followed to call the section.


No hay texto alternativo para esta imagen

# "Description” (it's optional)


No hay texto alternativo para esta imagen

# AWS Parameter Store offers two “Tiers”: Standard and Advanced.

The Standard tier is designed for small to medium-sized workloads, while the Advanced tier is suitable for larger workloads that require higher throughput and scalability.


No hay texto alternativo para esta imagen

# “Type” describes what type of string we want. In Parameter Store we can set three types of parameters: a simple String, a StringList type, or/and SecureString type. Choose the “SecureString” parameter because we need to store and reference sensitive data in a secure manner. So, if we have data that we don't want to be altered by unauthorized users or we don´t want sensitive data to be referenced  in plaintext (such as passwords, secrets, tokens, or license keys) the advice is to create those parameters using the SecureString data type (Remember the prerequisite 1 and 3!).


No hay texto alternativo para esta imagen

# “Value” is a piece of data that is saved in a Parameter Store, this data could be a password, a license key, or simply a plain text. It's possible to reference this data from a script or any piece of code. You just need to specify the parameter name using the correct convention.


No hay texto alternativo para esta imagen

# “Tags” (it's optional) are key-value pairs that you can assign to your parameters. They can be used to categorize and filter parameters, making it easier to find specific parameters when you need them. For example, you could use tags to group parameters by environment (e.g. production, staging, development), application component (e.g. frontend, backend, database), or any other criteria that makes sense for your organization.


No hay texto alternativo para esta imagen

# Finish the operation by selecting ”Create parameter”.


Conclusion

Like Secrets Manager, Parameter Store provides encryption for secrets at rest using KMS, and fine-grained access control through IAM. You can also use Parameter Store to perform secret rotation, although this requires more manual setup than the automated rotation provided by Secrets Manager.

One of the main advantages of the AWS Parameter Store is the centralization of configuration data. AWS Systems Manager allows you to centralize operational data from different AWS services and automate tasks on AWS resources. Parameter Store, a capability of AWS Systems Manager, provides a secure, centralized store for application configuration data. This allows users to easily access and update configuration data in one place, simplifying configuration management and reducing the risk of errors and conflicts]. In addition, Parameter Store offers the ability to operate anywhere on AWS, on-premises, hybrid, and at the edge, increasing flexibility and scalability.

In our case we were looking for the feature to encrypt our secrets at near zero cost, and we have achieved it. We used an approach where our secure access settings do not negatively affect developers.

The main benefits of this method are:

  • It is safe and simple to implement.
  • Its syntax is built in for decryption in serverless.yml
  • AWS credentials are leveraged, which means it is auditable!
  • Does not add cost to the AWS account budget or at least not as much as other solutions (depends on the tier used).
  • Including a secure and scalable secrets management service that is hosted and doesn't require you to manage any servers.Relieve your IT team from some administrative tasks.
  • Enhance the security posture by segregating sensitive data from code.
  • Enabling the control and audit of any use of the parameters at granular levels.


Another scenario when AWS Parameter Store couldbe used is for configuration management. Configuration data includes settings and parameters that determine how an application behaves. With AWS Parameter Store, you can store configuration data and retrieve it at runtime. This allows you to make changes to configuration settings without having to redeploy your application.

We still have to define a secret rotation plan, after analyzing the number of secrets we manage and the frequency with which they are used but I´ll leave that for another article ;).


References


Jorge Ivan Marmolejo Cardona

Information Risk Advisor | 27001 Consultant | CCSK Contributor | CertiProf ISO 27001:2022 Lead Auditor | CS-900 Security, Compliance, and Identity Fundamentals | ISACA CSX-Cybersecurity Practitioner

1y

Amazing Advice!!!

Like
Reply

To view or add a comment, sign in

More articles by Martín Boratto

Insights from the community

Others also viewed

Explore topics