<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Tharun Shiv</title>
    <description>The latest articles on Forem by Tharun Shiv (@developertharun).</description>
    <link>https://forem.com/developertharun</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F378811%2Fdfe9c221-cff5-4e4d-9fcb-61fb3ca2bdd0.png</url>
      <title>Forem: Tharun Shiv</title>
      <link>https://forem.com/developertharun</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/developertharun"/>
    <language>en</language>
    <item>
      <title>What defines a good workplace/job? Here's what I think</title>
      <dc:creator>Tharun Shiv</dc:creator>
      <pubDate>Wed, 26 Jan 2022 11:25:19 +0000</pubDate>
      <link>https://forem.com/developertharun/what-defines-a-good-workplacejob-heres-what-i-think-1hep</link>
      <guid>https://forem.com/developertharun/what-defines-a-good-workplacejob-heres-what-i-think-1hep</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dFy2nbqk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tas3yhw63uh794e38472.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dFy2nbqk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tas3yhw63uh794e38472.jpg" alt="Image description" width="880" height="771"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here is what I think a good workplace is,&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Teammates are supportive, transparent, give the credits you deserve and don't steal them&lt;/li&gt;
&lt;li&gt;You are given opportunity to explore and learn&lt;/li&gt;
&lt;li&gt;You are not blamed time and again for the mistakes you made&lt;/li&gt;
&lt;li&gt;You are allowed to take part, however small or huge in any project of your team&lt;/li&gt;
&lt;li&gt;Your time &amp;amp; health are valued&lt;/li&gt;
&lt;li&gt;A good compensation &lt;/li&gt;
&lt;li&gt;Your opinions are valued if it deserves them&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;What do you think makes a good workplace?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tharun&lt;/li&gt;
&lt;/ul&gt;


&lt;div class="ltag__user ltag__user__id__378811"&gt;
    &lt;a href="/developertharun" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cdxCiXS_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--CuAC2zZW--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/378811/dfe9c221-cff5-4e4d-9fcb-61fb3ca2bdd0.png" alt="developertharun image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/developertharun"&gt;Tharun Shiv&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/developertharun"&gt;Site Reliability Engineer | Blogger | Podcasts | Youtube @ developertharun&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


