VOOZH about

URL: https://thenewstack.io/managing-secrets-in-your-devops-pipeline/

⇱ Managing Secrets in Your DevOps Pipeline  - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2022-08-04 08:36:06
Managing Secrets in Your DevOps Pipeline 
contributed,sponsor-harness,sponsored-post-contributed,
CI/CD / Security

Managing Secrets in Your DevOps Pipeline 

This article will discuss best practices for secrets management in the context of continuous integration delivery workflow.
Aug 4th, 2022 8:36am by Pavan Belagatti
👁 Featued image for: Managing Secrets in Your DevOps Pipeline 
Feature image via Pixabay.
Harness sponsored this post.

Secrets are the keys to your digital kingdom.

Pavan Belagatti
Pavan Belagatti is a global DevOps influencer, technology writer and storyteller.

They can unlock doors, authorize access and provide admission to your data. But if secrets aren’t managed correctly, they can lead to potential disaster for an organization.

If your credentials are not secured, you are doomed. Hackers are always looking for loopholes to enter your system and misuse the important information that should be kept secret.

Today, we will see what secrets management is and related best practices.

What Is Secrets Management?

Secrets management is a process of securely storing and protecting sensitive data. The need for secrets management arises when a company’s data is at risk of being compromised. The company may have to deal with the repercussions of a security breach that could result in the loss of confidential information, customer data and financial loss. Secrets management is a process that helps reduce the risks associated with sensitive data by identifying, classifying, labeling and storing it securely.

Secrets Management in CI/CD

In a CI/CD pipeline, secrets are used to authenticate and authorize applications, services and systems. Managing authentication credentials for the technologies used in your CI/CD pipeline is a challenging, time-consuming and frequently performed task. Therefore, security and reliability are the most critical features of CI/CD pipelines. Security is generally improved by securing secrets in protected areas, such as with private keys and tokens.

Securing secrets is a fundamental and necessary element of a great CI/CD platform. Confidential data and credentials must be safeguarded from unauthorized access. However, secrets management is often considered difficult because they are not immutable. They are complex and can rotate in and out of scope at any time.

Harness, the Software Delivery Platform, automates the entire CI/CD process, allowing engineers to build, test, deploy, and verify their software with enterprise-grade security and speed. Harness uses machine learning to protect you when deployments fail. Software delivery has never been so simple.
Learn More

There are many benefits to managing secrets in your CI/CD pipeline, such as standardization of credential storage, offline credential storage for failsafe use during emergencies and the ability to enforce strict access policies. This article will discuss secrets management in the context of continuous integration-delivery workflow and best practices for implementing secrets management.

Types of Secrets

Many types of secrets can be used in a CI/CD pipeline. Some popular kinds of secrets include:

  • API keys: These are used to access external services or APIs.
  • Database credentials: These are used to connect to databases.
  • SSH keys: These are used to authenticate with remote servers.
  • Git credentials: These are used to access private git repositories.

Managing Secrets: General Guidelines

There are many ways to manage secrets in a CI/CD pipeline. Of course, the best approach depends on your specific needs and the tools that you are using. However, there are some general guidelines that you can follow to help you choose the best approach for your situation.

  1. Make sure that all secrets are encrypted.

This is the most important rule. All secrets should be encrypted so they cannot be accessed by unauthorized users.

  1. Store secrets in a secure location.

Secrets should be stored in a secure location, such as a password manager or a secure file storage system. They should not be stored in plain text files or source code repositories.

  1. Use different secrets for different purposes.

Don’t use the same secret for multiple purposes. For example, don’t use the same database password for your development, staging and production environments. This makes it easier to rotate passwords and helps prevent accidental disclosure of sensitive information.

  1. Rotate secrets regularly.

Secrets should be rotated every month or every quarter. This helps to ensure that if a secret is compromised, it can be quickly replaced. It is a good practice to rotate your secrets every 90 days. Every security professional’s primary job is to ensure the teams often rotate their secrets. In addition, if any secret is compromised, the organization should be able to revoke it and stop any further misuse.

  1. Have RBAC in place.

Ensure that access to your project is limited to the authorized people only using role-based access (RBAC). This way, you can keep track of who is doing what and have complete accountability if something goes wrong.

  1. Incorporate zero-trust security.

The zero-trust security model is where anything and everyone is considered hostile. It grants the least privileged access to people working on the project. Strict protocols are followed to gain more access to the project.

  1. Never hard-code secrets.

Never include secrets in your code. If someone gains access to your code, they will also have access to your secrets. Make sure to ask for a code review from your peers.

  1. Use a secretless approach.

In a “secretless” CI/CD pipeline, all secrets are stored outside the CI/CD pipeline and referenced by name only. This can be a good option for organizations that want to simplify their pipeline configuration or don’t have many secrets to manage. But it can be cumbersome when the number of secrets grows.

  1. Use tools.

Use a tool like Hashicorp Vault or AWS KMS to encrypt secrets. This way, even if someone gains access to them, they will not be able to read them without the proper decryption key.

As more organizations adopt CI/CD pipelines, the need to securely manage secrets becomes more critical. There are a few different approaches to managing secrets in CI/CD pipelines, and the best approach depends on the organization’s needs.

Harness Secrets Management

Harness includes a built-in secrets management feature that enables you to store encrypted secrets, such as access keys, and use them in your Harness applications.

Let us see how to add a text secret to our project from Harness.

Your MongoDB string URL can be easily stored in an encrypted fashion that no attacker can guess. This can be done by going to Project setup and clicking on Secrets.

👁 Image

There are primarily three secret types you can employ with Harness: Text, File and SSH Credential. Also, you can pass the secrets via YAML builder. For the above example, we will use a Text-based secret type.

👁 Image

You can name it whatever you wish and store it securely.

👁 Image

You can see above that it is impossible for anyone to see your MongoDB URL string.

Also, you can see the type of secret management tools that can be easily integrated with Harness by going to Connectors and selecting Secret Managers.

👁 Image

👁 Image
You can see more about each secret manager — Azure Key Vault, AWS KMS, HashiCorp Vault, and Google KMS — in this Harness document.

Conclusion

DevSecOps is the most talked-about topic in the cloud native space today. Keeping secrets secure is one of the most important aspects of a DevOps pipeline. Managing your credentials and secret keys should be a high priority in any organization. If the secrets get leaked, it costs a fortune to bring back credibility and trust. Hence, investing in a platform that is well-equipped with a robust secrets management system is very important. Security is an aspect you cannot ignore.

Harness, the Software Delivery Platform, automates the entire CI/CD process, allowing engineers to build, test, deploy, and verify their software with enterprise-grade security and speed. Harness uses machine learning to protect you when deployments fail. Software delivery has never been so simple.
Learn More
TRENDING STORIES
Pavan Belagatti is a global DevOps influencer, technology writer and storyteller.
Read more from Pavan Belagatti
Harness sponsored this post.
SHARE THIS STORY
TRENDING STORIES
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.