{"id":31621,"date":"2023-10-26T07:00:00","date_gmt":"2023-10-26T14:00:00","guid":{"rendered":"https:\/\/cloudinary.com\/blog\/?p=31621"},"modified":"2024-06-27T11:12:56","modified_gmt":"2024-06-27T18:12:56","slug":"protecting-cloudinary-credentials-enterprise","status":"publish","type":"post","link":"https:\/\/cloudinary.com\/blog\/protecting-cloudinary-credentials-enterprise","title":{"rendered":"Protecting Cloudinary Credentials in an Enterprise Setting"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">The Challenge<\/h2>\n\n\n\n<p>For IT and DevOps professionals, securing API credentials is crucial. While production systems often pull Cloudinary API credentials from secret managers, hands-on tasks like setup or maintenance present some challenges:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Importing credentials into the shell session.<\/strong> This leaves the API secret in the shell history.<\/li>\n\n\n\n<li><strong>Using a <code>.env<\/code> file.<\/strong> This risks storing unencrypted credentials on the hard drive.<\/li>\n<\/ol>\n\n\n\n<p>So, how can we handle API credentials securely during hands-on work?<\/p>\n\n\n\n<p>In this article, we&#8217;ll directly pull credentials from the secrets manager into a shell session, minimizing exposure and aligning with cybersecurity best practices. Our sample code is designed for AWS Secrets Manager users with <code>bash<\/code> or <code>zsh<\/code> shells and the <code>aws<\/code> CLI. However, this approach can be adapted for other platforms.<\/p>\n\n\n\n<p>Let&#8217;s dive into a safer way to manage our API secrets during hands-on tasks.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The Solution<\/h2>\n\n\n\n<p>In our solution, we&#8217;ll utilize a shell script designed to be <em>sourced<\/em> into your active shell session.<\/p>\n\n\n\n<p>The distinction of sourcing is essential. By sourcing, the script operates within the current shell environment, allowing direct modification and introduction of environment variables.<\/p>\n\n\n\n<p>This method ensures Cloudinary API credentials are integrated into your session without leaving traces in shell history or persisting on the disk. It&#8217;s a technique that prioritizes both convenience and security, ensuring sensitive data remains transient and confined to the active session.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Storing the Secret<\/h3>\n\n\n\n<p>We&#8217;ll store the environment variable definitions as new-line separated shell variable definitions with an AWS Secrets Manager.<\/p>\n\n\n<div class='c-callout  c-callout--inline-title c-callout--note'><strong class='c-callout__title'>Note:<\/strong> <p>Don\u2019t use quotes around the variable values.<\/p>\n<\/div>\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash shcb-wrap-lines\">```bash\nCLOUDINARY_ENV_DISPLAY_NAME=SAMPLE ENVIRONMENT\nCLOUDINARY_URL=cloudinary:\/\/***************:**********************@sample-environment\n```<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n<div class=\"wp-block-cloudinary-markdown \"><\/div>\n\n\n<p>Step 1: Store your credentials with AWS Secrets Manager.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img width=\"1024\" height=\"755\" data-public-id=\"Web_Assets\/blog\/proc-s01-store-text-secret\/proc-s01-store-text-secret.png\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/w_1024,h_755,c_scale\/f_auto,q_auto\/v1698178708\/Web_Assets\/blog\/proc-s01-store-text-secret\/proc-s01-store-text-secret.png?_i=AA\" alt=\"\" class=\"wp-post-31621 wp-image-31626\" data-format=\"png\" data-transformations=\"f_auto,q_auto\" data-version=\"1698178708\" data-seo=\"1\" srcset=\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1698178708\/Web_Assets\/blog\/proc-s01-store-text-secret\/proc-s01-store-text-secret.png?_i=AA 1108w, https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1698178708\/Web_Assets\/blog\/proc-s01-store-text-secret\/proc-s01-store-text-secret.png?_i=AA 300w, https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1698178708\/Web_Assets\/blog\/proc-s01-store-text-secret\/proc-s01-store-text-secret.png?_i=AA 768w, https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1698178708\/Web_Assets\/blog\/proc-s01-store-text-secret\/proc-s01-store-text-secret.png?_i=AA 1024w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Retrieving the Secret<\/h3>\n\n\n\n<p>Once authenticated against the AWS account with sufficient permissions to retrieve the secret value, you&#8217;ll get this:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash shcb-wrap-lines\">```sh\n&gt; aws secretsmanager get-secret-value \\\n    --secret-id <span class=\"hljs-string\">\"cld-credentials\/sample-environment\"<\/span> \\\n    --region <span class=\"hljs-string\">\"us-east-2\"<\/span> \\\n    --query SecretString \\\n    --output text\n\nCLOUDINARY_ENV_DISPLAY_NAME=SAMPLE ENVIRONMENT\nCLOUDINARY_URL=cloudinary:\/\/***************:**********************@sample-environment\n```<span class=\"hljs-comment\">#<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n<div class=\"wp-block-cloudinary-markdown \"><\/div>\n\n\n<h2 class=\"wp-block-heading\">Loading Credential Variables Into the Shell Session<\/h2>\n\n\n\n<p>From here you&#8217;ll need to process the result line by line and export each variable definition:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash shcb-wrap-lines\"><span class=\"hljs-comment\"># --------------------------------------------------------------------------<\/span>\n<span class=\"hljs-comment\"># Assumes input to be string in the format \"&lt;VAR_NAME&gt;=&lt;VAR_VALUE&gt;\"<\/span>\n<span class=\"hljs-comment\"># Exports the variable definition into the current shell session to make it<\/span>\n<span class=\"hljs-comment\"># available to any child process started from the shell.<\/span>\n<span class=\"hljs-comment\"># --------------------------------------------------------------------------<\/span>\n<span class=\"hljs-function\"><span class=\"hljs-title\">export_variable_from_string<\/span><\/span>() {\n    <span class=\"hljs-built_in\">local<\/span> str=<span class=\"hljs-string\">\"<span class=\"hljs-variable\">$1<\/span>\"<\/span>\n    <span class=\"hljs-comment\"># Extract the variable name<\/span>\n    <span class=\"hljs-built_in\">local<\/span> var_name=<span class=\"hljs-string\">\"<span class=\"hljs-variable\">${str%%=*}<\/span>\"<\/span>             <span class=\"hljs-comment\"># Everything before the first '='<\/span>\n    <span class=\"hljs-comment\"># Extract the value<\/span>\n    <span class=\"hljs-built_in\">local<\/span> var_value=<span class=\"hljs-string\">\"<span class=\"hljs-variable\">${str#*${var_name}<\/span>=}\"<\/span>  <span class=\"hljs-comment\"># Everything after the first '='<\/span>\n\n    <span class=\"hljs-built_in\">export<\/span> <span class=\"hljs-string\">\"<span class=\"hljs-variable\">${var_name}<\/span>=<span class=\"hljs-variable\">${var_value}<\/span>\"<\/span>\n\n    <span class=\"hljs-keyword\">if<\/span> &#91;&#91; $? -ne 0 ]]\n    <span class=\"hljs-keyword\">then<\/span>\n        <span class=\"hljs-built_in\">echo<\/span> <span class=\"hljs-string\">\"One of the variables failed to be imported.\"<\/span> &gt;&amp;2\n        <span class=\"hljs-built_in\">echo<\/span> <span class=\"hljs-string\">\"It is still recommended to terminate the shell session to dispose of other imported variables.\"<\/span> &gt;&amp;2\n        <span class=\"hljs-built_in\">return<\/span> 1\n    <span class=\"hljs-keyword\">fi<\/span>\n}\n\n<span class=\"hljs-comment\"># --------------------------------------------------------------------------<\/span>\n<span class=\"hljs-comment\"># Assumes input to be a multi-line string (secret value retrieved from<\/span>\n<span class=\"hljs-comment\"># secrets manager).<\/span>\n<span class=\"hljs-comment\"># Exports variable definition from each line into the shell session.<\/span>\n<span class=\"hljs-comment\"># --------------------------------------------------------------------------<\/span>\n<span class=\"hljs-function\"><span class=\"hljs-title\">load_secrets_from_string<\/span><\/span>() {\n    <span class=\"hljs-built_in\">local<\/span> secret_text_value=<span class=\"hljs-string\">\"<span class=\"hljs-variable\">$1<\/span>\"<\/span>\n    <span class=\"hljs-built_in\">local<\/span> IFS=$<span class=\"hljs-string\">'\\n'<\/span> <span class=\"hljs-comment\">#Read line-by-line<\/span>\n    <span class=\"hljs-keyword\">while<\/span> IFS= <span class=\"hljs-built_in\">read<\/span> -r var_definition; <span class=\"hljs-keyword\">do<\/span>\n        export_variable_from_string <span class=\"hljs-string\">\"<span class=\"hljs-variable\">$var_definition<\/span>\"<\/span>\n    <span class=\"hljs-keyword\">done<\/span> &lt;&lt;&lt; <span class=\"hljs-string\">\"<span class=\"hljs-variable\">$secret_text_value<\/span>\"<\/span>\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Putting It All Together<\/h2>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash shcb-wrap-lines\"><span class=\"hljs-meta\">#!\/usr\/bin\/env sh\n<\/span>\n<span class=\"hljs-comment\">#<\/span>\n<span class=\"hljs-comment\"># \u2757\ufe0fmake sure to paste the above shell functions from the article<\/span>\n<span class=\"hljs-comment\">#<\/span>\n\nARG_SECRET_ID=<span class=\"hljs-string\">\"<span class=\"hljs-variable\">$1<\/span>\"<\/span>\nARG_SECRET_REGION=<span class=\"hljs-string\">\"<span class=\"hljs-variable\">$2<\/span>\"<\/span>\n\n<span class=\"hljs-comment\"># Ensure required parameters are set<\/span>\n<span class=\"hljs-keyword\">if<\/span> &#91; -z <span class=\"hljs-string\">\"<span class=\"hljs-variable\">${ARG_SECRET_ID}<\/span>\"<\/span> ] || &#91; -z <span class=\"hljs-string\">\"<span class=\"hljs-variable\">${ARG_SECRET_REGION}<\/span>\"<\/span> ]; <span class=\"hljs-keyword\">then<\/span>\n    <span class=\"hljs-built_in\">echo<\/span> <span class=\"hljs-string\">\"Error: Missing required parameters.\"<\/span>\n    <span class=\"hljs-built_in\">return<\/span> 1\n<span class=\"hljs-keyword\">fi<\/span>\n\n\n<span class=\"hljs-comment\">#<\/span>\n<span class=\"hljs-comment\"># MAIN<\/span>\n<span class=\"hljs-comment\">#<\/span>\n\nSECRET_VALUE=$( \\\n    aws secretsmanager get-secret-value \\\n    --secret-id <span class=\"hljs-string\">\"<span class=\"hljs-variable\">${ARG_SECRET_ID}<\/span>\"<\/span> \\\n    --region <span class=\"hljs-string\">\"<span class=\"hljs-variable\">${ARG_SECRET_REGION}<\/span>\"<\/span> \\\n    --query SecretString \\\n    --output text \\\n)\n\nload_secrets_from_string <span class=\"hljs-string\">\"<span class=\"hljs-variable\">$SECRET_VALUE<\/span>\"<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">How to Use It<\/h2>\n\n\n\n<p>Let&#8217;s assume you&#8217;ve saved the script as a <code>load-cred.sh<\/code> file. Then using it may look like this.<\/p>\n\n\n\n<p>Using the load credentials script:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img width=\"719\" height=\"551\" data-public-id=\"Web_Assets\/blog\/proc-s02-first-use\/proc-s02-first-use.png\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/w_719,h_551,c_scale\/f_auto,q_auto\/v1698179229\/Web_Assets\/blog\/proc-s02-first-use\/proc-s02-first-use.png?_i=AA\" alt=\"\" class=\"wp-post-31621 wp-image-31627\" data-format=\"png\" data-transformations=\"f_auto,q_auto\" data-version=\"1698179229\" data-seo=\"1\" srcset=\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1698179229\/Web_Assets\/blog\/proc-s02-first-use\/proc-s02-first-use.png?_i=AA 719w, https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1698179229\/Web_Assets\/blog\/proc-s02-first-use\/proc-s02-first-use.png?_i=AA 300w\" sizes=\"auto, (max-width: 719px) 100vw, 719px\" \/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\">Implementation: Tips for Improvements<\/h2>\n\n\n\n<p>If you plan to use this solution repeatedly with other team members, you may find the following improvement tips to be useful.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Informing Users of the Effect<\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash shcb-wrap-lines\"><span class=\"hljs-comment\"># --------------------------------------------------------------------------<\/span>\n<span class=\"hljs-comment\"># Uses values of previously set variables to update shell prompt (updates PS1<\/span>\n<span class=\"hljs-comment\"># environment variable)<\/span>\n<span class=\"hljs-comment\"># <\/span>\n<span class=\"hljs-comment\"># - Appends environment display name (value of the CLOUDINARY_ENV_DISPLAY_NAME variable)<\/span>\n<span class=\"hljs-comment\">#   + Green background for \"Sandbox\" environments ($CLOUDINARY_ENV_TYPE == 'sandbox')<\/span>\n<span class=\"hljs-comment\">#   + Red background otherwise (Production credentials assumed)<\/span>\n<span class=\"hljs-comment\"># - Appends \"Cloud with lightning\" emoji to the shell prompt<\/span>\n<span class=\"hljs-comment\"># --------------------------------------------------------------------------<\/span>\n<span class=\"hljs-function\"><span class=\"hljs-title\">update_shell_prompt<\/span><\/span>() {\n    <span class=\"hljs-built_in\">local<\/span> cloud_name=<span class=\"hljs-string\">\"<span class=\"hljs-variable\">$CLOUDINARY_ENV_DISPLAY_NAME<\/span>\"<\/span>\n    <span class=\"hljs-keyword\">if<\/span> &#91; -z <span class=\"hljs-string\">\"<span class=\"hljs-variable\">$cloud_name<\/span>\"<\/span> ]; <span class=\"hljs-keyword\">then<\/span>\n        cloud_name=<span class=\"hljs-string\">\"Cred. label not set\"<\/span>\n    <span class=\"hljs-keyword\">fi<\/span>\n\n    <span class=\"hljs-built_in\">local<\/span> fg_color=<span class=\"hljs-string\">'37'<\/span> <span class=\"hljs-comment\"># white<\/span>\n    <span class=\"hljs-built_in\">local<\/span> bg_color=<span class=\"hljs-string\">'41'<\/span> <span class=\"hljs-comment\"># red<\/span>\n    <span class=\"hljs-keyword\">if<\/span> &#91;&#91; <span class=\"hljs-string\">\"<span class=\"hljs-variable\">$CLOUDINARY_ENV_TYPE<\/span>\"<\/span> == *<span class=\"hljs-string\">'sandbox'<\/span>* ]]\n    <span class=\"hljs-keyword\">then<\/span>\n        bg_color=<span class=\"hljs-string\">'42'<\/span> <span class=\"hljs-comment\"># green<\/span>\n    <span class=\"hljs-keyword\">fi<\/span>\n    <span class=\"hljs-built_in\">local<\/span> color_seq=$<span class=\"hljs-string\">'\\e&#91;'<\/span><span class=\"hljs-string\">\"<span class=\"hljs-variable\">${fg_color}<\/span>;<span class=\"hljs-variable\">${bg_color}<\/span>m\"<\/span>\n    <span class=\"hljs-built_in\">local<\/span> color_reset_seq=$<span class=\"hljs-string\">'\\e&#91;0m'<\/span>\n    PS1=<span class=\"hljs-string\">\"<span class=\"hljs-variable\">${PS1:-}<\/span> <span class=\"hljs-variable\">${color_seq}<\/span><span class=\"hljs-variable\">${cloud_name}<\/span><span class=\"hljs-variable\">${color_reset_seq}<\/span> \ud83c\udf29\ufe0f  \"<\/span>\n    <span class=\"hljs-built_in\">export<\/span> PS1\n}\n\n<span class=\"hljs-comment\"># --------------------------------------------------------------------------<\/span>\n<span class=\"hljs-comment\"># Informs script user of the changes made to the shell<\/span>\n<span class=\"hljs-comment\"># --------------------------------------------------------------------------<\/span>\n<span class=\"hljs-function\"><span class=\"hljs-title\">inform_user<\/span><\/span>() {\n    <span class=\"hljs-built_in\">local<\/span> color_seq=$<span class=\"hljs-string\">'\\e&#91;30;43m'<\/span>\n    <span class=\"hljs-built_in\">local<\/span> color_reset_seq=$<span class=\"hljs-string\">'\\e&#91;0m'<\/span>\n    <span class=\"hljs-built_in\">echo<\/span> <span class=\"hljs-string\">\"\"<\/span>\n    <span class=\"hljs-built_in\">echo<\/span> <span class=\"hljs-string\">\"\u2757\ufe0f<span class=\"hljs-variable\">${color_seq}<\/span>Important<span class=\"hljs-variable\">${color_reset_seq}<\/span> Credentials loaded from Secrets Manager.\"<\/span>$<span class=\"hljs-string\">'\\n'<\/span> \\\n         <span class=\"hljs-string\">\"Exit the shell when done to dispose of secrets in environment variables.\"<\/span>$<span class=\"hljs-string\">'\\n'<\/span> \\\n         <span class=\"hljs-string\">\"Child processes started from this shell will inherit environment variables.\"<\/span>\n    <span class=\"hljs-built_in\">echo<\/span> <span class=\"hljs-string\">\"\"<\/span>\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\">Removing Interim Variables<\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash shcb-wrap-lines\"><span class=\"hljs-comment\"># --------------------------------------------------------------------------<\/span>\n<span class=\"hljs-comment\"># Unsets (removes) interim variables from the shell session to avoid <\/span>\n<span class=\"hljs-comment\"># unnecessary copies of the secret info and secret value.<\/span>\n<span class=\"hljs-comment\"># Use before exiting the script<\/span>\n<span class=\"hljs-comment\"># --------------------------------------------------------------------------<\/span>\n<span class=\"hljs-function\"><span class=\"hljs-title\">unset_interim_variables<\/span><\/span>() {\n    <span class=\"hljs-built_in\">unset<\/span> ARG_SECRET_ID\n    <span class=\"hljs-built_in\">unset<\/span> ARG_SECRET_REGION\n    <span class=\"hljs-built_in\">unset<\/span> SECRET_VALUE\n}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\">Enforcing the Script Sourcing<\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash shcb-wrap-lines\"><span class=\"hljs-comment\"># --------------------------------------------------------------------------<\/span>\n<span class=\"hljs-comment\"># Use at the beginning of the script to ensure the script is explicitly<\/span>\n<span class=\"hljs-comment\"># sourced by the user<\/span>\n<span class=\"hljs-comment\"># --------------------------------------------------------------------------<\/span>\n<span class=\"hljs-function\"><span class=\"hljs-title\">inform_must_be_sourced<\/span><\/span>() {\n    <span class=\"hljs-built_in\">echo<\/span> <span class=\"hljs-string\">\"The script must be sourced. Use 'source &lt;script&gt; --help' for more information.\"<\/span> &gt;&amp;2\n}\n\n<span class=\"hljs-keyword\">if<\/span> &#91;&#91; -n <span class=\"hljs-string\">\"<span class=\"hljs-variable\">$BASH_VERSION<\/span>\"<\/span> ]]; <span class=\"hljs-keyword\">then<\/span> \n    <span class=\"hljs-keyword\">if<\/span> &#91;&#91; <span class=\"hljs-string\">\"<span class=\"hljs-variable\">$0<\/span>\"<\/span> == <span class=\"hljs-string\">\"<span class=\"hljs-variable\">$BASH_SOURCE<\/span>\"<\/span> ]]; <span class=\"hljs-keyword\">then<\/span>\n        <span class=\"hljs-comment\"># Evaluates to true when script is being directly executed in bash<\/span>\n        inform_must_be_sourced\n        <span class=\"hljs-built_in\">exit<\/span> 1\n    <span class=\"hljs-keyword\">fi<\/span>\n<span class=\"hljs-keyword\">elif<\/span> &#91;&#91; -n <span class=\"hljs-string\">\"<span class=\"hljs-variable\">$ZSH_VERSION<\/span>\"<\/span> ]]; <span class=\"hljs-keyword\">then<\/span>\n    <span class=\"hljs-keyword\">if<\/span> &#91;&#91; ! <span class=\"hljs-string\">\"<span class=\"hljs-variable\">$ZSH_EVAL_CONTEXT<\/span>\"<\/span> == *<span class=\"hljs-string\">\"toplevel:file\"<\/span>* ]]; <span class=\"hljs-keyword\">then<\/span>\n        <span class=\"hljs-comment\"># Evaluates to true when script is being directly executed in zsh<\/span>\n        inform_must_be_sourced\n        <span class=\"hljs-built_in\">exit<\/span> 1\n    <span class=\"hljs-keyword\">fi<\/span>\n<span class=\"hljs-keyword\">else<\/span>\n    <span class=\"hljs-built_in\">echo<\/span> <span class=\"hljs-string\">\"Only bash and zsh shells are supported.\"<\/span>\n    <span class=\"hljs-built_in\">exit<\/span> 1\n<span class=\"hljs-keyword\">fi<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\">Preventing Repeated Import of Credentials<\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash shcb-wrap-lines\"><span class=\"hljs-function\"><span class=\"hljs-title\">inform_already_loaded<\/span><\/span>() {\n    <span class=\"hljs-built_in\">echo<\/span> <span class=\"hljs-string\">\"Credentials already loaded into this shell session. Exit the shell to dispose of them.\"<\/span> &gt;&amp;2\n}\n\n<span class=\"hljs-keyword\">if<\/span> &#91; -n <span class=\"hljs-string\">\"<span class=\"hljs-variable\">$__CLD_CREDS_LOADED<\/span>\"<\/span> ]; <span class=\"hljs-keyword\">then<\/span>\n    inform_already_loaded\n    <span class=\"hljs-built_in\">return<\/span> 1\n<span class=\"hljs-keyword\">fi<\/span>\n\n<span class=\"hljs-comment\"># ... After credentials have been loaded into the session<\/span>\n__CLD_CREDS_LOADED=1\n<span class=\"hljs-comment\"># ...<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\">Adding Explicit CLI Arguments<\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"Bash\" data-shcb-language-slug=\"bash\"><span><code class=\"hljs language-bash shcb-wrap-lines\"><span class=\"hljs-function\"><span class=\"hljs-title\">print_script_usage<\/span><\/span>() {\n    <span class=\"hljs-built_in\">echo<\/span> <span class=\"hljs-string\">\"Usage: source cld-cred-from-aws-secret.sh --secret-id &lt;AWS_SECRET_ID&gt; --region &lt;AWS_REGION&gt;\"<\/span>\n    <span class=\"hljs-built_in\">echo<\/span> <span class=\"hljs-string\">\"\"<\/span>\n    <span class=\"hljs-built_in\">echo<\/span> <span class=\"hljs-string\">\"Description: Retrieves credentials from AWS Secrets Manager and imports them as environment variables\"<\/span> \\\n         <span class=\"hljs-string\">\"into the current shell session.\"<\/span>\n    <span class=\"hljs-built_in\">echo<\/span> <span class=\"hljs-string\">\"\"<\/span>\n    <span class=\"hljs-built_in\">echo<\/span> <span class=\"hljs-string\">\"Options:\"<\/span>\n    <span class=\"hljs-built_in\">echo<\/span> <span class=\"hljs-string\">\"  --secret-id    The ID of the AWS secret.\"<\/span>\n    <span class=\"hljs-built_in\">echo<\/span> <span class=\"hljs-string\">\"  --region       The AWS region to retrieve the secret from.\"<\/span>\n}\n\n<span class=\"hljs-comment\">## Print use when no arguments were provided<\/span>\n<span class=\"hljs-keyword\">if<\/span> &#91; <span class=\"hljs-string\">\"<span class=\"hljs-variable\">$#<\/span>\"<\/span> -eq 0 ]; <span class=\"hljs-keyword\">then<\/span>\n    print_script_usage\n    <span class=\"hljs-built_in\">return<\/span> 0\n<span class=\"hljs-keyword\">fi<\/span>\n\n<span class=\"hljs-comment\"># Parse commandline arguments<\/span>\nARG_SECRET_ID=<span class=\"hljs-string\">\"\"<\/span>\nARG_SECRET_REGION=<span class=\"hljs-string\">\"\"<\/span>\n\n<span class=\"hljs-keyword\">while<\/span> &#91; <span class=\"hljs-string\">\"<span class=\"hljs-variable\">$#<\/span>\"<\/span> -gt 0 ]; <span class=\"hljs-keyword\">do<\/span>\n    <span class=\"hljs-keyword\">case<\/span> <span class=\"hljs-string\">\"<span class=\"hljs-variable\">$1<\/span>\"<\/span> <span class=\"hljs-keyword\">in<\/span>\n        --secret-id)\n            ARG_SECRET_ID=<span class=\"hljs-string\">\"<span class=\"hljs-variable\">$2<\/span>\"<\/span>\n            <span class=\"hljs-built_in\">shift<\/span> 2\n            ;;\n        --region)\n            ARG_SECRET_REGION=<span class=\"hljs-string\">\"<span class=\"hljs-variable\">$2<\/span>\"<\/span>\n            <span class=\"hljs-built_in\">shift<\/span> 2\n            ;;\n        --<span class=\"hljs-built_in\">help<\/span>)\n            print_script_usage\n            <span class=\"hljs-built_in\">return<\/span> 0\n            ;;\n        *)\n            <span class=\"hljs-built_in\">echo<\/span> <span class=\"hljs-string\">\"Unknown option: <span class=\"hljs-variable\">$1<\/span>\"<\/span> &gt;&amp;2\n            <span class=\"hljs-built_in\">return<\/span> 1\n            ;;\n    <span class=\"hljs-keyword\">esac<\/span>\n<span class=\"hljs-keyword\">done<\/span>\n\n<span class=\"hljs-comment\"># Check if required parameters are set<\/span>\n<span class=\"hljs-keyword\">if<\/span> &#91; -z <span class=\"hljs-string\">\"<span class=\"hljs-variable\">$ARG_SECRET_ID<\/span>\"<\/span> ] || &#91; -z <span class=\"hljs-string\">\"<span class=\"hljs-variable\">$ARG_SECRET_REGION<\/span>\"<\/span> ]; <span class=\"hljs-keyword\">then<\/span>\n    <span class=\"hljs-built_in\">echo<\/span> <span class=\"hljs-string\">\"Error: Missing required parameters.\"<\/span>\n    print_script_usage\n    <span class=\"hljs-built_in\">return<\/span> 1\n<span class=\"hljs-keyword\">fi<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Bash<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">bash<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\">Miscellaneous<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Add aliases for repeated use.\n<ul class=\"wp-block-list\">\n<li>Adding aliases to your shell profile will let you leverage shell auto-completion and speed up access to the credentials for repeated use.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Use the terminal multiplexer.\n<ul class=\"wp-block-list\">\n<li>For long-running batch scripts, especially when running on a remote VM over SSH, using the terminal multiplexer, such as <code>screen<\/code> or <code>tmux<\/code>, can prevent losing progress when, for example, the SSH connection times out.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">The Results<\/h2>\n\n\n\n<p>This is how the final results may look:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img width=\"767\" height=\"482\" data-public-id=\"Web_Assets\/blog\/proc-s03-final-solution\/proc-s03-final-solution.png\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/w_767,h_482,c_scale\/f_auto,q_auto\/v1698179226\/Web_Assets\/blog\/proc-s03-final-solution\/proc-s03-final-solution.png?_i=AA\" alt=\"\" class=\"wp-post-31621 wp-image-31628\" data-format=\"png\" data-transformations=\"f_auto,q_auto\" data-version=\"1698179226\" data-seo=\"1\" srcset=\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1698179226\/Web_Assets\/blog\/proc-s03-final-solution\/proc-s03-final-solution.png?_i=AA 767w, https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1698179226\/Web_Assets\/blog\/proc-s03-final-solution\/proc-s03-final-solution.png?_i=AA 300w\" sizes=\"auto, (max-width: 767px) 100vw, 767px\" \/><\/figure><\/div>\n\n\n<p>If you found this article helpful and want to discuss it in more detail, head over to&nbsp;<a href=\"https:\/\/community.cloudinary.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Cloudinary Community<\/a>&nbsp;forum and its associated&nbsp;<a href=\"https:\/\/discord.gg\/cloudinary\" target=\"_blank\" rel=\"noreferrer noopener\">Discord<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Challenge For IT and DevOps professionals, securing API credentials is crucial. While production systems often pull Cloudinary API credentials from secret managers, hands-on tasks like setup or maintenance present some challenges: So, how can we handle API credentials securely during hands-on work? In this article, we&#8217;ll directly pull credentials from the secrets manager into [&hellip;]<\/p>\n","protected":false},"author":87,"featured_media":31624,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_cloudinary_featured_overwrite":false,"footnotes":""},"categories":[1],"tags":[332,264],"class_list":["post-31621","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-api","tag-security"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.6 (Yoast SEO v26.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Protecting Cloudinary Credentials in an Enterprise Setting<\/title>\n<meta name=\"description\" content=\"For IT and DevOps professionals, securing API credentials is crucial. Let&#039;s dive into a safer way to manage our API secrets during hands-on tasks.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cloudinary.com\/blog\/protecting-cloudinary-credentials-enterprise\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Protecting Cloudinary Credentials in an Enterprise Setting\" \/>\n<meta property=\"og:description\" content=\"For IT and DevOps professionals, securing API credentials is crucial. Let&#039;s dive into a safer way to manage our API secrets during hands-on tasks.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cloudinary.com\/blog\/protecting-cloudinary-credentials-enterprise\" \/>\n<meta property=\"og:site_name\" content=\"Cloudinary Blog\" \/>\n<meta property=\"article:published_time\" content=\"2023-10-26T14:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-06-27T18:12:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/v1698168353\/Blog-Protecting_Credientials_Enterprise\/Blog-Protecting_Credientials_Enterprise-jpg?_i=AA\" \/>\n\t<meta property=\"og:image:width\" content=\"2000\" \/>\n\t<meta property=\"og:image:height\" content=\"1100\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"melindapham\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"NewsArticle\",\"@id\":\"https:\/\/cloudinary.com\/blog\/protecting-cloudinary-credentials-enterprise#article\",\"isPartOf\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/protecting-cloudinary-credentials-enterprise\"},\"author\":{\"name\":\"melindapham\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#\/schema\/person\/0d5ad601e4c3b5be89245dfb14be42d9\"},\"headline\":\"Protecting Cloudinary Credentials in an Enterprise Setting\",\"datePublished\":\"2023-10-26T14:00:00+00:00\",\"dateModified\":\"2024-06-27T18:12:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/protecting-cloudinary-credentials-enterprise\"},\"wordCount\":481,\"publisher\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/protecting-cloudinary-credentials-enterprise#primaryimage\"},\"thumbnailUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1698168353\/Blog-Protecting_Credientials_Enterprise\/Blog-Protecting_Credientials_Enterprise.jpg?_i=AA\",\"keywords\":[\"API\",\"Security\"],\"inLanguage\":\"en-US\",\"copyrightYear\":\"2023\",\"copyrightHolder\":{\"@id\":\"https:\/\/cloudinary.com\/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cloudinary.com\/blog\/protecting-cloudinary-credentials-enterprise\",\"url\":\"https:\/\/cloudinary.com\/blog\/protecting-cloudinary-credentials-enterprise\",\"name\":\"Protecting Cloudinary Credentials in an Enterprise Setting\",\"isPartOf\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/protecting-cloudinary-credentials-enterprise#primaryimage\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/protecting-cloudinary-credentials-enterprise#primaryimage\"},\"thumbnailUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1698168353\/Blog-Protecting_Credientials_Enterprise\/Blog-Protecting_Credientials_Enterprise.jpg?_i=AA\",\"datePublished\":\"2023-10-26T14:00:00+00:00\",\"dateModified\":\"2024-06-27T18:12:56+00:00\",\"description\":\"For IT and DevOps professionals, securing API credentials is crucial. Let's dive into a safer way to manage our API secrets during hands-on tasks.\",\"breadcrumb\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/protecting-cloudinary-credentials-enterprise#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cloudinary.com\/blog\/protecting-cloudinary-credentials-enterprise\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudinary.com\/blog\/protecting-cloudinary-credentials-enterprise#primaryimage\",\"url\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1698168353\/Blog-Protecting_Credientials_Enterprise\/Blog-Protecting_Credientials_Enterprise.jpg?_i=AA\",\"contentUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1698168353\/Blog-Protecting_Credientials_Enterprise\/Blog-Protecting_Credientials_Enterprise.jpg?_i=AA\",\"width\":2000,\"height\":1100},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cloudinary.com\/blog\/protecting-cloudinary-credentials-enterprise#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cloudinary.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Protecting Cloudinary Credentials in an Enterprise Setting\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#website\",\"url\":\"https:\/\/cloudinary.com\/blog\/\",\"name\":\"Cloudinary Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cloudinary.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\",\"name\":\"Cloudinary Blog\",\"url\":\"https:\/\/cloudinary.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA\",\"contentUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA\",\"width\":312,\"height\":60,\"caption\":\"Cloudinary Blog\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#\/schema\/person\/0d5ad601e4c3b5be89245dfb14be42d9\",\"name\":\"melindapham\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e6f989fa97fe94be61596259d8629c3df65aec4c7da5c0000f90d810f313d4f4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e6f989fa97fe94be61596259d8629c3df65aec4c7da5c0000f90d810f313d4f4?s=96&d=mm&r=g\",\"caption\":\"melindapham\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Protecting Cloudinary Credentials in an Enterprise Setting","description":"For IT and DevOps professionals, securing API credentials is crucial. Let's dive into a safer way to manage our API secrets during hands-on tasks.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/cloudinary.com\/blog\/protecting-cloudinary-credentials-enterprise","og_locale":"en_US","og_type":"article","og_title":"Protecting Cloudinary Credentials in an Enterprise Setting","og_description":"For IT and DevOps professionals, securing API credentials is crucial. Let's dive into a safer way to manage our API secrets during hands-on tasks.","og_url":"https:\/\/cloudinary.com\/blog\/protecting-cloudinary-credentials-enterprise","og_site_name":"Cloudinary Blog","article_published_time":"2023-10-26T14:00:00+00:00","article_modified_time":"2024-06-27T18:12:56+00:00","og_image":[{"width":2000,"height":1100,"url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/v1698168353\/Blog-Protecting_Credientials_Enterprise\/Blog-Protecting_Credientials_Enterprise-jpg?_i=AA","type":"image\/jpeg"}],"author":"melindapham","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/cloudinary.com\/blog\/protecting-cloudinary-credentials-enterprise#article","isPartOf":{"@id":"https:\/\/cloudinary.com\/blog\/protecting-cloudinary-credentials-enterprise"},"author":{"name":"melindapham","@id":"https:\/\/cloudinary.com\/blog\/#\/schema\/person\/0d5ad601e4c3b5be89245dfb14be42d9"},"headline":"Protecting Cloudinary Credentials in an Enterprise Setting","datePublished":"2023-10-26T14:00:00+00:00","dateModified":"2024-06-27T18:12:56+00:00","mainEntityOfPage":{"@id":"https:\/\/cloudinary.com\/blog\/protecting-cloudinary-credentials-enterprise"},"wordCount":481,"publisher":{"@id":"https:\/\/cloudinary.com\/blog\/#organization"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/protecting-cloudinary-credentials-enterprise#primaryimage"},"thumbnailUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1698168353\/Blog-Protecting_Credientials_Enterprise\/Blog-Protecting_Credientials_Enterprise.jpg?_i=AA","keywords":["API","Security"],"inLanguage":"en-US","copyrightYear":"2023","copyrightHolder":{"@id":"https:\/\/cloudinary.com\/#organization"}},{"@type":"WebPage","@id":"https:\/\/cloudinary.com\/blog\/protecting-cloudinary-credentials-enterprise","url":"https:\/\/cloudinary.com\/blog\/protecting-cloudinary-credentials-enterprise","name":"Protecting Cloudinary Credentials in an Enterprise Setting","isPartOf":{"@id":"https:\/\/cloudinary.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/cloudinary.com\/blog\/protecting-cloudinary-credentials-enterprise#primaryimage"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/protecting-cloudinary-credentials-enterprise#primaryimage"},"thumbnailUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1698168353\/Blog-Protecting_Credientials_Enterprise\/Blog-Protecting_Credientials_Enterprise.jpg?_i=AA","datePublished":"2023-10-26T14:00:00+00:00","dateModified":"2024-06-27T18:12:56+00:00","description":"For IT and DevOps professionals, securing API credentials is crucial. Let's dive into a safer way to manage our API secrets during hands-on tasks.","breadcrumb":{"@id":"https:\/\/cloudinary.com\/blog\/protecting-cloudinary-credentials-enterprise#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cloudinary.com\/blog\/protecting-cloudinary-credentials-enterprise"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudinary.com\/blog\/protecting-cloudinary-credentials-enterprise#primaryimage","url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1698168353\/Blog-Protecting_Credientials_Enterprise\/Blog-Protecting_Credientials_Enterprise.jpg?_i=AA","contentUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1698168353\/Blog-Protecting_Credientials_Enterprise\/Blog-Protecting_Credientials_Enterprise.jpg?_i=AA","width":2000,"height":1100},{"@type":"BreadcrumbList","@id":"https:\/\/cloudinary.com\/blog\/protecting-cloudinary-credentials-enterprise#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cloudinary.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Protecting Cloudinary Credentials in an Enterprise Setting"}]},{"@type":"WebSite","@id":"https:\/\/cloudinary.com\/blog\/#website","url":"https:\/\/cloudinary.com\/blog\/","name":"Cloudinary Blog","description":"","publisher":{"@id":"https:\/\/cloudinary.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cloudinary.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/cloudinary.com\/blog\/#organization","name":"Cloudinary Blog","url":"https:\/\/cloudinary.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA","contentUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA","width":312,"height":60,"caption":"Cloudinary Blog"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/cloudinary.com\/blog\/#\/schema\/person\/0d5ad601e4c3b5be89245dfb14be42d9","name":"melindapham","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudinary.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e6f989fa97fe94be61596259d8629c3df65aec4c7da5c0000f90d810f313d4f4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e6f989fa97fe94be61596259d8629c3df65aec4c7da5c0000f90d810f313d4f4?s=96&d=mm&r=g","caption":"melindapham"}}]}},"jetpack_featured_media_url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1698168353\/Blog-Protecting_Credientials_Enterprise\/Blog-Protecting_Credientials_Enterprise.jpg?_i=AA","_links":{"self":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/31621","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/users\/87"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/comments?post=31621"}],"version-history":[{"count":24,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/31621\/revisions"}],"predecessor-version":[{"id":31664,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/31621\/revisions\/31664"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/media\/31624"}],"wp:attachment":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/media?parent=31621"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/categories?post=31621"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/tags?post=31621"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}