</description>
      <category>discuss</category>
    </item>
    <item>
      <title>[Solved] gpgkeys: protocol `https' not supported</title>
      <dc:creator>Tharun Shiv</dc:creator>
      <pubDate>Wed, 26 Jan 2022 06:12:22 +0000</pubDate>
      <link>https://forem.com/developertharun/solved-gpgkeys-protocol-https-not-supported-gmo</link>
      <guid>https://forem.com/developertharun/solved-gpgkeys-protocol-https-not-supported-gmo</guid>
      <description>&lt;p&gt;Problem:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-key adv &lt;span class="nt"&gt;--fetch-keys&lt;/span&gt; &lt;span class="s1"&gt;'https://mariadb.org/mariadb_release_signing_key.asc'&lt;/span&gt;
Executing: /tmp/tmp.o2I4wt3O3r/gpg.1.sh &lt;span class="nt"&gt;--fetch-keys&lt;/span&gt;
https://mariadb.org/mariadb_release_signing_key.asc
gpgkeys: protocol &lt;span class="sb"&gt;`&lt;/span&gt;https&lt;span class="s1"&gt;' not supported
gpg: no handler for keyserver scheme `https'&lt;/span&gt;
gpg: WARNING: unable to fetch URI https://mariadb.org/mariadb_release_signing_key.asc: keyserver error
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Method 1: Install gnupg-curl&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;apt-get update
apt-get &lt;span class="nb"&gt;install &lt;/span&gt;gnupg-curl
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Method 2: If the above does not resolve the issue, then get the key using CURL and add it manually&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="s1"&gt;'https://mariadb.org/mariadb_release_signing_key.asc'&lt;/span&gt; | apt-key add -
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Method 3: If you trust the server, then use &lt;code&gt;-k&lt;/code&gt; option to skip CA cert verification&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-k&lt;/span&gt; &lt;span class="s1"&gt;'https://mariadb.org/mariadb_release_signing_key.asc'&lt;/span&gt; | apt-key add -
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The method 2 worked for me on Ubuntu Xenial.&lt;/p&gt;

&lt;p&gt;Comment if it helped you or if you are aware of a better solution.&lt;/p&gt;

&lt;p&gt;Thanks.&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>linux</category>
    </item>
    <item>
      <title>[Solved] E: Unable to correct problems, you have held broken packages.</title>
      <dc:creator>Tharun Shiv</dc:creator>
      <pubDate>Wed, 26 Jan 2022 06:07:28 +0000</pubDate>
      <link>https://forem.com/developertharun/solved-e-unable-to-correct-problems-you-have-held-broken-packages-3p5k</link>
      <guid>https://forem.com/developertharun/solved-e-unable-to-correct-problems-you-have-held-broken-packages-3p5k</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;apt-get &lt;span class="nb"&gt;install &lt;/span&gt;mariadb-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or &lt;span class="k"&gt;if &lt;/span&gt;you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may &lt;span class="nb"&gt;help &lt;/span&gt;to resolve the situation:

The following packages have unmet dependencies.
 mariadb-server : Depends: mariadb-server-10.5 &lt;span class="o"&gt;(&amp;gt;=&lt;/span&gt; 1:10.5.13+maria~focal&lt;span class="o"&gt;)&lt;/span&gt; but it is not going to be installed
N: Ignoring file &lt;span class="s1"&gt;'maria.key'&lt;/span&gt; &lt;span class="k"&gt;in &lt;/span&gt;directory &lt;span class="s1"&gt;'/etc/apt/sources.list.d/'&lt;/span&gt; as it has an invalid filename extension
N: Ignoring file &lt;span class="s1"&gt;'apt-key'&lt;/span&gt; &lt;span class="k"&gt;in &lt;/span&gt;directory &lt;span class="s1"&gt;'/etc/apt/sources.list.d/'&lt;/span&gt; as it has no filename extension
E: Unable to correct problems, you have held broken packages
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Install aptitude
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get &lt;span class="nb"&gt;install &lt;/span&gt;aptitude
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Use aptitude to install packages
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;aptitude &lt;span class="nb"&gt;install &lt;/span&gt;mariadb-server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use the Yes or No options to find the right combinations of the packages and set them up.&lt;/p&gt;

&lt;p&gt;Comment if you know any other efficient solutions.&lt;br&gt;
thanks.&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>linux</category>
    </item>
    <item>
      <title>Here's a secret to get a promotion at work even with WFH</title>
      <dc:creator>Tharun Shiv</dc:creator>
      <pubDate>Fri, 21 Jan 2022 17:04:47 +0000</pubDate>
      <link>https://forem.com/developertharun/heres-a-secret-to-get-a-promotion-at-work-even-with-wfh-1pac</link>
      <guid>https://forem.com/developertharun/heres-a-secret-to-get-a-promotion-at-work-even-with-wfh-1pac</guid>
      <description>&lt;p&gt;Let us look at 8 ways in which you can become a better engineer at work. Engineering not just involves various technologies to deal with and keep them running, but also several non-technical characteristics. &lt;/p&gt;

&lt;h2&gt;
  
  
  1. Working as an Engineer is all about the right Mindset
&lt;/h2&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a. No blame game

b. Thirst to solve
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;As an engineer we deal with multiple components and are a bridge between the users and the application. Even though the application is well written, a bigger responsibility falls upon Engineers to keep the applications and the services it uses up and running. In this process, there might be a few situations where one of the Engineers does a mistake that causes a disruption or even an outage. When this happens, the first thing to happen shouldn't be to blame anyone for the outage, but the following has to be performed. &lt;/p&gt;

&lt;p&gt;i. Fix the issue&lt;/p&gt;

&lt;p&gt;ii. Write an RCA ( Root Cause Analysis ) that mentions why the issue occurred in the first place, the names can be anonymous.&lt;/p&gt;

&lt;p&gt;iii. Mention the first aid and the fix for the issue&lt;/p&gt;

&lt;p&gt;iv. Discuss how the issue can be prevented the next time &lt;/p&gt;

&lt;p&gt;v. Set an ETA for the fix&lt;/p&gt;

&lt;p&gt;Another aspect is to have the right mindset to solve problems. As an Engineer you have the responsibility to optimize the infrastructure, fix issues, build automation tools, monitoring tools, and more, which requires a lot of problem-solving skills. Unless you have the thirst to solve the problems, you will only feel more stressed out, or even worse, would cause issues.&lt;/p&gt;
&lt;h2&gt;
  
  
  2. Communication
&lt;/h2&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a. Overcommunication is not a problem

b. Be kind and show empathy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Are you performing a production activity or even a stage change that could affect other teams? Have you made progress in the project that you are working on? Make sure to keep the necessary stakeholders in sync always. Write emails, send slack messages well in advance before the production activity, just before and after the activity. It might sound like over-communication, but trust me, as the company scales, you need to keep everyone relevant to the component that you are working on in sync. This way, if they have to take any actions from their side, they will do it, or if they face any issues post-activity they'll know who the right person to get in touch with is.&lt;/p&gt;

&lt;p&gt;One other important characteristic to have as a human being is to be kind and show empathy. This will apply to all levels of engineering on either side of the conversation, period. Whether someone asks a silly question, or does a mistake, or behaves rudely with you, you should never mirror that behavior.&lt;/p&gt;
&lt;h2&gt;
  
  
  3. Stay synced with the team
&lt;/h2&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a. Do not miss team meetings

b. Prevent duplication of work

c. Do not compete, but contribute
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;In this work from home ( WFH ) period, the only time where you have an opportunity to speak to your teammates is during a team meet. The reason why this is special is, you get an opportunity to stay synced with your team on what they all are working on, whether they are blocked on any tasks, how you can contribute to their tasks and also you will be using this opportunity to convey on what you are working on and get help if necessary. This also prevents duplication of work.  &lt;/p&gt;
&lt;h2&gt;
  
  
  4. Shadow teammates on tasks and issues
&lt;/h2&gt;

&lt;p&gt;The best way to learn is by doing it hands-on and the best way to begin would be by watching how it is done. I also believe that the best way to retain the learned information is by performing it repeatedly. This also includes watching your teammates perform the activities. It ensures that the activity is done without any mistakes when there are several eyes to watch it.&lt;/p&gt;
&lt;h2&gt;
  
  
  5. No Spoon-feeding, do homework
&lt;/h2&gt;

&lt;p&gt;Do not expect all details to be taught by your teammates and seniors. Read the documentation, watch tutorials, read engineering blogs, practice on your own, and suggest improvisations. Even a well-built system will have much more efficient solutions, that you can propose. &lt;/p&gt;
&lt;h2&gt;
  
  
  6. Be attentive and cautious on production
&lt;/h2&gt;

&lt;p&gt;I've heard people pretending to work while watching web series. They might be proud of their multitasking skills, but as far as I know, there is no such thing as multitasking at work while watching a web series and I highly recommend one to not do that. If you are interested in watching a series, I would suggest you use that motivation to focus on the work, finish the tasks quickly and reward yourself with a couple of episodes later in the evening.&lt;/p&gt;

&lt;p&gt;Attention is the core necessity of life, and the same holds true to an Engineer. Be attentive to the commands you run, the alerts you get, the trend the charts show, and the logs of the services and applications. Prepare for activities well in advance and let the actual activities be a no-brainer copy-paste so that you can pay attention to other indications during the activity.&lt;/p&gt;
&lt;h2&gt;
  
  
  7. Think before you hit enter
&lt;/h2&gt;

&lt;p&gt;Do not underestimate sudo privilege. A lot of us have a habit to enter into the sudo mode as soon as we login into a machine, which is unnecessary. Even if the command you are running looks like a harmless command, make sure to get the process and commands reviewed by your teammates, seniors, or the subject experts, this will save you from outages.&lt;/p&gt;
&lt;h2&gt;
  
  
  8. Keep version control systems in sync
&lt;/h2&gt;

&lt;p&gt;Whether it is NGINX config or any service config, make sure to keep the version control system that is isolated from the system in sync. No one hopes for the machine to become unresponsive, but when the machine becomes unusable all of a sudden, you have another opportunity to bring up alternate machines with the same configs as the previous ones. Keeping the version control system in sync also helps in automation.&lt;/p&gt;

&lt;p&gt;This article was initially written for an SRE, but the more I read it, the more I felt that this is not just for an SRE but for any Engineer.&lt;/p&gt;

&lt;p&gt;Check out my YouTube Channel here: &lt;a href="https://www.youtube.com/c/developerTharun" rel="noopener noreferrer"&gt;Developer Tharun - YouTube&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Thank you for reading the article.&lt;/p&gt;

&lt;p&gt;Written by,&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__user ltag__user__id__378811"&gt;
    &lt;a href="/developertharun" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&gt;
        &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F378811%2Fdfe9c221-cff5-4e4d-9fcb-61fb3ca2bdd0.png" alt="developertharun image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/developertharun"&gt;Tharun Shiv&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/developertharun"&gt;Site Reliability Engineer | Blogger | Podcasts | Youtube @ developertharun&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;



&lt;h1&gt;
  
  
  Thank you for reading, This is Tharun Shiv a.k.a Developer Tharun
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxtxq6bdms36fmn62450h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxtxq6bdms36fmn62450h.png" alt="Tharun Shiv"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>productivity</category>
      <category>career</category>
      <category>discuss</category>
    </item>
    <item>
      <title>MySQL MariaDB setup on Linux Ubuntu with SSL/TLS - 2022 - Video</title>
      <dc:creator>Tharun Shiv</dc:creator>
      <pubDate>Thu, 20 Jan 2022 15:46:14 +0000</pubDate>
      <link>https://forem.com/developertharun/mysql-mariadb-setup-on-linux-ubuntu-with-ssltls-2022-video-238f</link>
      <guid>https://forem.com/developertharun/mysql-mariadb-setup-on-linux-ubuntu-with-ssltls-2022-video-238f</guid>
      <description>&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/rLgzGf28_ts"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>mysql</category>
      <category>database</category>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
    <item>
      <title>18 ways to ATTACK a Vault server | Production hardening | Tharun</title>
      <dc:creator>Tharun Shiv</dc:creator>
      <pubDate>Sun, 16 Jan 2022 06:25:25 +0000</pubDate>
      <link>https://forem.com/developertharun/18-ways-to-attack-a-vault-server-production-hardening-tharun-2a1f</link>
      <guid>https://forem.com/developertharun/18-ways-to-attack-a-vault-server-production-hardening-tharun-2a1f</guid>
      <description>&lt;h2&gt;
  
  
  YouTube video
&lt;/h2&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/3ikQlRQAso4"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Podcast:
&lt;/h2&gt;

&lt;p&gt;&lt;iframe src="https://open.spotify.com/embed/episode/6FyVgWpLYYmehmA6KzVJM7" width="100%" height="232px"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Episode
&lt;/h2&gt;

&lt;p&gt;In this episode we will look at 18 ways in which your Hashicorp Vault server or any Linux server in general can be attacked. We will also discuss on how to prevent those and secure your server. This process is also known as production hardening. &lt;/p&gt;

&lt;p&gt;Written by,&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__user ltag__user__id__378811"&gt;
    &lt;a href="/developertharun" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&gt;
        &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F378811%2Fdfe9c221-cff5-4e4d-9fcb-61fb3ca2bdd0.png" alt="developertharun image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/developertharun"&gt;Tharun Shiv&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/developertharun"&gt;Site Reliability Engineer | Blogger | Podcasts | Youtube @ developertharun&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;h1&gt;
  
  
  Thank you for reading, This is Tharun Shiv a.k.a Developer Tharun
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxtxq6bdms36fmn62450h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxtxq6bdms36fmn62450h.png" alt="Tharun Shiv"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>systems</category>
      <category>security</category>
      <category>tutorial</category>
      <category>linux</category>
    </item>
    <item>
      <title>System Architecture of WhatsApp end to end encryption of backup [2022]</title>
      <dc:creator>Tharun Shiv</dc:creator>
      <pubDate>Sun, 16 Jan 2022 06:20:25 +0000</pubDate>
      <link>https://forem.com/developertharun/system-architecture-of-whatsapp-end-to-end-encryption-of-backup-2022-3ej8</link>
      <guid>https://forem.com/developertharun/system-architecture-of-whatsapp-end-to-end-encryption-of-backup-2022-3ej8</guid>
      <description>&lt;h2&gt;
  
  
  YouTube
&lt;/h2&gt;

&lt;p&gt;Part 1:&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/If-BWZRSbVw"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Part 2: &lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/2ddhlZITbB0"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Podcast:
&lt;/h2&gt;

&lt;p&gt;Part 1:&lt;/p&gt;

&lt;p&gt;&lt;iframe src="https://open.spotify.com/embed/episode/05JTTny6u8WNmeCxGdwPXO" width="100%" height="232px"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Part 2: &lt;/p&gt;

&lt;p&gt;&lt;iframe src="https://open.spotify.com/embed/episode/3louceG9Ktu8VNDOAxzKyF" width="100%" height="232px"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Episode
&lt;/h2&gt;

&lt;p&gt;In the above episodes we look at how WhatsApp encrypts the backups end to end. There are two flows involved here, one is based on password and the other without. We will look at the whitepaper of WhatsApp where they have mentioned about the entire process in detail. &lt;/p&gt;

&lt;p&gt;Written by,&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__user ltag__user__id__378811"&gt;
    &lt;a href="/developertharun" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cdxCiXS_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://res.cloudinary.com/practicaldev/image/fetch/s--CuAC2zZW--/c_fill%2Cf_auto%2Cfl_progressive%2Ch_150%2Cq_auto%2Cw_150/https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/378811/dfe9c221-cff5-4e4d-9fcb-61fb3ca2bdd0.png" alt="developertharun image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/developertharun"&gt;Tharun Shiv&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/developertharun"&gt;Site Reliability Engineer | Blogger | Podcasts | Youtube @ developertharun&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;h1&gt;
  
  
  Thank you for reading, This is Tharun Shiv a.k.a Developer Tharun
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4DVZ_PES--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xtxq6bdms36fmn62450h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4DVZ_PES--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xtxq6bdms36fmn62450h.png" alt="Tharun Shiv" width="500" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>systems</category>
      <category>security</category>
      <category>architecture</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Setup Vault in HA with MySQL backend in 10 minutes | Hashicorp | Tutorial | Tharun</title>
      <dc:creator>Tharun Shiv</dc:creator>
      <pubDate>Sun, 16 Jan 2022 05:35:10 +0000</pubDate>
      <link>https://forem.com/developertharun/setup-vault-in-ha-with-mysql-backend-in-10-minutes-hashicorp-tutorial-tharun-559h</link>
      <guid>https://forem.com/developertharun/setup-vault-in-ha-with-mysql-backend-in-10-minutes-hashicorp-tutorial-tharun-559h</guid>
      <description>&lt;h2&gt;
  
  
  How to set up Vault in High Availability ( HA mode ) with MySQL as storage backend
&lt;/h2&gt;

&lt;p&gt;In this tutorial we will look at how we can use MySQL as a backend to Vault. This setup will involve end to end TLS. We have already seen how to setup Vault with TLS frontend. We also saw how we can setup MySQL with TLS frontend. In this tutorial, we will look at how we can use TLS Enabled MySQL as a storage backend to Vault. This is a complete secure production setup.&lt;/p&gt;

&lt;p&gt;Tutorial on how to setup Vault Dev &amp;amp; Production mode:&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/developertharun" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F378811%2Fdfe9c221-cff5-4e4d-9fcb-61fb3ca2bdd0.png" alt="developertharun"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/developertharun/hashicorp-vault-dev-and-prod-server-setup-unseal-policies-tls-setup-48mo" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Hashicorp Vault | Dev and Prod server setup | Unseal | Policies | TLS setup | Tharun&lt;/h2&gt;
      &lt;h3&gt;Tharun Shiv ・ Jan 2 '22&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#security&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#database&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#beginners&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#devops&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;Tutorial on how to setup TLS/SSL enabled MySQL/MariaDB:&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/developertharun" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F378811%2Fdfe9c221-cff5-4e4d-9fcb-61fb3ca2bdd0.png" alt="developertharun"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/developertharun/easiest-way-to-setup-mysqlmariadb-with-tlsssl-in-10-minutes-v105-any-os-ubuntu-focal-developer-tharun-4okc" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Easiest way to setup MySQL/MariaDB with TLS/SSL in 10 minutes- v10.5 - Any OS - Ubuntu Focal | Developer Tharun&lt;/h2&gt;
      &lt;h3&gt;Tharun Shiv ・ Jan 15 '22&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#mysql&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#beginners&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#tutorial&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#database&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  Create Vault user in MySQL
&lt;/h2&gt;

&lt;p&gt;The Vault service needs credentials to login into MySQL server in order to store data and metadata in a backend. We will create this user in MySQL now.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mysql &lt;span class="nt"&gt;-uroot&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; &lt;span class="nt"&gt;--ssl-ca&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/etc/mysql/certs/ca.pem
&amp;lt;Enter password&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="o"&gt;#&lt;/span&gt; &lt;span class="k"&gt;create&lt;/span&gt; &lt;span class="k"&gt;user&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;USER&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;vault-mysql-username&amp;gt;'&lt;/span&gt;&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="s1"&gt;'%'&lt;/span&gt; &lt;span class="n"&gt;IDENTIFIED&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;vault-mysql-password&amp;gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="o"&gt;#&lt;/span&gt; &lt;span class="k"&gt;grant&lt;/span&gt; &lt;span class="k"&gt;privileges&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;ALL&lt;/span&gt; &lt;span class="k"&gt;PRIVILEGES&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;vault&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="s1"&gt;'&amp;lt;vault-mysql-username&amp;gt;'&lt;/span&gt;&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="s1"&gt;'%'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  MySQL Bind Address
&lt;/h2&gt;

&lt;p&gt;When setting up Vault, I came across difficulties bringing up the Vault server. I have listed the challenges and solution at the end of this post. One point I would like to address is the MySQL Bind address. This configuration of MySQL defines to which network interface the MySQL process binds to / listens on. The other clients such as Vault will be able to access MySQL by sending requests to this particular interface only.&lt;/p&gt;

&lt;p&gt;We have seen where to set this in the below tutorial&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/developertharun" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F378811%2Fdfe9c221-cff5-4e4d-9fcb-61fb3ca2bdd0.png" alt="developertharun"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/developertharun/easiest-way-to-setup-mysqlmariadb-with-tlsssl-in-10-minutes-v105-any-os-ubuntu-focal-developer-tharun-4okc" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Easiest way to setup MySQL/MariaDB with TLS/SSL in 10 minutes- v10.5 - Any OS - Ubuntu Focal | Developer Tharun&lt;/h2&gt;
      &lt;h3&gt;Tharun Shiv ・ Jan 15 '22&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#mysql&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#beginners&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#tutorial&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#database&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;



&lt;h2&gt;
  
  
  MySQL CA Pem file
&lt;/h2&gt;

&lt;p&gt;Vault server needs the CA.pem of the MySQL server that we used in the MySQL TLS setup tutorial. Copy that to a  directory that vault can access&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cp&lt;/span&gt; ~/certs/ca.pem /opt/vault/tls/mysql-ca.pem

&lt;span class="nb"&gt;chown&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; vault: /opt/vault/tls
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Vault config
&lt;/h2&gt;

&lt;p&gt;In the above tutorials we have setup Vault, now let us configure it to use MySQL Backend. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;/etc/vault.d/vault.hcl&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="s"&gt;ui = &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="c1"&gt;## or false&lt;/span&gt;

&lt;span class="c1"&gt;# MySQL backend config&lt;/span&gt;
&lt;span class="s"&gt;storage "mysql" {&lt;/span&gt;
  &lt;span class="s"&gt;ha_enabled = "true"&lt;/span&gt;
  &lt;span class="s"&gt;address = "&amp;lt;mySQL-hostname&amp;gt;:3306"&lt;/span&gt;
  &lt;span class="s"&gt;username = "&amp;lt;vault-mysql-username&amp;gt;"&lt;/span&gt;
  &lt;span class="s"&gt;password = "&amp;lt;vault-mysql-password&amp;gt;"&lt;/span&gt;
  &lt;span class="s"&gt;database = "&amp;lt;vault-mysql-database&amp;gt;"&lt;/span&gt;
  &lt;span class="s"&gt;#plaintext_connection_allowed = "true"&lt;/span&gt; &lt;span class="c1"&gt;#non-TLS mysql&lt;/span&gt;
  &lt;span class="c1"&gt;#path to CA.pem to verify MySQL SSL&lt;/span&gt;
  &lt;span class="s"&gt;tls_ca_file = "&amp;lt;path-to-mysql-ca-pem&amp;gt;"&lt;/span&gt; 
&lt;span class="err"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;# Vault server listen configuration&lt;/span&gt;
&lt;span class="s"&gt;listener "tcp" {&lt;/span&gt;
  &lt;span class="s"&gt;address       = "&amp;lt;vault-hostname/IP&amp;gt;:8200"&lt;/span&gt;
  &lt;span class="s"&gt;tls_cert_file = "&amp;lt;path-to-vault-tls-cert&amp;gt;"&lt;/span&gt;
  &lt;span class="s"&gt;tls_key_file  = "&amp;lt;path-to-vault-tls-key&amp;gt;"&lt;/span&gt;
&lt;span class="err"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;# the address to advertise for HA purpose&lt;/span&gt;
&lt;span class="s"&gt;api_addr="https://&amp;lt;vault-hostname&amp;gt;:8200"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Restart Vault
&lt;/h2&gt;

&lt;p&gt;Now we can go ahead export the Vault variables and restart the vault server&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;VAULT_ADDR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"https://&amp;lt;vault-server&amp;gt;:8200"&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;VAULT_CACERT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;path-to-vault-tls-cert&amp;gt;"&lt;/span&gt;

&lt;span class="c"&gt;# make sure MySQL is running and listening&lt;/span&gt;

&lt;span class="c"&gt;# now restart / start Vault&lt;/span&gt;
service vault start 

&lt;span class="c"&gt;# or&lt;/span&gt;
service vault restart

&lt;span class="c"&gt;# check Vault server logs&lt;/span&gt;
journalctl &lt;span class="nt"&gt;-u&lt;/span&gt; vault.service 

&lt;span class="c"&gt;# check Vault status&lt;/span&gt;
vault status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We have successfully setup Vault with TLS frontend, TLS MySQL backend, thereby securing Vault end to end making it a perfect Production setup.&lt;/p&gt;

&lt;p&gt;Although there are 18 ways in which a Hashicorp Vault server can be attacked, and I have covered it in the below Video&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/3ikQlRQAso4"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h1&gt;
  
  
  Thank you for reading, This is Tharun Shiv a.k.a Developer Tharun
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxtxq6bdms36fmn62450h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxtxq6bdms36fmn62450h.png" alt="Tharun Shiv"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can find more articles here: &lt;a href="https://dev.to/developertharun"&gt;https://dev.to/developertharun&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Roadrunners is a series that is aimed at delivering concepts as precisely as possible. Here, a roadrunner is referred to as a person who does things super fast &amp;amp; efficiently. Are you a roadrunner?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Thank you&lt;/p&gt;

</description>
      <category>devops</category>
      <category>security</category>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Easiest way to setup MySQL/MariaDB with TLS/SSL in 10 minutes- v10.5 - Any OS - Ubuntu Focal | Developer Tharun</title>
      <dc:creator>Tharun Shiv</dc:creator>
      <pubDate>Sat, 15 Jan 2022 16:58:40 +0000</pubDate>
      <link>https://forem.com/developertharun/easiest-way-to-setup-mysqlmariadb-with-tlsssl-in-10-minutes-v105-any-os-ubuntu-focal-developer-tharun-4okc</link>
      <guid>https://forem.com/developertharun/easiest-way-to-setup-mysqlmariadb-with-tlsssl-in-10-minutes-v105-any-os-ubuntu-focal-developer-tharun-4okc</guid>
      <description>&lt;h2&gt;
  
  
  MySQL/MariaDB setup
&lt;/h2&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/rLgzGf28_ts"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;In this tutorial we will look at how to setup MariaDB/MySQL including SSL/TLS. This will enable the clients connecting with the MySQL server. We will add repository, install mariadb-server, generate certs, place them in the right folder, edit the configurations and test it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Link to fetch the respective repository&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://mariadb.org/download/?t=repo-config" rel="noopener noreferrer"&gt;Link to the MariaDB Downloads page&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;On the above page:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Choose a distribution&lt;/li&gt;
&lt;li&gt;Choose a MariaDB Server version&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Once you do this, you will be able to view the commands to install MariaDB Server on your system of any operating system ( OS ). In this tutorial I have chosen Ubuntu Focal ( 20.04 ) and a MariaDB Server version of 10.5&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Add Apt Repositories&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get &lt;span class="nb"&gt;install &lt;/span&gt;software-properties-common dirmngr apt-transport-https
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-key adv &lt;span class="nt"&gt;--fetch-keys&lt;/span&gt; &lt;span class="s1"&gt;'https://mariadb.org/mariadb_release_signing_key.asc'&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;add-apt-repository &lt;span class="s1"&gt;'deb [arch=amd64,arm64,ppc64el,s390x] https://mirrors.aliyun.com/mariadb/repo/10.5/ubuntu focal main'&lt;/span&gt;

&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Install MariaDB server&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;mariadb-server-10.5


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Setup root user&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

service mysql status

mysql_secure_installation &lt;span class="c"&gt;# walk through the process with default options along with the new password when prompted&lt;/span&gt;

root@ubuntu-focal:/etc/mysql# mysql_secure_installation 

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we&lt;span class="s1"&gt;'ll need the current
password for the root user. If you'&lt;/span&gt;ve just installed MariaDB, and
haven&lt;span class="s1"&gt;'t set the root password yet, you should just press enter here.

Enter current password for root (enter for none): 
OK, successfully used password, moving on...

Setting the root password or using the unix_socket ensures that nobody
can log into the MariaDB root user without the proper authorisation.

Switch to unix_socket authentication [Y/n] Y
Enabled successfully!
Reloading privilege tables..
 ... Success!

Change the root password? [Y/n] Y
New password: &amp;lt;enter-new-password-here&amp;gt;
Re-enter new password: &amp;lt;enter-new-password-here&amp;gt;
Password updated successfully!
Reloading privilege tables..
 ... Success!

By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] Y
 ... Success!

Normally, root should only be allowed to connect from '&lt;/span&gt;localhost&lt;span class="s1"&gt;'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] Y
 ... Success!

By default, MariaDB comes with a database named '&lt;/span&gt;&lt;span class="nb"&gt;test&lt;/span&gt;&lt;span class="s1"&gt;' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] Y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] Y
 ... Success!

Cleaning up...

All done!  If you'&lt;/span&gt;ve completed all of the above steps, your MariaDB
installation should now be secure.

Thanks &lt;span class="k"&gt;for &lt;/span&gt;using MariaDB!


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Login into MySQL&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

mysql &lt;span class="nt"&gt;-uroot&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt;
Enter password: &amp;lt;enter-new-password-here&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;

&lt;span class="n"&gt;Welcome&lt;/span&gt; &lt;span class="k"&gt;to&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;MariaDB&lt;/span&gt; &lt;span class="n"&gt;monitor&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;  &lt;span class="n"&gt;Commands&lt;/span&gt; &lt;span class="k"&gt;end&lt;/span&gt; &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;or&lt;/span&gt; &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="k"&gt;g&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;span class="n"&gt;Your&lt;/span&gt; &lt;span class="n"&gt;MariaDB&lt;/span&gt; &lt;span class="k"&gt;connection&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="mi"&gt;47&lt;/span&gt;
&lt;span class="n"&gt;Server&lt;/span&gt; &lt;span class="k"&gt;version&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;13&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;MariaDB&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;13&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;maria&lt;/span&gt;&lt;span class="o"&gt;~&lt;/span&gt;&lt;span class="n"&gt;focal&lt;/span&gt; &lt;span class="n"&gt;mariadb&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;org&lt;/span&gt; &lt;span class="nb"&gt;binary&lt;/span&gt; &lt;span class="n"&gt;distribution&lt;/span&gt;

&lt;span class="n"&gt;Copyright&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;c&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="mi"&gt;2000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2018&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Oracle&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MariaDB&lt;/span&gt; &lt;span class="n"&gt;Corporation&lt;/span&gt; &lt;span class="n"&gt;Ab&lt;/span&gt; &lt;span class="k"&gt;and&lt;/span&gt; &lt;span class="n"&gt;others&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;

&lt;span class="k"&gt;Type&lt;/span&gt; &lt;span class="s1"&gt;'help;'&lt;/span&gt; &lt;span class="k"&gt;or&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="se"&gt;\h&lt;/span&gt;&lt;span class="s1"&gt;'&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;help&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt; &lt;span class="k"&gt;Type&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="se"&gt;\c&lt;/span&gt;&lt;span class="s1"&gt;'&lt;/span&gt; &lt;span class="k"&gt;to&lt;/span&gt; &lt;span class="n"&gt;clear&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="k"&gt;current&lt;/span&gt; &lt;span class="k"&gt;input&lt;/span&gt; &lt;span class="k"&gt;statement&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;

&lt;span class="n"&gt;MariaDB&lt;/span&gt; &lt;span class="p"&gt;[(&lt;/span&gt;&lt;span class="k"&gt;none&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;select&lt;/span&gt; &lt;span class="k"&gt;user&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="k"&gt;host&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;mysql&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;user&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="c1"&gt;-------------+-----------+&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="k"&gt;User&lt;/span&gt;        &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="k"&gt;Host&lt;/span&gt;      &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="c1"&gt;-------------+-----------+&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;root&lt;/span&gt;        &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;127&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;root&lt;/span&gt;        &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;       &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;mariadb&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sys&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;localhost&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;root&lt;/span&gt;        &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;localhost&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="c1"&gt;-------------+-----------+&lt;/span&gt;
&lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="k"&gt;rows&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;004&lt;/span&gt; &lt;span class="n"&gt;sec&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;MariaDB&lt;/span&gt; &lt;span class="p"&gt;[(&lt;/span&gt;&lt;span class="k"&gt;none&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;USER&lt;/span&gt; &lt;span class="s1"&gt;'vault'&lt;/span&gt;&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="s1"&gt;'192.%'&lt;/span&gt; &lt;span class="n"&gt;IDENTIFIED&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="s1"&gt;'2%r3o0u8jf@e8owh*hfeu^8f0'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;Query&lt;/span&gt; &lt;span class="n"&gt;OK&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="k"&gt;rows&lt;/span&gt; &lt;span class="n"&gt;affected&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;001&lt;/span&gt; &lt;span class="n"&gt;sec&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;MariaDB&lt;/span&gt; &lt;span class="p"&gt;[(&lt;/span&gt;&lt;span class="k"&gt;none&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;ALL&lt;/span&gt; &lt;span class="k"&gt;PRIVILEGES&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;vault&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="s1"&gt;'vault'&lt;/span&gt;&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="s1"&gt;'%'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;Query&lt;/span&gt; &lt;span class="n"&gt;OK&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="k"&gt;rows&lt;/span&gt; &lt;span class="n"&gt;affected&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;002&lt;/span&gt; &lt;span class="n"&gt;sec&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;MariaDB&lt;/span&gt; &lt;span class="p"&gt;[(&lt;/span&gt;&lt;span class="k"&gt;none&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;select&lt;/span&gt; &lt;span class="k"&gt;user&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="k"&gt;host&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;mysql&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;user&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;----------+-----------+&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="k"&gt;User&lt;/span&gt;        &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="k"&gt;Host&lt;/span&gt;      &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="c1"&gt;-------------+-----------+&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;vault&lt;/span&gt;       &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt;         &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;root&lt;/span&gt;        &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;127&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;root&lt;/span&gt;        &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;       &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;mariadb&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sys&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;localhost&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;root&lt;/span&gt;        &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;localhost&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="c1"&gt;-------------+-----------+&lt;/span&gt;
&lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="k"&gt;rows&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;004&lt;/span&gt; &lt;span class="n"&gt;sec&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  TLS Setup of MariaDB
&lt;/h2&gt;

&lt;p&gt;We have setup MySQL/MariaDB above without TLS. For most of the setups the above would be sufficient. To take it to the next level, we will add TLS ability here such that the data transferred between the client and MySQL is encrypted and secure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Generation of certificates&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There are several ways to generate certificates. If you are at an organization, it probably has a standard way to generate a CA. You are free to go ahead and get the CA Cert, Server Cert and Server Key using that way. If not, follow the below steps. No Pre-requisites required.&lt;/p&gt;

&lt;p&gt;Generate CA ( Certificate Authority ) Key and Certificates&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="nb"&gt;mkdir&lt;/span&gt; ~/certs
&lt;span class="nb"&gt;cd&lt;/span&gt; ~/certs

&lt;span class="c"&gt;# generate CA Key with 4096 bits&lt;/span&gt;
openssl genrsa &lt;span class="nt"&gt;-des3&lt;/span&gt; &lt;span class="nt"&gt;-out&lt;/span&gt; ca.key 4096

&lt;span class="c"&gt;# generate CA pem from the ca.key&lt;/span&gt;
openssl req &lt;span class="nt"&gt;-x509&lt;/span&gt; &lt;span class="nt"&gt;-new&lt;/span&gt; &lt;span class="nt"&gt;-nodes&lt;/span&gt; &lt;span class="nt"&gt;-key&lt;/span&gt; ca.key &lt;span class="nt"&gt;-sha256&lt;/span&gt; &lt;span class="nt"&gt;-days&lt;/span&gt; 900 &lt;span class="nt"&gt;-out&lt;/span&gt; ca.pem


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;How to make the operating system trust this self signed cert?&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; ca-certificates

&lt;span class="c"&gt;#Convert the ca.pem certificate to a ca.crt certificate file.&lt;/span&gt;
openssl x509 &lt;span class="nt"&gt;-outform&lt;/span&gt; der &lt;span class="nt"&gt;-in&lt;/span&gt; ./ca.pem &lt;span class="nt"&gt;-out&lt;/span&gt; ./ca.crt

&lt;span class="c"&gt;#Copy the ca.crt file to the /usr/local/share/ca-certificates directory.&lt;/span&gt;
&lt;span class="nb"&gt;sudo cp&lt;/span&gt; ./ca.crt /usr/local/share/ca-certificates

&lt;span class="c"&gt;#Update the certificate store.&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;update-ca-certificates


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Generation of Server key and Server cert&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We will generate server key and use it to generate a CSR ( Certificate Signing Request ). We will take this to the Certificate Authority and get it signed by the CA. Thus we will get the server cert. In this process we will also use the server extensions.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="c"&gt;# Generate the server.key&lt;/span&gt;
openssl genrsa &lt;span class="nt"&gt;-out&lt;/span&gt; server.key 2048

&lt;span class="c"&gt;# Generate the CSR and answer the questions&lt;/span&gt;
openssl req &lt;span class="nt"&gt;-new&lt;/span&gt; &lt;span class="nt"&gt;-key&lt;/span&gt; server.key &lt;span class="nt"&gt;-out&lt;/span&gt; server.csr
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter &lt;span class="s1"&gt;'.'&lt;/span&gt;, the field will be left blank.
&lt;span class="nt"&gt;-----&lt;/span&gt;
Country Name &lt;span class="o"&gt;(&lt;/span&gt;2 letter code&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;AU]:IN
State or Province Name &lt;span class="o"&gt;(&lt;/span&gt;full name&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;Some-State]:KA
Locality Name &lt;span class="o"&gt;(&lt;/span&gt;eg, city&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;[]&lt;/span&gt;:Blr
Organization Name &lt;span class="o"&gt;(&lt;/span&gt;eg, company&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;Internet Widgits Pty Ltd]:Developer Tharun
Organizational Unit Name &lt;span class="o"&gt;(&lt;/span&gt;eg, section&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;[]&lt;/span&gt;:Blog  
Common Name &lt;span class="o"&gt;(&lt;/span&gt;e.g. server FQDN or YOUR name&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;[]&lt;/span&gt;:server-fqdn.server.environment
Email Address &lt;span class="o"&gt;[]&lt;/span&gt;:sre@org.com

Please enter the following &lt;span class="s1"&gt;'extra'&lt;/span&gt; attributes
to be sent with your certificate request
A challenge password &lt;span class="o"&gt;[]&lt;/span&gt;: &amp;lt;not mandatory, can be skipped, hit enter&amp;gt;
An optional company name &lt;span class="o"&gt;[]&lt;/span&gt;: &amp;lt;not mandatory, can be skipped, hit enter&amp;gt;

&lt;span class="c"&gt;# Add the below to a file&lt;/span&gt;
&lt;span class="c"&gt;# server.ext&lt;/span&gt;
&lt;span class="nv"&gt;authorityKeyIdentifier&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;keyid,issuer
&lt;span class="nv"&gt;basicConstraints&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;CA:FALSE
keyUsage &lt;span class="o"&gt;=&lt;/span&gt; digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
subjectAltName &lt;span class="o"&gt;=&lt;/span&gt; @alt_names
&lt;span class="o"&gt;[&lt;/span&gt;alt_names]
DNS.1 &lt;span class="o"&gt;=&lt;/span&gt; &amp;lt;mention the server FQDN&amp;gt;

&lt;span class="c"&gt;# Create the cert using the Certificate Authority cert and key&lt;/span&gt;
openssl x509 &lt;span class="nt"&gt;-req&lt;/span&gt; &lt;span class="nt"&gt;-in&lt;/span&gt; server.csr &lt;span class="nt"&gt;-CA&lt;/span&gt; ca.pem &lt;span class="nt"&gt;-CAkey&lt;/span&gt; ca.key &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nt"&gt;-CAcreateserial&lt;/span&gt; &lt;span class="nt"&gt;-out&lt;/span&gt; server.crt &lt;span class="nt"&gt;-days&lt;/span&gt; 365 &lt;span class="nt"&gt;-sha256&lt;/span&gt; &lt;span class="nt"&gt;-extfile&lt;/span&gt; server.ext

&lt;span class="c"&gt;# Verify the cert generated using the ca&lt;/span&gt;
&lt;span class="c"&gt;# This way you will be able to verify that the server cert was created using this CA&lt;/span&gt;
openssl verify &lt;span class="nt"&gt;-CAfile&lt;/span&gt; ca.pem server.crt
server.crt: OK


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Place the certs in the MySQL folder&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="c"&gt;# Create mysql certs folder&lt;/span&gt;
&lt;span class="nb"&gt;mkdir&lt;/span&gt; /etc/mysql/certs

&lt;span class="nb"&gt;cp&lt;/span&gt; ~/certs/ca.pem ~/certs/server.crt ~/certs/server.key /etc/mysql/certs

&lt;span class="nb"&gt;chown&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; mysql: /etc/mysql/certs


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Configure MySQL Server&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="c"&gt;# Place the config in the below file&lt;/span&gt;
&lt;span class="c"&gt;# to override the configs in my.cnf&lt;/span&gt;
vim /etc/mysql/mariadb.conf.d/50-server.cnf

&lt;span class="o"&gt;[&lt;/span&gt;mysqld]
bind-address    &lt;span class="o"&gt;=&lt;/span&gt; 0.0.0.0
&lt;span class="nv"&gt;ssl_ca&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/etc/mysql/certs/ca.pem
&lt;span class="nv"&gt;ssl_cert&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/etc/mysql/certs/server.crt
&lt;span class="nv"&gt;ssl_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/etc/mysql/certs/server.key


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Restart MySQL&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

service mysql restart


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;We will be able to login without certificate too, as a root user. When we do this, the connection will not use SSL connection, the data will not be encrypted. Let's confirm that&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

mysql &lt;span class="nt"&gt;-uroot&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt;  &lt;span class="c"&gt;# without any SSL/TLS encryption&lt;/span&gt;
&amp;lt;Enter password&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;

&lt;span class="n"&gt;MariaDB&lt;/span&gt; &lt;span class="p"&gt;[(&lt;/span&gt;&lt;span class="k"&gt;none&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;
&lt;span class="c1"&gt;--------------&lt;/span&gt;
&lt;span class="n"&gt;mysql&lt;/span&gt;  &lt;span class="n"&gt;Ver&lt;/span&gt; &lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="n"&gt;Distrib&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;13&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;MariaDB&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;debian&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;linux&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;gnu&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x86_64&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="n"&gt;readline&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;

&lt;span class="k"&gt;Connection&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;          &lt;span class="mi"&gt;48&lt;/span&gt;
&lt;span class="k"&gt;Current&lt;/span&gt; &lt;span class="k"&gt;database&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="k"&gt;Current&lt;/span&gt; &lt;span class="k"&gt;user&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;           &lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="n"&gt;localhost&lt;/span&gt;
&lt;span class="n"&gt;SSL&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;                    &lt;span class="k"&gt;Not&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;use&lt;/span&gt;  &lt;span class="o"&gt;#&amp;lt;&lt;/span&gt;&lt;span class="c1"&gt;-----------------------&lt;/span&gt;
&lt;span class="k"&gt;Current&lt;/span&gt; &lt;span class="n"&gt;pager&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;          &lt;span class="k"&gt;stdout&lt;/span&gt;
&lt;span class="k"&gt;Using&lt;/span&gt; &lt;span class="n"&gt;outfile&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;          &lt;span class="s1"&gt;''&lt;/span&gt;
&lt;span class="k"&gt;Using&lt;/span&gt; &lt;span class="k"&gt;delimiter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;        &lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;Server&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;                 &lt;span class="n"&gt;MariaDB&lt;/span&gt;
&lt;span class="n"&gt;Server&lt;/span&gt; &lt;span class="k"&gt;version&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;         &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;13&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;MariaDB&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;13&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;maria&lt;/span&gt;&lt;span class="o"&gt;~&lt;/span&gt;&lt;span class="n"&gt;focal&lt;/span&gt; &lt;span class="n"&gt;mariadb&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;org&lt;/span&gt; &lt;span class="nb"&gt;binary&lt;/span&gt; &lt;span class="n"&gt;distribution&lt;/span&gt;
&lt;span class="n"&gt;Protocol&lt;/span&gt; &lt;span class="k"&gt;version&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;       &lt;span class="mi"&gt;10&lt;/span&gt;
&lt;span class="k"&gt;Connection&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;             &lt;span class="n"&gt;Localhost&lt;/span&gt; &lt;span class="n"&gt;via&lt;/span&gt; &lt;span class="n"&gt;UNIX&lt;/span&gt; &lt;span class="n"&gt;socket&lt;/span&gt;
&lt;span class="n"&gt;Server&lt;/span&gt; &lt;span class="n"&gt;characterset&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;    &lt;span class="n"&gt;utf8mb4&lt;/span&gt;
&lt;span class="n"&gt;Db&lt;/span&gt;     &lt;span class="n"&gt;characterset&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;    &lt;span class="n"&gt;utf8mb4&lt;/span&gt;
&lt;span class="n"&gt;Client&lt;/span&gt; &lt;span class="n"&gt;characterset&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;    &lt;span class="n"&gt;utf8&lt;/span&gt;
&lt;span class="n"&gt;Conn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;  &lt;span class="n"&gt;characterset&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;    &lt;span class="n"&gt;utf8&lt;/span&gt;
&lt;span class="n"&gt;UNIX&lt;/span&gt; &lt;span class="n"&gt;socket&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;            &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;run&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;mysqld&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;mysqld&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sock&lt;/span&gt;
&lt;span class="n"&gt;Uptime&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;                 &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="n"&gt;hours&lt;/span&gt; &lt;span class="mi"&gt;43&lt;/span&gt; &lt;span class="k"&gt;min&lt;/span&gt; &lt;span class="mi"&gt;54&lt;/span&gt; &lt;span class="n"&gt;sec&lt;/span&gt;

&lt;span class="n"&gt;Threads&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;  &lt;span class="n"&gt;Questions&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;110&lt;/span&gt;  &lt;span class="n"&gt;Slow&lt;/span&gt; &lt;span class="n"&gt;queries&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;  &lt;span class="n"&gt;Opens&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;34&lt;/span&gt;  &lt;span class="k"&gt;Open&lt;/span&gt; &lt;span class="n"&gt;tables&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;27&lt;/span&gt;  &lt;span class="n"&gt;Queries&lt;/span&gt; &lt;span class="n"&gt;per&lt;/span&gt; &lt;span class="k"&gt;second&lt;/span&gt; &lt;span class="k"&gt;avg&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;008&lt;/span&gt;
&lt;span class="c1"&gt;--------------&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;We can see above that SSL is not in use. Let us login using SSL abilities&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

mysql &lt;span class="nt"&gt;-p&lt;/span&gt; &lt;span class="nt"&gt;--ssl-ca&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/etc/mysql/certs/ca.pem


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;

&lt;span class="n"&gt;MariaDB&lt;/span&gt; &lt;span class="p"&gt;[(&lt;/span&gt;&lt;span class="k"&gt;none&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;
&lt;span class="c1"&gt;--------------&lt;/span&gt;
&lt;span class="n"&gt;mysql&lt;/span&gt;  &lt;span class="n"&gt;Ver&lt;/span&gt; &lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="n"&gt;Distrib&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;13&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;MariaDB&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;debian&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;linux&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;gnu&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x86_64&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="n"&gt;readline&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;

&lt;span class="k"&gt;Connection&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;          &lt;span class="mi"&gt;33&lt;/span&gt;
&lt;span class="k"&gt;Current&lt;/span&gt; &lt;span class="k"&gt;database&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="k"&gt;Current&lt;/span&gt; &lt;span class="k"&gt;user&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;           &lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="n"&gt;localhost&lt;/span&gt;
&lt;span class="n"&gt;SSL&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;                    &lt;span class="n"&gt;Cipher&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;use&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="n"&gt;TLS_AES_256_GCM_SHA384&lt;/span&gt;
&lt;span class="k"&gt;Current&lt;/span&gt; &lt;span class="n"&gt;pager&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;          &lt;span class="k"&gt;stdout&lt;/span&gt;
&lt;span class="k"&gt;Using&lt;/span&gt; &lt;span class="n"&gt;outfile&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;          &lt;span class="s1"&gt;''&lt;/span&gt;
&lt;span class="k"&gt;Using&lt;/span&gt; &lt;span class="k"&gt;delimiter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;        &lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;Server&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;                 &lt;span class="n"&gt;MariaDB&lt;/span&gt;
&lt;span class="n"&gt;Server&lt;/span&gt; &lt;span class="k"&gt;version&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;         &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;13&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;MariaDB&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;13&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;maria&lt;/span&gt;&lt;span class="o"&gt;~&lt;/span&gt;&lt;span class="n"&gt;focal&lt;/span&gt; &lt;span class="n"&gt;mariadb&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;org&lt;/span&gt; &lt;span class="nb"&gt;binary&lt;/span&gt; &lt;span class="n"&gt;distribution&lt;/span&gt;
&lt;span class="n"&gt;Protocol&lt;/span&gt; &lt;span class="k"&gt;version&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;       &lt;span class="mi"&gt;10&lt;/span&gt;
&lt;span class="k"&gt;Connection&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;             &lt;span class="n"&gt;Localhost&lt;/span&gt; &lt;span class="n"&gt;via&lt;/span&gt; &lt;span class="n"&gt;UNIX&lt;/span&gt; &lt;span class="n"&gt;socket&lt;/span&gt;
&lt;span class="n"&gt;Server&lt;/span&gt; &lt;span class="n"&gt;characterset&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;    &lt;span class="n"&gt;utf8mb4&lt;/span&gt;
&lt;span class="n"&gt;Db&lt;/span&gt;     &lt;span class="n"&gt;characterset&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;    &lt;span class="n"&gt;utf8mb4&lt;/span&gt;
&lt;span class="n"&gt;Client&lt;/span&gt; &lt;span class="n"&gt;characterset&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;    &lt;span class="n"&gt;utf8&lt;/span&gt;
&lt;span class="n"&gt;Conn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;  &lt;span class="n"&gt;characterset&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;    &lt;span class="n"&gt;utf8&lt;/span&gt;
&lt;span class="n"&gt;UNIX&lt;/span&gt; &lt;span class="n"&gt;socket&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;            &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;run&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;mysqld&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;mysqld&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sock&lt;/span&gt;
&lt;span class="n"&gt;Uptime&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;                 &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="k"&gt;min&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt; &lt;span class="n"&gt;sec&lt;/span&gt;

&lt;span class="n"&gt;Threads&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;  &lt;span class="n"&gt;Questions&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;68&lt;/span&gt;  &lt;span class="n"&gt;Slow&lt;/span&gt; &lt;span class="n"&gt;queries&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;  &lt;span class="n"&gt;Opens&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt;  &lt;span class="k"&gt;Open&lt;/span&gt; &lt;span class="n"&gt;tables&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;25&lt;/span&gt;  &lt;span class="n"&gt;Queries&lt;/span&gt; &lt;span class="n"&gt;per&lt;/span&gt; &lt;span class="k"&gt;second&lt;/span&gt; &lt;span class="k"&gt;avg&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;539&lt;/span&gt;
&lt;span class="c1"&gt;--------------&lt;/span&gt;

&lt;span class="n"&gt;MariaDB&lt;/span&gt; &lt;span class="p"&gt;[(&lt;/span&gt;&lt;span class="k"&gt;none&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;SHOW&lt;/span&gt; &lt;span class="n"&gt;VARIABLES&lt;/span&gt; &lt;span class="k"&gt;LIKE&lt;/span&gt; &lt;span class="s1"&gt;'%ssl%'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="c1"&gt;---------------------+-----------------------------+&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;Variable_name&lt;/span&gt;       &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;Value&lt;/span&gt;                       &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="c1"&gt;---------------------+-----------------------------+&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;have_openssl&lt;/span&gt;        &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;YES&lt;/span&gt;                         &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;have_ssl&lt;/span&gt;            &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;YES&lt;/span&gt;                         &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;ssl_ca&lt;/span&gt;              &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;etc&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;mysql&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;certs&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;ca&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pem&lt;/span&gt;     &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;ssl_capath&lt;/span&gt;          &lt;span class="o"&gt;|&lt;/span&gt;                             &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;ssl_cert&lt;/span&gt;            &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;etc&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;mysql&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;certs&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;server&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;crt&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;ssl_cipher&lt;/span&gt;          &lt;span class="o"&gt;|&lt;/span&gt;                             &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;ssl_crl&lt;/span&gt;             &lt;span class="o"&gt;|&lt;/span&gt;                             &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;ssl_crlpath&lt;/span&gt;         &lt;span class="o"&gt;|&lt;/span&gt;                             &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;ssl_key&lt;/span&gt;             &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;etc&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;mysql&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;certs&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;server&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;key&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;version_ssl_library&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;OpenSSL&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;  &lt;span class="mi"&gt;31&lt;/span&gt; &lt;span class="n"&gt;Mar&lt;/span&gt; &lt;span class="mi"&gt;2020&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="c1"&gt;---------------------+-----------------------------+&lt;/span&gt;
&lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="k"&gt;rows&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;001&lt;/span&gt; &lt;span class="n"&gt;sec&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;How to Force users to use SSL?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We saw that the root user had a choice to choose between SSL and non-SSL connection. But what if we wanted to force a user and require SSL connection else drop the connection. This is possible by creating the user with &lt;code&gt;REQUIRE SSL&lt;/code&gt;. &lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;

&lt;span class="n"&gt;MariaDB&lt;/span&gt; &lt;span class="p"&gt;[(&lt;/span&gt;&lt;span class="k"&gt;none&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;create&lt;/span&gt; &lt;span class="k"&gt;user&lt;/span&gt; &lt;span class="s1"&gt;'tharun'&lt;/span&gt;&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="s1"&gt;'%'&lt;/span&gt; &lt;span class="n"&gt;identified&lt;/span&gt; &lt;span class="k"&gt;by&lt;/span&gt; &lt;span class="s1"&gt;'xr7y(#$&amp;amp;*ox8r7#Y$xo87n'&lt;/span&gt; &lt;span class="n"&gt;REQUIRE&lt;/span&gt; &lt;span class="n"&gt;SSL&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 
&lt;span class="n"&gt;Query&lt;/span&gt; &lt;span class="n"&gt;OK&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="k"&gt;rows&lt;/span&gt; &lt;span class="n"&gt;affected&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;004&lt;/span&gt; &lt;span class="n"&gt;sec&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;MariaDB&lt;/span&gt; &lt;span class="p"&gt;[(&lt;/span&gt;&lt;span class="k"&gt;none&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;show&lt;/span&gt; &lt;span class="n"&gt;grants&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="s1"&gt;'tharun'&lt;/span&gt;&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="s1"&gt;'%'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="c1"&gt;-------------------------------------------------------------------------------------------------------------------+&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;Grants&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;tharun&lt;/span&gt;&lt;span class="o"&gt;@%&lt;/span&gt;
  &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="c1"&gt;-------------------------------------------------------------------------------------------------------------------+&lt;/span&gt;
&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;USAGE&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="nv"&gt;`tharun`&lt;/span&gt;&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="nv"&gt;`%`&lt;/span&gt; &lt;span class="n"&gt;IDENTIFIED&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;PASSWORD&lt;/span&gt; &lt;span class="s1"&gt;'*A5F8D7B95653CF24C6DC9628BC84B0B2FF89D9DF'&lt;/span&gt; &lt;span class="n"&gt;REQUIRE&lt;/span&gt; &lt;span class="n"&gt;SSL&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;
&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="c1"&gt;-------------------------------------------------------------------------------------------------------------------+&lt;/span&gt;
&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="k"&gt;row&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="k"&gt;set&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;000&lt;/span&gt; &lt;span class="n"&gt;sec&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;The user has been created. Now exit out of MySQL prompt and login using the &lt;code&gt;tharun&lt;/code&gt; user&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

root@ubuntu-focal:~/certs# mysql &lt;span class="nt"&gt;-utharun&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt;
Enter password: 
ERROR 1045 &lt;span class="o"&gt;(&lt;/span&gt;28000&lt;span class="o"&gt;)&lt;/span&gt;: Access denied &lt;span class="k"&gt;for &lt;/span&gt;user &lt;span class="s1"&gt;'tharun'&lt;/span&gt;@&lt;span class="s1"&gt;'localhost'&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;using password: YES&lt;span class="o"&gt;)&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;We see that the user is not able to login without the ca.pem file. Here onwards the client will need the &lt;code&gt;ca.pem&lt;/code&gt; file in order to connect to MySQL Server.&lt;/p&gt;

&lt;p&gt;More trending articles on Hashicorp Vault:&lt;/p&gt;

&lt;p&gt;What is Vault? Why do we need it?&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/developertharun" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F378811%2Fdfe9c221-cff5-4e4d-9fcb-61fb3ca2bdd0.png" alt="developertharun"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/developertharun/hashicorp-vault-what-why-all-you-need-to-know-about-vault-secrets-management-for-roadrunners-3j1n" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Hashicorp Vault | What &amp;amp; Why? | All you need to know about Vault | Secrets management for roadrunners&lt;/h2&gt;
      &lt;h3&gt;Tharun Shiv ・ Jan 2 '22&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#security&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#beginners&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#tutorial&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#devops&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;



&lt;p&gt;Set up a Vault Dev and Production server in 5 minutes:&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/developertharun" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F378811%2Fdfe9c221-cff5-4e4d-9fcb-61fb3ca2bdd0.png" alt="developertharun"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/developertharun/hashicorp-vault-dev-and-prod-server-setup-unseal-policies-tls-setup-48mo" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Hashicorp Vault | Dev and Prod server setup | Unseal | Policies | TLS setup | Tharun&lt;/h2&gt;
      &lt;h3&gt;Tharun Shiv ・ Jan 2 '22&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#security&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#database&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#beginners&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#devops&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;h1&gt;
  
  
  Thank you for reading, This is Tharun Shiv a.k.a Developer Tharun
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxtxq6bdms36fmn62450h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxtxq6bdms36fmn62450h.png" alt="Tharun Shiv"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can find more articles here: &lt;a href="https://dev.to/developertharun"&gt;https://dev.to/developertharun&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Roadrunners is a series that is aimed at delivering concepts as precisely as possible. Here, a roadrunner is referred to as a person who does things super fast &amp;amp; efficiently. Are you a roadrunner?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Thank you&lt;/p&gt;

</description>
      <category>mysql</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>database</category>
    </item>
    <item>
      <title>What are Vault User Policies &amp; how to create them? Hashicorp Vault</title>
      <dc:creator>Tharun Shiv</dc:creator>
      <pubDate>Sat, 15 Jan 2022 14:43:01 +0000</pubDate>
      <link>https://forem.com/developertharun/what-are-vault-user-policies-how-to-create-them-hashicorp-vault-31ko</link>
      <guid>https://forem.com/developertharun/what-are-vault-user-policies-how-to-create-them-hashicorp-vault-31ko</guid>
      <description>&lt;h2&gt;
  
  
  Hashicorp Vault
&lt;/h2&gt;

&lt;p&gt;Hashicorp Vault is an opensource software from Hashicorp. Vault is used to manage secrets.&lt;/p&gt;

&lt;p&gt;What is a secret?&lt;/p&gt;

&lt;p&gt;Secrets can be considered as anything that one uses to authenticate, authorize themselves. Secrets are also pieces of information that are private to any user.&lt;/p&gt;

&lt;h2&gt;
  
  
  What are policies?
&lt;/h2&gt;

&lt;p&gt;Policies help you create rules that define access to various secrets. We can create policies that allow certain level access like create access, update access, read access, delete access and so on. We then assign this policy to a particular authentication mechanism of a user. This user will have only those access mentioned in the policies attached to his credentials. This way, Vault makes sure that we provide minimal and only necessary access to Vault stakeholders.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="c"&gt;# export variables that will be used by Vault when commands &lt;/span&gt;
&lt;span class="c"&gt;# are run in the current terminal session&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;VAULT_ADDR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'http://127.0.0.1:8200'&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;VAULT_TOKEN&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'s.hfAJfADfj...'&lt;/span&gt;

&lt;span class="c"&gt;# check Vault server status&lt;/span&gt;
vault status

&lt;span class="c"&gt;# login into Vault&lt;/span&gt;
vault login

&lt;span class="c"&gt;# view current logged in token information&lt;/span&gt;
vault token lookup

&lt;span class="c"&gt;# create policies and respective tokens&lt;/span&gt;
vim secret-user-policy.hcl
path &lt;span class="s2"&gt;"secret/data/*"&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;  capabilities &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"read"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;}&lt;/span&gt;

vim secret-admin-policy.hcl
path &lt;span class="s2"&gt;"secret/data/*"&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;  capabilities &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"read"&lt;/span&gt;, &lt;span class="s2"&gt;"create"&lt;/span&gt;, &lt;span class="s2"&gt;"update"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;# command to write policy&lt;/span&gt;
vault policy write secret-user-policy secret-user-policy.hcl
vault policy write secret-admin-policy secret-admin-policy.hcl

&lt;span class="c"&gt;# read policy&lt;/span&gt;
vault policy &lt;span class="nb"&gt;read &lt;/span&gt;secret-user-policy
vault policy &lt;span class="nb"&gt;read &lt;/span&gt;secret-admin-policy

&lt;span class="c"&gt;# list policies&lt;/span&gt;
vault policy list

&lt;span class="c"&gt;# create token&lt;/span&gt;
vault token create &lt;span class="nt"&gt;-format&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;json &lt;span class="nt"&gt;-policy&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"secret-user-policy"&lt;/span&gt;
vault token create &lt;span class="nt"&gt;-format&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;json &lt;span class="nt"&gt;-policy&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"secret-admin-policy"&lt;/span&gt;
&lt;span class="c"&gt;#&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;The &lt;code&gt;hcl&lt;/code&gt; file contains the &lt;code&gt;path&lt;/code&gt; and &lt;code&gt;capabilities&lt;/code&gt; mainly. The path is used to mention which capabilities the enclosed ones are applicable to. Paths allow us to use regular expressions in them to match various Vault paths. The capabilities include:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;read&lt;/strong&gt;: Similar to the GET HTTP method, allows reading the data at the given path.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;create&lt;/strong&gt;: Similar to the POST &amp;amp; PUT HTTP Method, allows creating data at the given path. Very few parts of Vault distinguish between create and update, so most operations require both create and update capabilities. Parts of Vault that provide such a distinction are noted in documentation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;update&lt;/strong&gt;: Similar to the POST &amp;amp; PUT HTTP Method, allows changing the data at the given path. In most parts of Vault, this implicitly includes the ability to create the initial value at the path.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;delete&lt;/strong&gt;: Similar to the DELETE HTTP Method, allows deleting the data at the given path.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;list&lt;/strong&gt;: Allows listing values at the given path.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;sudo&lt;/strong&gt;: Allows access to paths that are root-protected. Tokens are not permitted to interact with these paths unless they have the sudo capability&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;deny&lt;/strong&gt;: Disallows access. This always takes precedence regardless of any other defined capabilities, including sudo.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://www.vaultproject.io/docs/concepts/policies" rel="noopener noreferrer"&gt;Source&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Testing the policies
&lt;/h2&gt;

&lt;p&gt;Now testing the policies&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="c"&gt;# now open two tmux sessions for each type of user to test policies&lt;/span&gt;
tmux new &lt;span class="nt"&gt;-s&lt;/span&gt; demo &lt;span class="c"&gt;# and split screens for admin and user&lt;/span&gt;

&lt;span class="c"&gt;# at each of the tmux window&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;VAULT_ADDR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'http://127.0.0.1:8200'&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;VAULT_TOKEN&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'s.hfAJfADfj...'&lt;/span&gt;

vault login &lt;span class="c"&gt;# enter repective tokens&lt;/span&gt;
vault token lookup &lt;span class="c"&gt;# to view current logged in token information&lt;/span&gt;

&lt;span class="c"&gt;# on admin window &amp;amp; notice versions&lt;/span&gt;
vault kv put secret/data/mysql &lt;span class="nv"&gt;username&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;root

&lt;span class="c"&gt;# add multiple keys in a single command &lt;/span&gt;
vault kv put secret/data/mysql &lt;span class="nv"&gt;username&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;root &lt;span class="nv"&gt;password&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;root

&lt;span class="c"&gt;# prevent recording the value of the token in terminal history&lt;/span&gt;
vault kv put secret/data/googlecloud &lt;span class="nv"&gt;token&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;-

&lt;span class="c"&gt;# read from a json file&lt;/span&gt;
vault kv put secret/data/googlecloud @apitoken.json

&lt;span class="c"&gt;# add multiple keys in a single command &lt;/span&gt;
vault kv put secret/data/aerospike &lt;span class="se"&gt;\&lt;/span&gt;
     &lt;span class="nv"&gt;username&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;root &lt;span class="se"&gt;\&lt;/span&gt;
     &lt;span class="nv"&gt;password&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;root &lt;span class="se"&gt;\&lt;/span&gt;
     &lt;span class="nv"&gt;tlsname&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;securecert &lt;span class="se"&gt;\&lt;/span&gt;
     &lt;span class="nv"&gt;namespace&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;hashicorp

&lt;span class="c"&gt;# read secret&lt;/span&gt;
vault kv get secret/data/mysql

&lt;span class="c"&gt;# ON USER WINDOW&lt;/span&gt;
vault kv put secret/data/mysql &lt;span class="nv"&gt;username&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;root &lt;span class="c"&gt;# Will not work since this user does not have privileges&lt;/span&gt;

vault kv get secret/data/mysql


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Thus, we have seen what goes into creating a policy, how to create one, and have also tested the policies to see the difference between them.&lt;/p&gt;

&lt;p&gt;More trending articles on Hashicorp Vault:&lt;/p&gt;

&lt;p&gt;What is Vault? Why do we need it?&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/developertharun" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F378811%2Fdfe9c221-cff5-4e4d-9fcb-61fb3ca2bdd0.png" alt="developertharun"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/developertharun/hashicorp-vault-what-why-all-you-need-to-know-about-vault-secrets-management-for-roadrunners-3j1n" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Hashicorp Vault | What &amp;amp; Why? | All you need to know about Vault | Secrets management for roadrunners&lt;/h2&gt;
      &lt;h3&gt;Tharun Shiv ・ Jan 2 '22&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#security&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#beginners&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#tutorial&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#devops&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;



&lt;p&gt;Set up a Vault Dev and Production server in 5 minutes:&lt;/p&gt;


&lt;div class="ltag__link"&gt;
  &lt;a href="/developertharun" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F378811%2Fdfe9c221-cff5-4e4d-9fcb-61fb3ca2bdd0.png" alt="developertharun"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="/developertharun/hashicorp-vault-dev-and-prod-server-setup-unseal-policies-tls-setup-48mo" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Hashicorp Vault | Dev and Prod server setup | Unseal | Policies | TLS setup | Tharun&lt;/h2&gt;
      &lt;h3&gt;Tharun Shiv ・ Jan 2 '22&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#security&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#database&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#beginners&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#devops&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


&lt;p&gt;Written by,&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__user ltag__user__id__378811"&gt;
    &lt;a href="/developertharun" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&gt;
        &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F378811%2Fdfe9c221-cff5-4e4d-9fcb-61fb3ca2bdd0.png" alt="developertharun image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/developertharun"&gt;Tharun Shiv&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/developertharun"&gt;Site Reliability Engineer | Blogger | Podcasts | Youtube @ developertharun&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;h1&gt;
  
  
  Thank you for reading, This is Tharun Shiv a.k.a Developer Tharun
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxtxq6bdms36fmn62450h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxtxq6bdms36fmn62450h.png" alt="Tharun Shiv"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can find more articles here: &lt;a href="https://dev.to/developertharun"&gt;https://dev.to/developertharun&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Roadrunners is a series that is aimed at delivering concepts as precisely as possible. Here, a roadrunner is referred to as a person who does things super fast &amp;amp; efficiently. Are you a roadrunner?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Thank you&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>tutorial</category>
      <category>devops</category>
      <category>security</category>
    </item>
    <item>
      <title>8 ways to become a BETTER SRE ( Right now! ) | 8 non-technical characteristics to have</title>
      <dc:creator>Tharun Shiv</dc:creator>
      <pubDate>Fri, 14 Jan 2022 11:25:11 +0000</pubDate>
      <link>https://forem.com/developertharun/8-ways-to-become-a-better-sre-right-now-8-non-technical-characteristics-to-have-3n4p</link>
      <guid>https://forem.com/developertharun/8-ways-to-become-a-better-sre-right-now-8-non-technical-characteristics-to-have-3n4p</guid>
      <description>&lt;p&gt;Site Reliability Engineering, also popularly referred to as the SRE, is a role in Computer Science Engineering where the main purpose is to provision, maintain, monitor, and manage the infrastructure to provide maximum application uptime and reliability. SRE is an emerging role, but the tasks that the SRE does were always there ever since the first application that was developed. The scope of the software developers ends where they write code to develop the application and right from setting up the infrastructure, the various services that run on them, the network connectivity that is required, providing a platform for the application to run and making sure every part of the application is up and running reliably 24x7 is the duty of an SRE. We can consider Site Reliability Engineers are the strong bridge between the users and a reliable application.&lt;/p&gt;

&lt;p&gt;Let us look at 8 ways in which you can become a better SRE at work. SRE not just involves various technologies to deal with and keep them running, but also several non-technical characteristics. &lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/2drsyhJzcao"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  1. SRE is all about the right Mindset
&lt;/h2&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a. No blame game

b. Thirst to solve
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;As an SRE we deal with multiple components and are a bridge between the users and the application. Even though the application is well written, a bigger responsibility falls upon SRE to keep the applications and the services it uses up and running. In this process, there might be a few situations where one of the SRE does a mistake that causes a disruption or even an outage. When this happens, the first thing to happen shouldn't be to blame anyone for the outage, but the following has to be performed. &lt;/p&gt;

&lt;p&gt;i. Fix the issue&lt;/p&gt;

&lt;p&gt;ii. Write an RCA ( Root Cause Analysis ) that mentions why the issue occurred in the first place, the names can be anonymous.&lt;/p&gt;

&lt;p&gt;iii. Mention the first aid and the fix for the issue&lt;/p&gt;

&lt;p&gt;iv. Discuss how the issue can be prevented the next time &lt;/p&gt;

&lt;p&gt;v. Set an ETA for the fix&lt;/p&gt;

&lt;p&gt;Another aspect is to have the right mindset to solve problems. As an SRE you have the responsibility to optimize the infrastructure, fix issues, build automation tools, monitoring tools, and more, which requires a lot of problem-solving skills. Unless you have the thirst to solve the problems, you will only feel more stressed out, or even worse, would cause issues.&lt;/p&gt;
&lt;h2&gt;
  
  
  2. Communication
&lt;/h2&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a. Overcommunication is not a problem

b. Be kind and show empathy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Are you performing a production activity or even a stage change that could affect other teams? Have you made progress in the project that you are working on? Make sure to keep the necessary stakeholders in sync always. Write emails, send slack messages well in advance before the production activity, just before and after the activity. It might sound like over-communication, but trust me, as the company scales, you need to keep everyone relevant to the component that you are working on in sync. This way, if they have to take any actions from their side, they will do it, or if they face any issues post-activity they'll know who the right person to get in touch with is.&lt;/p&gt;

&lt;p&gt;One other important characteristic to have as a human being is to be kind and show empathy. This will apply to all levels of engineering on either side of the conversation, period. Whether someone asks a silly question, or does a mistake, or behaves rudely with you, you should never mirror that behavior.&lt;/p&gt;
&lt;h2&gt;
  
  
  3. Stay synced with the team
&lt;/h2&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a. Do not miss team meetings

b. Prevent duplication of work

c. Do not compete, but contribute
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;In this work from home ( WFH ) period, the only time where you have an opportunity to speak to your teammates is during a team meet. The reason why this is special is, you get an opportunity to stay synced with your team on what they all are working on, whether they are blocked on any tasks, how you can contribute to their tasks and also you will be using this opportunity to convey on what you are working on and get help if necessary. This also prevents duplication of work.  &lt;/p&gt;
&lt;h2&gt;
  
  
  4. Shadow teammates on tasks and issues
&lt;/h2&gt;

&lt;p&gt;The best way to learn is by doing it hands-on and the best way to begin would be by watching how it is done. I also believe that the best way to retain the learned information is by performing it repeatedly. This also includes watching your teammates perform the activities. It ensures that the activity is done without any mistakes when there are several eyes to watch it.&lt;/p&gt;
&lt;h2&gt;
  
  
  5. No Spoon-feeding, do homework
&lt;/h2&gt;

&lt;p&gt;Do not expect all details to be taught by your teammates and seniors. Read the documentation, watch tutorials, read engineering blogs, practice on your own, and suggest improvisations. Even a well-built system will have much more efficient solutions, that you can propose. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8qlsvmu5wowdihngs04h.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8qlsvmu5wowdihngs04h.PNG" alt="SRE mindmap"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  6. Be attentive and cautious on production
&lt;/h2&gt;

&lt;p&gt;I've heard people pretending to work while watching web series. They might be proud of their multitasking skills, but as far as I know, there is no such thing as multitasking at work while watching a web series and I highly recommend one to not do that. If you are interested in watching a series, I would suggest you use that motivation to focus on the work, finish the tasks quickly and reward yourself with a couple of episodes later in the evening.&lt;/p&gt;

&lt;p&gt;Attention is the core necessity of life, and the same holds true to an SRE. Be attentive to the commands you run, the alerts you get, the trend the charts show, and the logs of the services and applications. Prepare for activities well in advance and let the actual activities be a no-brainer copy-paste so that you can pay attention to other indications during the activity.&lt;/p&gt;
&lt;h2&gt;
  
  
  7. Think before you hit enter
&lt;/h2&gt;

&lt;p&gt;Do not underestimate sudo privilege. A lot of us have a habit to enter into the sudo mode as soon as we login into a machine, which is unnecessary. Even if the command you are running looks like a harmless command, make sure to get the process and commands reviewed by your teammates, seniors, or the subject experts, this will save you from outages.&lt;/p&gt;
&lt;h2&gt;
  
  
  8. Keep version control systems in sync
&lt;/h2&gt;

&lt;p&gt;Whether it is NGINX config or any service config, make sure to keep the version control system that is isolated from the system in sync. No one hopes for the machine to become unresponsive, but when the machine becomes unusable all of a sudden, you have another opportunity to bring up alternate machines with the same configs as the previous ones. Keeping the version control system in sync also helps in automation.&lt;/p&gt;

&lt;p&gt;Listen to the Podcast with more examples and explanation&lt;/p&gt;

&lt;p&gt;&lt;iframe src="https://open.spotify.com/embed/episode/1xAQZ0u0He3VDQ4bzPzS7y" width="100%" height="232px"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Read about what Site Reliability Engineering is and what are the 4 main things that the Site Reliability Engineers take part in: &lt;a href="https://dev.to/developertharun/1-whats-site-reliability-engineering-sre-roles-responsibilities-technologies-involved-1dcc"&gt;Link to the Article&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/JgS4ZlQZfj4"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Check out my YouTube Channel here: &lt;a href="https://www.youtube.com/c/developerTharun" rel="noopener noreferrer"&gt;Developer Tharun - YouTube&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Thank you for reading the article.&lt;/p&gt;

&lt;p&gt;Written by,&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__user ltag__user__id__378811"&gt;
    &lt;a href="/developertharun" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&gt;
        &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F378811%2Fdfe9c221-cff5-4e4d-9fcb-61fb3ca2bdd0.png" alt="developertharun image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/developertharun"&gt;Tharun Shiv&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/developertharun"&gt;Site Reliability Engineer | Blogger | Podcasts | Youtube @ developertharun&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;



&lt;h1&gt;
  
  
  Thank you for reading, This is Tharun Shiv a.k.a Developer Tharun
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxtxq6bdms36fmn62450h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxtxq6bdms36fmn62450h.png" alt="Tharun Shiv"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>beginners</category>
      <category>security</category>
      <category>cloud</category>
    </item>
    <item>
      <title>#1 What's Site Reliability Engineering [SRE] | Roles &amp; Responsibilities | Technologies involved</title>
      <dc:creator>Tharun Shiv</dc:creator>
      <pubDate>Sat, 08 Jan 2022 12:30:04 +0000</pubDate>
      <link>https://forem.com/developertharun/1-whats-site-reliability-engineering-sre-roles-responsibilities-technologies-involved-1dcc</link>
      <guid>https://forem.com/developertharun/1-whats-site-reliability-engineering-sre-roles-responsibilities-technologies-involved-1dcc</guid>
      <description>&lt;h2&gt;
  
  
  Site reliability engineering
&lt;/h2&gt;

&lt;p&gt;Site Reliability Engineering, also popularly referred to as the SRE, is a role in Computer Science Engineering where the main purpose is to provision, maintain, monitor, and manage the infrastructure in order to provide maximum application uptime and reliability. SRE is an emerging role, but the tasks that the SRE does were always there ever since the first application that was developed. The scope of the software developers ends where they write code to develop the application and right from setting up the infrastructure, the various services that run on them, the network connectivity that is required, providing a platform for the application to run and making sure every part of the application is up and running reliably 24x7 is the duty of an SRE. In fact, we can consider Site Reliability Engineers are the strong bridge between the users and a reliable application.&lt;/p&gt;

&lt;p&gt;Now, in order to explain the different responsibilities of an SRE, I have divided it into 4 different categories. I have always seen SRE this way, and definitely not as some ad-hoc process. The four categories in which I would classify the tasks of a Site Reliability Engineer are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create&lt;/li&gt;
&lt;li&gt;Monitor&lt;/li&gt;
&lt;li&gt;Manage&lt;/li&gt;
&lt;li&gt;Destroy&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let's dive deep into each one of them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Provision virtual machines / PXE Baremetals
&lt;/h3&gt;

&lt;p&gt;SREs are responsible for provisioning the virtual machines with the requested resources in terms of CPU, memory, disks, network configurations, and operating system. In case a bare metal needs to be set up, it is also performed with the provided configurations. The SREs use Linux commands, automation scripts to provision the server as quickly as possible. They are also responsible to be rack aware during provisioning. Example operating systems involve Linux Ubuntu, CentOS, Windows.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Setup services
&lt;/h3&gt;

&lt;p&gt;Once the machines are provisioned, the SRE also takes care of setting up the services on the machines. These services can be networking services, proxy or load balancing services, container or orchestration services, message queues, databases, caching systems, big data services, or more, along with the disk setup. In this way, the SRE are exposed to a variety of technology and play an important role in the components involved in an application. Example technologies involve NGINX, Apache, RabbitMQ, Kafka, Hadoop, Traefik, MySQL, PostgreSQL, Aerospike, MongoDB, Redis, MinIO, Kubernetes, Apache Mesos, Marathon, MariaDB, Galera.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Optimize the infrastructure
&lt;/h3&gt;

&lt;p&gt;Since there are several components and services that are being used in the infrastructure, there is a scope for improvements in terms of performance, efficiency, and security. The SRE optimizes the components by keeping them up to date, choosing the right service for the right job, patching the servers.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Write monitoring scripts
&lt;/h3&gt;

&lt;p&gt;When the SRE are involved in maintaining an infrastructure of any size, they never underestimate any component of the infrastructure and write a monitoring script to monitor the components and metrics of each and every one of them. This provides the ability to get real-time alerts on any of the components malfunctioning and also a better view of the infrastructure. The SRE uses programming languages like Bash, Python, Golang, Perl, and tools like daemon processes, Riemann, InfluxDB, OpenTSDB, Kafka, Grafana, Prometheus, and APIs to monitor the infrastructure.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Write automation scripts
&lt;/h3&gt;

&lt;p&gt;If there are more than 10 steps to be performed and chances are that the task has to be performed more than once, the SRE never hesitate to automate the task. This saves time and also prevents human error. The SRE uses programming languages like Bash, Python, Golang, Perl, Ansible to automate the tasks.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Manage users on the machines
&lt;/h3&gt;

&lt;p&gt;One of the main security precaution that the SRE take is to restrict user access to the components in the infrastructure. They use various technologies like VPN ( Virtual Private Network ), firewall, configuration files, user management on machines, LDAP, sudoer configuration, PAM, OTP, two-factor authentications, SSH keys, and more to avoid unauthorized access to any component of the infrastructure.&lt;/p&gt;

&lt;p&gt;These are the create aspects of a Site Reliability Engineer. In the next article we will read about the Monitor aspect of a Site Reliability Engineer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Complete Video:
&lt;/h2&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/JgS4ZlQZfj4"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Watch the video above or listen to the full podcast exclusively below&lt;/p&gt;

&lt;h2&gt;
  
  
  Podcast:
&lt;/h2&gt;

&lt;p&gt;&lt;iframe src="https://open.spotify.com/embed/episode/6KYPJlG66yB4NZprEL6aFk" width="100%" height="232px"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;You can find more articles here: &lt;a href="https://www.tharunshiv.com" rel="noopener noreferrer"&gt;https://www.tharunshiv.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thank you&lt;/p&gt;

&lt;p&gt;Check out my YouTube Channel here: &lt;a href="https://www.youtube.com/c/developerTharun" rel="noopener noreferrer"&gt;Developer Tharun - YouTube&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Written by,&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag__user ltag__user__id__378811"&gt;
    &lt;a href="/developertharun" class="ltag__user__link profile-image-link"&gt;
      &lt;div class="ltag__user__pic"&gt;
        &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F378811%2Fdfe9c221-cff5-4e4d-9fcb-61fb3ca2bdd0.png" alt="developertharun image"&gt;
      &lt;/div&gt;
    &lt;/a&gt;
  &lt;div class="ltag__user__content"&gt;
    &lt;h2&gt;
&lt;a class="ltag__user__link" href="/developertharun"&gt;Tharun Shiv&lt;/a&gt;Follow
&lt;/h2&gt;
    &lt;div class="ltag__user__summary"&gt;
      &lt;a class="ltag__user__link" href="/developertharun"&gt;Site Reliability Engineer | Blogger | Podcasts | Youtube @ developertharun&lt;/a&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;h1&gt;
  
  
  Thank you for reading, This is Tharun Shiv a.k.a Developer Tharun
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxtxq6bdms36fmn62450h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxtxq6bdms36fmn62450h.png" alt="Tharun Shiv"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>beginners</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
