{"id":601878,"date":"2020-02-20T15:41:58","date_gmt":"2020-02-20T14:41:58","guid":{"rendered":"https:\/\/www.devoteam.com\/expert-view\/how-to-hide-your-secrets-in-a-git-repository-based-on-centos-7\/"},"modified":"2020-02-20T15:41:58","modified_gmt":"2020-02-20T14:41:58","slug":"how-to-hide-your-secrets-in-a-git-repository-based-on-centos-7","status":"publish","type":"expert-view","link":"https:\/\/devoteam.info\/en-nl\/expert-view\/how-to-hide-your-secrets-in-a-git-repository-based-on-centos-7\/","title":{"rendered":"How to hide your secrets in a git repository &#8211; based on CentOS 7"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p>How do you deal with variable files that contain private data such as AWS access key ID, AWS secret access key, database passwords, application credentials, and so on, when you are going to push them to a git repository? Even if this repository is private, it is still a risk to expose them to the outside world. Storing them separately could be an option. However, these files are then not <a href=\"https:\/\/nl.devoteam.com\/en\/blog-post\/high-performing-organizations-version-control\/\">version controlled<\/a>. Filenames change, locations change, passwords change from time to time, some new information appears, other is removed. Besides, you have to bother downloading these files where they need to be for each build.<\/p>\n<p>How does git-secret come into play in this case? Git-secret is a bash tool. It encrypts files with the public keys of all users that you trust using GPG and stores them inside a git repository. So you have all the changes for every commit. These files can only be decrypted by those users you trust with their secret keys.<\/p>\n<h3>In this blog, we cover the following topics:<\/h3>\n<ul>\n<li>creating GPG keys<\/li>\n<li>installing git-secret<\/li>\n<li>encrypting files using git-secret<\/li>\n<li>sharing the repo with other developers in your team<\/li>\n<li>decrypting files in Jenkins pipeline<\/li>\n<\/ul>\n<p><em><strong>Note that this blog is based on CentOS 7.<\/strong><\/em><\/p>\n<h2><span>CREATING GPG KEYS<\/span><\/h2>\n<h4>1. Use the following command to generate a key pair that consists of a public and a private key:<\/h4>\n<div class=\"block-fullwidth-dark\">\n<pre>$ gpg2 --gen-key.<\/pre>\n<\/div>\n<h4><span><span>2. Select what kind of key you prefer:<br \/>\n<\/span><\/span><\/h4>\n<div class=\"block-fullwidth-dark\">\n<pre>Please select what kind of key you want:\n(1) RSA and RSA (default)\n(2) DSA and Elgamal\n(3) DSA (sign only)\n(4) RSA (sign only)\nYour selection?<\/pre>\n<\/div>\n<p><em>Press the\u00a0<strong>Enter<\/strong>\u00a0key to assign a default value if desired.\u00a0<\/em><\/p>\n<h4>3. Choose the key size:<\/h4>\n<div class=\"block-fullwidth-dark\">\n<pre>RSA keys may be between 1024 and 4096 bits long.\nWhat keysize do you want? (2048)<\/pre>\n<\/div>\n<p><em>The default one is 2048, which is sufficient for almost all users and represents an extremely strong level of security.<\/em><\/p>\n<h4>4. Choose when the key will expire:<\/h4>\n<div class=\"block-fullwidth-dark\">\n<pre>Please specify how long the key should be valid.\n0 = key does not expire\nd = key expires in n days\nw = key expires in n weeks\nm = key expires in n months\ny = key expires in n years\nkey is valid for? (0)<\/pre>\n<\/div>\n<p><em>The default one, in which key does not expire, is not always a wise choice. Instead, you should consider your own situation, like when the email address on the key becomes invalid.<\/em><\/p>\n<h4>5. Enter <span style=\"text-decoration: underline\"><strong>y<\/strong><\/span> to finish the process:<\/h4>\n<div class=\"block-fullwidth-dark\">\n<pre>Is this correct (y\/N)?<\/pre>\n<\/div>\n<h4>6. Enter your name and email address for your GPG key in order to authenticate you as a real individual.<\/h4>\n<div class=\"block-fullwidth-dark\">\n<pre>GnuPG needs to construct a user ID to identify your key.\nReal name: Developer1\nEmail address: Developer1@gmail.com<\/pre>\n<\/div>\n<h4>7. At the confirmation prompt, enter the letter O to continue if all entries are correct, or use the other options to fix any problems.<\/h4>\n<div class=\"block-fullwidth-dark\">\n<pre>Comment:\nYou selected this USER-ID:\n\"Developer1 &lt;Developer1@gmail.com&gt;\"\n\nChange (N)ame, (C)omment, (E)mail or (O)kay\/(Q)uit?<\/pre>\n<\/div>\n<h4>8. Enter a passphrase for your secret key:<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/gpg-secret-key-image-1-devoteam.png\" alt=\"\" width=\"580\" height=\"201\" class=\"alignleft size-full wp-image-80594\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><em>You will be asked to enter twice to ensure no typing errors.<\/em><\/p>\n<h4>9. Finally, your keys are complete and ready to use.<\/h4>\n<div class=\"block-fullwidth-dark\">\n<pre>pub 2048R\/7F8997F9 2020-02-08 [expires: 2021-02-07]\nKey fingerprint = CDD1 B78C 37FE D444 24A0 EB3D 856A C611 7F89 97F9\nuid Developer1 &lt;Developer1@gmail.com&gt;\nsub 2048R\/14117673 2020-02-08 [expires: 2021-02-07]<\/pre>\n<\/div>\n<h2>How to install GIT-secret on CentOS 7<\/h2>\n<p>The installation is very simple:<\/p>\n<h4>1. Find rpm package:<\/h4>\n<div class=\"block-fullwidth-dark\">\n<pre>$ wget https:\/\/bintray.com\/sobolevn\/rpm\/rpm -O bintray-sobolevn-rpm.repo<\/pre>\n<\/div>\n<h4>2. Move the repository to the folder where yum can find:<\/h4>\n<div class=\"block-fullwidth-dark\">\n<pre>$ sudo mv bintray-sobolevn-rpm.repo \/etc\/yum.repos.d\/<\/pre>\n<\/div>\n<h4>3. Install git-secret:<\/h4>\n<div class=\"block-fullwidth-dark\">\n<pre>$ sudo yum install git-secret<\/pre>\n<\/div>\n<h2>GIT-secret usage<\/h2>\n<h4>1. Before starting, make sure you have created gpg RSA key-pair: public and secret key identified by your email address.<\/h4>\n<h4>2. Begin with an existing or new git repository where your files with private data.<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/git-secret-usage-image-1-devoteam.png\" alt=\"\" width=\"466\" height=\"46\" class=\"alignleft size-full wp-image-80600\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h4>3. Initialize this git repository as a git-secret repository using the command below, which will then create a .gitsecret\/ folder.<\/h4>\n<div class=\"block-fullwidth-dark\">\n<pre>$ git secret init<\/pre>\n<\/div>\n<h4>4. Add the first user to the git-secret repo keyring by running git secret tell Developer1@gmail.com<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/git-secret-usage-image-2-devoteam.png\" alt=\"\" width=\"817\" height=\"128\" class=\"alignleft size-full wp-image-80602\" \/><\/p>\n<h4>5. Add files you wish to encrypt inside the git-secret repository.<\/h4>\n<div class=\"block-fullwidth-dark\">\n<pre>$ git secret add vars.yml<\/pre>\n<\/div>\n<p><em>After the above command:<\/em><\/p>\n<div class=\"block-fullwidth-dark\">\n<pre>git-secret: these files are not in .gitignore: vars.yml\ngit-secret: auto adding them to .gitignore\ngit-secret: 1 item(s) added.<\/pre>\n<\/div>\n<h4>6. Encrypt all files which you have just added. The data will be encrypted with the public-keys described by the git secret tell command.<\/h4>\n<div class=\"block-fullwidth-dark\">\n<pre>$ git secret hide<\/pre>\n<\/div>\n<p><em>After the above command:<\/em><\/p>\n<div class=\"block-fullwidth-dark\">\n<pre>git-secret: done. 1 of 1 files are hidden.<\/pre>\n<\/div>\n<h4>7. Let\u2019s check the status:<\/h4>\n<div class=\"block-fullwidth-dark\">\n<pre>$ git status<\/pre>\n<\/div>\n<p><em>Now the vars.yml has been hidden. There is only one vars.yml.secret file.<\/em><\/p>\n<div class=\"block-fullwidth-dark\">\n<pre># On branch master\n# Untracked files:\n# (use \"git add &lt;file&gt;...\" to include in what will be committed)\n#\n#   .gitignore\n#   .gitsecret\/\n#   production.yml\n#   test.yml\n#   vars.yml.secret<\/pre>\n<\/div>\n<h4>8. After using git secret hide to encrypt your data, it is safe to commit your changes.<\/h4>\n<div class=\"block-fullwidth-dark\">\n<pre>$ git add .\n$ git commit \u2013m \u2018initial commit\u2019<\/pre>\n<\/div>\n<div class=\"block-fullwidth-dark\">\n<pre>9 files changed, 4 insertions(+)\ncreate mode 100644 .gitignore\ncreate mode 100644 .gitsecret\/keys\/pubring.gpg\ncreate mode 100644 .gitsecret\/keys\/pubring.gpg~\ncreate mode 100644 .gitsecret\/keys\/secring.gpg\ncreate mode 100644 .gitsecret\/keys\/trustdb.gpg\ncreate mode 100644 .gitsecret\/paths\/mapping.cfg\ncreate mode 100644 production.yml\ncreate mode 100644 test.yml\ncreate mode 100644 vars.yml.secret<\/pre>\n<\/div>\n<h4>9. Let\u2019s see what if you want read the vars.yml.secret file brutally.<\/h4>\n<div class=\"block-fullwidth-dark\">\n<pre>$ vim vars.yml.secret<\/pre>\n<\/div>\n<p><em>The data are already encrypted.<\/em><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/git-secret-usage-image-encrypted-datadevoteam.png\" alt=\"\" width=\"803\" height=\"160\" class=\"alignleft size-full wp-image-80604\" \/><\/p>\n<h4>10. Later you can decrypt files with the following command.<\/h4>\n<div class=\"block-fullwidth-dark\">\n<pre>$ git secret reveal \u2013p \u2018your password\u2019<\/pre>\n<\/div>\n<h2>How to add users to GIT-secret<\/h2>\n<h4>1. Suppose Developer2 is the user you want to add.<\/h4>\n<div class=\"block-fullwidth-dark\">\n<pre>gpg: next trustdb check due at 2021-02-07\npub 2048R\/F29ADD1D 2020-02-08 [expires: 2021-02-07]\nKey fingerprint = 54F6 0D8B 51E4 789F 6DC1 738F ADAD 5D52 F29A DD1D\nuid Developer2 &lt;Developer2@gmail.com&gt;\nsub 2048R\/8AA98590 2020-02-08 [expires: 2021-02-07]<\/pre>\n<\/div>\n<h4>2. Get his\/her gpg public-key. You won\u2019t need the secret key. After running the following command, you will find a file named publickey.asc in the current folder.<\/h4>\n<div class=\"block-fullwidth-dark\">\n<pre>$ gpg --export \"Developer2\" &gt; publickey.asc<\/pre>\n<\/div>\n<h4>3. Import this key into your gpg setup.<\/h4>\n<div class=\"block-fullwidth-dark\">\n<pre>$ gpg \u2013import publickey.asc<\/pre>\n<\/div>\n<div class=\"block-fullwidth-dark\">\n<pre>gpg: key F29ADD1D: public key \"Developer2 &lt;Developer2@gmail.com&gt;\" imported\ngpg: Total number processed: 1\ngpg: imported: 1 (RSA: 1)<\/pre>\n<\/div>\n<h4>4. Let\u2019s have a look at the keys we have so far.<\/h4>\n<div class=\"block-fullwidth-dark\">\n<pre>$ gpg --list-keys<\/pre>\n<\/div>\n<p><em>The public key from Developer2 has been imported successfully.<\/em><\/p>\n<div class=\"block-fullwidth-dark\">\n<pre>-------------------------------\npub 2048R\/7F8997F9 2020-02-08 [expires: 2021-02-07]\nuid Developer1 &lt;Developer1@gmail.com&gt;\nsub 2048R\/14117673 2020-02-08 [expires: 2021-02-07]\n\npub 2048R\/F29ADD1D 2020-02-08 [expires: 2021-02-07]\nuid Developer2 &lt;Developer2@gmail.com&gt;\nsub 2048R\/8AA98590 2020-02-08 [expires: 2021-02-07]<\/pre>\n<\/div>\n<h4>5. Now add this person to your secrets repo.<\/h4>\n<div class=\"block-fullwidth-dark\">\n<pre>$ git secret tell Developer2@gmail.com<\/pre>\n<\/div>\n<h4>6. Now, re-encrypt the files and then commit and push the newly encrypted files. (The -d options deletes the unencrypted file after re-encrypting it).<\/h4>\n<div class=\"block-fullwidth-dark\">\n<pre>$ git secret reveal\n$ git secret hide \u2013d\n$ git add .\n$ git commit \u2013m \u2018second commit\u2019\n$ git push origin master<\/pre>\n<\/div>\n<h4>7. Let\u2019s work on Developer2\u2019s machine.<\/h4>\n<div class=\"block-fullwidth-dark\">\n<pre>$ git clone https:\/\/github.com\/username\/git-secret-Example.git\n$ ls\nproduction.yml  README.md  test.yml  vars.yml.secret<\/pre>\n<\/div>\n<p><em>No vars.yml file.<\/em><\/p>\n<p><em>To prove this is really the Developer2\u2019s machine:<\/em><\/p>\n<div class=\"block-fullwidth-dark\">\n<pre>$ gpg --list-keys<\/pre>\n<\/div>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/git-secret-usageproof-developers-machie-devoteam.png\" alt=\"\" width=\"550\" height=\"92\" class=\"alignleft size-full wp-image-80605\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><em>Decrypt the vars.yml.<\/em><\/p>\n<div class=\"block-fullwidth-dark\">\n<pre>$ git secret reveal \u2013p \u2018your password\u2019\ngit-secret: done. 1 of 1 files are revealed.\n$ ls\nproduction.yml README.md test.yml vars.yml vars.yml.secret<\/pre>\n<\/div>\n<p><em>Now the vars.yml is decrypted.<\/em><\/p>\n<h2>Jenkins pipeline<\/h2>\n<h4>1. Add gpg passphrase in global credentials:<\/h4>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/git-jenkins-pipeline-global-credentials-devoteam.png\" alt=\"\" width=\"1458\" height=\"381\" class=\"alignleft size-full wp-image-80606\" \/><\/p>\n<h4>2. Setup the environment in the pipeline:<\/h4>\n<div class=\"block-fullwidth-dark\">\n<p>\u00a0 environment {<br \/>\ngpg_passphrase = credentials(&#8220;gpg-passphrase&#8221;)<br \/>\n}<\/p>\n<\/div>\n<h4>3. In the first stage, execute this step:<\/h4>\n<div class=\"block-fullwidth-dark\">\n<p>sh &#8220;git secret reveal -p &#8216;$gpg_passphrase&#8217; &#8221;<\/p>\n<\/div>\n<h4>4. Now Jenkins can automatically decrypt the encrypted files.<\/h4>\n<h3><\/h3>\n<h3>You did it!<\/h3>\n<p>Need some more help with setting up GIT-secrets or Jenkins pipelines? Contact us!<\/p>\n<div class=\"row-more clearfix\"><a href=\"https:\/\/nl.devoteam.com\/en\/contact-en\/\" class=\"bt-more\" target=\"_blank\" rel=\"noopener noreferrer\">Contact us<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; How do you deal with variable files that contain private data such as AWS access key ID, AWS secret access key, database passwords, application credentials, and so on, when you are going to push them to a git repository? Even if this repository is private, it is still a risk to expose them to [&hellip;]<\/p>\n","protected":false},"featured_media":351771,"template":"","categories":[],"tags":[2430,2717],"industry":[],"class_list":["post-601878","expert-view","type-expert-view","status-publish","has-post-thumbnail","hentry","tag-business-platforms-en-nl","tag-netherlands-en-nl"],"acf":[],"cards":"\n\t<div class=\"single-post-card\">\n\n\t\t<figure class=\"wp-block-post-featured-image\"><a href=\"https:\/\/devoteam.info\/en-nl\/expert-view\/how-to-hide-your-secrets-in-a-git-repository-based-on-centos-7\/\" target=\"_self\" ><img width=\"1920\" height=\"500\" src=\"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/GIT-background.png\" class=\"attachment-post-thumbnail size-post-thumbnail wp-post-image\" alt=\"How to hide your secrets in a git repository &#8211; based on CentOS 7\" style=\"aspect-ratio:4\/3;width:100%;object-fit:cover;\" decoding=\"async\" loading=\"lazy\" srcset=\"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/GIT-background.png 1920w, https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/GIT-background-300x78.png 300w, https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/GIT-background-1024x267.png 1024w, https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/GIT-background-768x200.png 768w, https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/GIT-background-1536x400.png 1536w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/a><\/figure>\n\n\t\t\n\t\t<div class=\"wp-block-group is-vertical is-layout-flex wp-container-core-group-is-layout-43282307 wp-block-group-is-layout-flex\">\n\t<p style=\"font-style:normal;font-weight:700\" class=\"has-link-color wp-elements-1 wp-block-lp-post-type has-text-color has-primary-color has-small-font-size\">Expert View<\/p>\n\n\t\t\n\t\t<h3 style=\"font-style:normal;font-weight:400\" class=\"wp-block-post-title has-base-font-size\"><a href=\"https:\/\/devoteam.info\/en-nl\/expert-view\/how-to-hide-your-secrets-in-a-git-repository-based-on-centos-7\/\" target=\"_self\" >How to hide your secrets in a git repository &#8211; based on CentOS 7<\/a><\/h3><\/div>\n\t\t\n\t<\/div>\n\n","yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v28.4 (Yoast SEO v28.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to hide your secrets in a git repository - based on CentOS 7 | Devoteam<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/devoteam.info\/en-nl\/expert-view\/how-to-hide-your-secrets-in-a-git-repository-based-on-centos-7\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to hide your secrets in a git repository - based on CentOS 7\" \/>\n<meta property=\"og:description\" content=\"&nbsp; How do you deal with variable files that contain private data such as AWS access key ID, AWS secret access key, database passwords, application credentials, and so on, when you are going to push them to a git repository? Even if this repository is private, it is still a risk to expose them to [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/devoteam.info\/en-nl\/expert-view\/how-to-hide-your-secrets-in-a-git-repository-based-on-centos-7\/\" \/>\n<meta property=\"og:site_name\" content=\"Devoteam\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/expert-view\\\/how-to-hide-your-secrets-in-a-git-repository-based-on-centos-7\\\/\",\"url\":\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/expert-view\\\/how-to-hide-your-secrets-in-a-git-repository-based-on-centos-7\\\/\",\"name\":\"How to hide your secrets in a git repository - based on CentOS 7 | Devoteam\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/expert-view\\\/how-to-hide-your-secrets-in-a-git-repository-based-on-centos-7\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/expert-view\\\/how-to-hide-your-secrets-in-a-git-repository-based-on-centos-7\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/devoteam.info\\\/wp-content\\\/uploads\\\/2024\\\/12\\\/GIT-background.png\",\"datePublished\":\"2020-02-20T14:41:58+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/expert-view\\\/how-to-hide-your-secrets-in-a-git-repository-based-on-centos-7\\\/#breadcrumb\"},\"inLanguage\":\"en-NL\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/expert-view\\\/how-to-hide-your-secrets-in-a-git-repository-based-on-centos-7\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-NL\",\"@id\":\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/expert-view\\\/how-to-hide-your-secrets-in-a-git-repository-based-on-centos-7\\\/#primaryimage\",\"url\":\"https:\\\/\\\/devoteam.info\\\/wp-content\\\/uploads\\\/2024\\\/12\\\/GIT-background.png\",\"contentUrl\":\"https:\\\/\\\/devoteam.info\\\/wp-content\\\/uploads\\\/2024\\\/12\\\/GIT-background.png\",\"width\":1920,\"height\":500},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/expert-view\\\/how-to-hide-your-secrets-in-a-git-repository-based-on-centos-7\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Expert View\",\"item\":\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/expert-view\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to hide your secrets in a git repository &#8211; based on CentOS 7\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/#website\",\"url\":\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/\",\"name\":\"Devoteam\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/devoteam.info\\\/en-nl\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-NL\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to hide your secrets in a git repository - based on CentOS 7 | Devoteam","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:\/\/devoteam.info\/en-nl\/expert-view\/how-to-hide-your-secrets-in-a-git-repository-based-on-centos-7\/","og_locale":"en_US","og_type":"article","og_title":"How to hide your secrets in a git repository - based on CentOS 7","og_description":"&nbsp; How do you deal with variable files that contain private data such as AWS access key ID, AWS secret access key, database passwords, application credentials, and so on, when you are going to push them to a git repository? Even if this repository is private, it is still a risk to expose them to [&hellip;]","og_url":"https:\/\/devoteam.info\/en-nl\/expert-view\/how-to-hide-your-secrets-in-a-git-repository-based-on-centos-7\/","og_site_name":"Devoteam","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/devoteam.info\/en-nl\/expert-view\/how-to-hide-your-secrets-in-a-git-repository-based-on-centos-7\/","url":"https:\/\/devoteam.info\/en-nl\/expert-view\/how-to-hide-your-secrets-in-a-git-repository-based-on-centos-7\/","name":"How to hide your secrets in a git repository - based on CentOS 7 | Devoteam","isPartOf":{"@id":"https:\/\/devoteam.info\/en-nl\/#website"},"primaryImageOfPage":{"@id":"https:\/\/devoteam.info\/en-nl\/expert-view\/how-to-hide-your-secrets-in-a-git-repository-based-on-centos-7\/#primaryimage"},"image":{"@id":"https:\/\/devoteam.info\/en-nl\/expert-view\/how-to-hide-your-secrets-in-a-git-repository-based-on-centos-7\/#primaryimage"},"thumbnailUrl":"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/GIT-background.png","datePublished":"2020-02-20T14:41:58+00:00","breadcrumb":{"@id":"https:\/\/devoteam.info\/en-nl\/expert-view\/how-to-hide-your-secrets-in-a-git-repository-based-on-centos-7\/#breadcrumb"},"inLanguage":"en-NL","potentialAction":[{"@type":"ReadAction","target":["https:\/\/devoteam.info\/en-nl\/expert-view\/how-to-hide-your-secrets-in-a-git-repository-based-on-centos-7\/"]}]},{"@type":"ImageObject","inLanguage":"en-NL","@id":"https:\/\/devoteam.info\/en-nl\/expert-view\/how-to-hide-your-secrets-in-a-git-repository-based-on-centos-7\/#primaryimage","url":"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/GIT-background.png","contentUrl":"https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/GIT-background.png","width":1920,"height":500},{"@type":"BreadcrumbList","@id":"https:\/\/devoteam.info\/en-nl\/expert-view\/how-to-hide-your-secrets-in-a-git-repository-based-on-centos-7\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/devoteam.info\/en-nl\/"},{"@type":"ListItem","position":2,"name":"Expert View","item":"https:\/\/devoteam.info\/en-nl\/expert-view\/"},{"@type":"ListItem","position":3,"name":"How to hide your secrets in a git repository &#8211; based on CentOS 7"}]},{"@type":"WebSite","@id":"https:\/\/devoteam.info\/en-nl\/#website","url":"https:\/\/devoteam.info\/en-nl\/","name":"Devoteam","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/devoteam.info\/en-nl\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-NL"}]}},"uagb_featured_image_src":{"full":["https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/GIT-background.png",1920,500,false],"thumbnail":["https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/GIT-background-150x150.png",150,150,true],"medium":["https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/GIT-background-300x78.png",300,78,true],"medium_large":["https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/GIT-background-768x200.png",768,200,true],"large":["https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/GIT-background-1024x267.png",1024,267,true],"1536x1536":["https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/GIT-background-1536x400.png",1536,400,true],"2048x2048":["https:\/\/devoteam.info\/wp-content\/uploads\/2024\/12\/GIT-background.png",1920,500,false]},"uagb_author_info":{"display_name":"group.it.system","author_link":"https:\/\/devoteam.info\/en-nl\/author\/"},"uagb_comment_info":0,"uagb_excerpt":"&nbsp; How do you deal with variable files that contain private data such as AWS access key ID, AWS secret access key, database passwords, application credentials, and so on, when you are going to push them to a git repository? Even if this repository is private, it is still a risk to expose them to&hellip;","_links":{"self":[{"href":"https:\/\/devoteam.info\/en-nl\/wp-json\/wp\/v2\/expert-view\/601878","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devoteam.info\/en-nl\/wp-json\/wp\/v2\/expert-view"}],"about":[{"href":"https:\/\/devoteam.info\/en-nl\/wp-json\/wp\/v2\/types\/expert-view"}],"version-history":[{"count":0,"href":"https:\/\/devoteam.info\/en-nl\/wp-json\/wp\/v2\/expert-view\/601878\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devoteam.info\/en-nl\/wp-json\/wp\/v2\/media\/351771"}],"wp:attachment":[{"href":"https:\/\/devoteam.info\/en-nl\/wp-json\/wp\/v2\/media?parent=601878"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devoteam.info\/en-nl\/wp-json\/wp\/v2\/categories?post=601878"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devoteam.info\/en-nl\/wp-json\/wp\/v2\/tags?post=601878"},{"taxonomy":"industry","embeddable":true,"href":"https:\/\/devoteam.info\/en-nl\/wp-json\/wp\/v2\/industry?post=601878"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}