{"id":11093,"date":"2022-04-05T07:29:46","date_gmt":"2022-04-05T07:29:46","guid":{"rendered":"https:\/\/blog.cloudthat.com\/?p=11093"},"modified":"2024-06-25T11:03:01","modified_gmt":"2024-06-25T11:03:01","slug":"protect-data-aws-secrets-manager-step-by-step-guide-to-configure-amazons-secret-manager","status":"publish","type":"blog","link":"https:\/\/www.cloudthat.com\/resources\/blog\/protect-your-data-with-aws-secrets-manager-step-by-step-guide-to-configure-amazons-secret-manager","title":{"rendered":"Protect your Data with AWS Secrets Manager: Step-by-Step Guide to Configure Amazon\u2019s Secret Manager"},"content":{"rendered":"<table style=\"height: 208px;\" border=\"3\" width=\"379\">\n<tbody>\n<tr>\n<td>\n<h2><span style=\"color: #000080;\"><strong>TABLE OF CONTENT<\/strong><\/span><\/h2>\n<\/td>\n<\/tr>\n<tr>\n<td><a href=\"#introduction\">1. Introduction to Amazon\u2019s Secret Manager <\/a><\/td>\n<\/tr>\n<tr>\n<td><a href=\"#features\">2. Features<\/a><\/td>\n<\/tr>\n<tr>\n<td><a href=\"#steps\">3. Steps to Configure AWS Secrets Manager<\/a><\/td>\n<\/tr>\n<tr>\n<td><a href=\"#conclusion\">4. Conclusion<\/a><\/td>\n<\/tr>\n<tr>\n<td><a href=\"#aboutcloudthat\">5. About CloudThat <\/a><\/td>\n<\/tr>\n<tr>\n<td><a href=\"#faqs\">6. FAQs <\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2 id=\"introduction\">1. Introduction to Amazon\u2019s Secret Manager<\/h2>\n<p>When you create a custom application to retrieve information from a database, you would typically embed the credentials, or secret, for directly accessing the database in the application. When the time comes to rotate the credentials, you have to do more than create new ones. You needed to spend time updating the application to use the new credentials. The updated application was then distributed. If you had multiple applications that shared credentials and failed to update one of them, the application would fail. Because of this risk, many customers choose not to rotate credentials regularly, effectively substituting one risk for another.<\/p>\n<p>The diagram below depicts the most basic scenario. The diagram shows how you can save database credentials in Secrets Manager and then use those credentials in an application to access the database.<\/p>\n<p><a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/secretmanager1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11094\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/secretmanager1.png\" alt=\"AWS Secret Manager\" width=\"788\" height=\"282\" \/><\/a><\/p>\n<h2 id=\"features\">2. Features:<\/h2>\n<h3>a. Programmatically retrieve encrypted secret values at runtime<\/h3>\n<p>Secrets Manager enhances your security posture by removing hard-coded credentials from your application source code and not storing credentials within the application. Storing the credentials in or with the application exposes them to compromise by anyone who has access to your application or its components. In addition, this process makes rotating your credentials difficult because you must update your application and deploy the changes to every client before you can deprecate the old credentials.<\/p>\n<p>Amazon Secrets Manager allows you to replace stored credentials with a runtime call to the Secrets Manager Web service, allowing you to retrieve them dynamically.<\/p>\n<h3>b. Store different types of secrets<\/h3>\n<p>Secrets Manager allows you to store text in a secret encrypted secret data component. This usually comprises the database or service&#8217;s connection information. These parameters may include the server name, IP address, port number, and the user name and password used to access the service. The protected text doesn&#8217;t include:<\/p>\n<ol>\n<li>Secret name and description<\/li>\n<li>Rotation or expiration settings<\/li>\n<li>ARN of the KMS key associated with the secret<\/li>\n<li>Any attached AWS tags<\/li>\n<\/ol>\n<h3>c. Encrypt your secret data<\/h3>\n<p>Secrets Manager encrypts a secret&#8217;s protected text using AWS Key Management Service. AWS KMS is used for key storage and encryption by many AWS services. When your secret is at rest, AWS KMS assures its safe encryption. Every secret is associated with a KMS key in Secrets Manager. It can be either an AWS-managed key for the account&#8217;s Secrets Manager or a customer-controlled key created in AWS KMS.<\/p>\n<h3>d. Automatically rotate your secrets<\/h3>\n<p>Secrets Manager automatically rotates the secrets without any user intervention, and rotation will happen on schedules<\/p>\n<p>Rotation of the secrets will be implemented using the <a href=\"https:\/\/blog.cloudthat.com\/aws-lambda-amazon-lambda-function\/\">AWS Lambda function<\/a>, and this function defines how Secrets Manager performs the following tasks:<\/p>\n<ol>\n<li>Creates a new version of the secret.<\/li>\n<li>Stores the secret in Secrets Manager.<\/li>\n<li>Configures the protected service to use the latest version.<\/li>\n<li>Verifies the new version.<\/li>\n<li>Marks the new version as production-ready.<\/li>\n<\/ol>\n<p>The below mention types of databases are supported for configuring secrets and ready-to-use rotation<\/p>\n<ol>\n<li>Amazon Aurora on Amazon RDS<\/li>\n<li>MySQL on Amazon RDS<\/li>\n<li>PostgreSQL on Amazon RDS<\/li>\n<li>Oracle on Amazon RDS<\/li>\n<li>MariaDB on Amazon RDS<\/li>\n<li>Microsoft SQL Server on Amazon RDS<\/li>\n<li>Amazon DocumentDB<\/li>\n<li>Amazon Redshift<\/li>\n<\/ol>\n<h3 id=\"steps\">3. Steps to Configure AWS Secrets Manager:<\/h3>\n<ol>\n<li>Navigate to the AWS Secrets Manager Console<br \/>\n<a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/secretmanager2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11095\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/secretmanager2.png\" alt=\"AWS Secret Manager\" width=\"631\" height=\"142\" \/><\/a><\/li>\n<li>Click on Store a new secret<br \/>\n<a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/secretmanager3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11096\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/secretmanager3.png\" alt=\"AWS Secret Manager\" width=\"631\" height=\"142\" \/><\/a><\/li>\n<li>Select the <strong>Secret Type<\/strong> to be stored along with the <strong>Credentials<\/strong> and the database details the secret will access<br \/>\nProvide the encryption key as well for encrypting the secret information. Custom keys can also be used for encryption<br \/>\nAfter selecting all the details, click on <strong>Next<br \/>\n<a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/secretmanager4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11097\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/secretmanager4.png\" alt=\"AWS Secret Manager\" width=\"588\" height=\"226\" \/><\/a><br \/>\n<a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/secretmanager5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11098\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/secretmanager5.png\" alt=\"AWS Secret Manager\" width=\"631\" height=\"338\" \/><\/a><br \/>\n<\/strong><\/li>\n<li>Name the secret for identifying easily along with the description.<br \/>\nMention the tags details<br \/>\nAdd Resource permissions to access the secrets across AWS accounts securely if required<br \/>\nThere is an option to replicate the secret across regions, select if required.<br \/>\nClick on <strong>Next<\/strong> after selecting all the details<br \/>\n<a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/secretmanager6.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11099\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/secretmanager6.png\" alt=\"AWS Secret Manager\" width=\"631\" height=\"235\" \/><\/a><br \/>\n<a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/secretmanager7.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11100\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/secretmanager7.png\" alt=\"AWS Secret Manager\" width=\"631\" height=\"447\" \/><\/a><\/li>\n<li>On the Next page, configure the automatic rotation interval and the lambda function for rotation. Click on <strong>Next<\/strong>, after selecting all the details<br \/>\n<a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/secretmanager8.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11101\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/secretmanager8.png\" alt=\"AWS Secret Manager\" width=\"631\" height=\"439\" \/><\/a><\/li>\n<li>On the next page, review all the details and click on <strong>Store<br \/>\n<a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/secretmanager9.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11102\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/secretmanager9.png\" alt=\"AWS Secret Manager\" width=\"500\" height=\"348\" \/><\/a><br \/>\n<a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/secretmanager10.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11103\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/secretmanager10.png\" alt=\"AWS Secret Manager\" width=\"523\" height=\"368\" \/><\/a><br \/>\n<\/strong><\/li>\n<li>On navigating to the Secrets Manager console, will be able to see the secrets have been created successfully<br \/>\n<a href=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/secretmanager11.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11104\" src=\"https:\/\/content.cloudthat.com\/resources\/wp-content\/uploads\/2022\/11\/secretmanager11.png\" alt=\"AWS Secret Manager\" width=\"631\" height=\"227\" \/><\/a><\/li>\n<\/ol>\n<h3 id=\"conclusion\">4. Conclusion:<\/h3>\n<p>AWS Secrets Manager allows you to replace hardcoded credentials, such as passwords, in your code with an API call to Secrets Manager to retrieve the secret programmatically. Because the secret no longer exists in the code, this helps ensure that it cannot be compromised by someone examining your code. You can also set Secrets Manager to rotate the secret on a predefined schedule. It allows you to replace long-term secrets with short-term ones, significantly lowering the risk of compromise.<\/p>\n<p>The configured secrets can be embedded into any database application to provide an additional layer of security for your databases. AWS Secrets Manager is also in compliance following various security standards protocols like HIPAA, PCI, ISO, SOC, FedRAMP, etc.,<\/p>\n<h3 id=\"aboutcloudthat\">5. About CloudThat<\/h3>\n<p id=\"About CloudThat\"><a href=\"https:\/\/www.cloudthat.com\/\" target=\"_blank\" rel=\"noopener\"><strong>CloudThat<\/strong><\/a>\u00a0is\u00a0the official AWS (Amazon Web Services) Advanced Consulting Partner and Training partner and Microsoft gold partner, helping people develop knowledge of the cloud and help their businesses aim for higher goals using best in industry cloud computing practices and expertise. We are on a mission to build\u00a0a robust\u00a0cloud computing ecosystem by disseminating\u00a0knowledge on technological intricacies within the cloud space.\u00a0Our blogs, webinars,\u00a0case studies, and white papers\u00a0enable all the stakeholders in the cloud computing sphere.<\/p>\n<p><a href=\"https:\/\/www.cloudthat.com\/\"><strong>CloudThat<\/strong>\u00a0<\/a>is a\u00a0<span class=\"TextRun BCX0 SCXP93070984\" lang=\"EN-IN\" xml:lang=\"EN-IN\" data-usefontface=\"true\" data-contrast=\"none\"><span class=\"NormalTextRun BCX0 SCXP93070984\">house\u00a0of\u00a0All-Encompassing\u00a0IT\u00a0Services\u00a0on the Cloud offering\u00a0<span class=\"TextRun BCX0 SCXP59000031\" lang=\"EN-IN\" xml:lang=\"EN-IN\" data-usefontface=\"true\" data-contrast=\"none\"><span class=\"NormalTextRun BCX0 SCXP59000031\">Multi-cloud Security &amp; Compliance, Cloud Enablement Services, Cloud-Native Application Development, OTT-Video Tech Delivery Services, Training and Development, and System Integration Services.\u00a0<\/span><\/span><span class=\"TextRun BCX0 SCXP59000031\" lang=\"EN-IN\" xml:lang=\"EN-IN\" data-usefontface=\"true\" data-contrast=\"none\"><span class=\"NormalTextRun BCX0 SCXP59000031\"><span class=\"EOP SCXP258354852 BCX0\"><span class=\"EOP SCXP66056781 BCX0\"><span class=\"EOP SCXP242272637 BCX0\"><span class=\"TextRun SCXP239778695 BCX0\" lang=\"EN-IN\" xml:lang=\"EN-IN\" data-usefontface=\"true\" data-contrast=\"none\"><span class=\"NormalTextRun SCXP239778695 BCX0\">Explore our\u00a0<a href=\"https:\/\/www.cloudthat.com\/expert-advisory\/\">consulting and expert advisory services here<\/a>.<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>\n<h3 id=\"faqs\">6. FAQs<\/h3>\n<p><span style=\"text-decoration: underline;\">1. How will my application make use of these secrets?<\/span><\/p>\n<p>To begin with, create an AWS Identity and Access Management (IAM) policy that allows your application to access particular secrets. Then, in the application source code, replace plain-text secrets with code to get these secrets programmatically using the Secrets Manager APIs.<\/p>\n<p><span style=\"text-decoration: underline;\">2. How does AWS Secrets Manager handle database credential rotation while minimizing the effect on applications?<\/span><\/p>\n<p>AWS Secrets Manager allows you to arrange database credential rotation. This allows you to adhere to security best practices and rotate your database credentials adequately. Secrets Manager utilizes the super database credentials you gave to create a clone user with the same rights but a new password when you start a rotation. Secrets Manager then sends the clone user information to databases and apps, which get the database credentials.<\/p>\n<p><span style=\"text-decoration: underline;\">3. Will changing database credentials affect open connections?<\/span><\/p>\n<p>No. When a connection is established, authentication takes place. The open database connection is not re-authenticated when AWS Secrets Manager rotates a database credential.<\/p>\n<p><span style=\"text-decoration: underline;\">4. How can I find out when AWS Secrets Manager rotates a database credential?<\/span><\/p>\n<p>When AWS Secrets Manager rotates a secret, you may set up Amazon CloudWatch Events to get a notice. You may also use the Secrets Manager console or APIs to discover when Secrets Manager last rotated a secret.<\/p>\n","protected":false},"author":248,"featured_media":11182,"parent":0,"comment_status":"open","ping_status":"open","template":"","blog_category":[3606,3607],"user_email":"bhanuprakashr@cloudthat.com","published_by":"324","primary-authors":"","secondary-authors":"","acf":[],"_links":{"self":[{"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/blog\/11093"}],"collection":[{"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/blog"}],"about":[{"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/types\/blog"}],"author":[{"embeddable":true,"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/users\/248"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/comments?post=11093"}],"version-history":[{"count":1,"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/blog\/11093\/revisions"}],"predecessor-version":[{"id":41174,"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/blog\/11093\/revisions\/41174"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/media?parent=11093"}],"wp:term":[{"taxonomy":"blog_category","embeddable":true,"href":"https:\/\/www.cloudthat.com\/resources\/wp-json\/wp\/v2\/blog_category?post=11093"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}