<?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: Ian Muchina</title>
    <description>The latest articles on Forem by Ian Muchina (@ianmuchina).</description>
    <link>https://forem.com/ianmuchina</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%2F411449%2F362befe9-5cdf-45d2-8b2e-911e96f87574.png</url>
      <title>Forem: Ian Muchina</title>
      <link>https://forem.com/ianmuchina</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/ianmuchina"/>
    <language>en</language>
    <item>
      <title>Stop chrome from pausing when switching desktops</title>
      <dc:creator>Ian Muchina</dc:creator>
      <pubDate>Sat, 03 Apr 2021 21:00:00 +0000</pubDate>
      <link>https://forem.com/ianmuchina/stop-chrome-from-pausing-when-switching-desktops-2n2d</link>
      <guid>https://forem.com/ianmuchina/stop-chrome-from-pausing-when-switching-desktops-2n2d</guid>
      <description>&lt;p&gt;Sometimes I switch desktop environments because, why not? Every time I switch between gnome and kde, I face the same issue. Chrome pauses.&lt;/p&gt;

&lt;p&gt;When chrome displays the paused sign, it’s an issue with cookies. In this case, the cookies are encrypted, and chrome can’t decrypt them because it’s looking for the decryption key in the wrong keyring.&lt;/p&gt;

&lt;h2&gt;
  
  
  Too many keyrings
&lt;/h2&gt;

&lt;p&gt;A keyring is a lot like a password manager. The only difference is that keyrings are meant for programs, and password managers are meant for humans. &lt;a href="https://chromium.googlesource.com/chromium/src/+/master/docs/security/faq.md#does-the-password-manager-store-my-passwords-encrypted-on-disk"&gt;For security&lt;/a&gt;, chrome stores the key used to decrypt cookies in the keyring.&lt;/p&gt;

&lt;p&gt;All major operating systems have some sort of keyring implementation. Windows has one, Mac has one. Linux has several. On Linux, chrome decides the keyring it will use based on the current desktop environment.&lt;/p&gt;

&lt;p&gt;When switching desktop environments, chrome will switch keyrings without migrating the keys. This makes chrome forget the key needed to decrypt the cookies.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stick with one
&lt;/h2&gt;

&lt;p&gt;The solution is to hardcode the keyring chrome will use. You can do this with the –password-store flag, which has 3 options:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;gnome (to use GNOME Keyring)&lt;/li&gt;
&lt;li&gt;kwallet (to use KDE’s KWallet)&lt;/li&gt;
&lt;li&gt;basic (to use the plain text store. No encryption)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To set the flag, first install menu-libre.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install menulibre
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then using menu-libre, edit chrome’s command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/usr/bin/google-chrome-stable --password-store=kwallet5 %U
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hopefully, that works, and you can switch desktops without breaking your browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  Further reading
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://wiki.gnome.org/Projects/GnomeKeyring/SecurityFAQ"&gt;Benefits of keyrings&lt;/a&gt;&lt;/p&gt;

</description>
      <category>linux</category>
    </item>
    <item>
      <title>Some youtube-dl aliases</title>
      <dc:creator>Ian Muchina</dc:creator>
      <pubDate>Fri, 26 Mar 2021 05:00:00 +0000</pubDate>
      <link>https://forem.com/ianmuchina/some-youtube-dl-aliases-470j</link>
      <guid>https://forem.com/ianmuchina/some-youtube-dl-aliases-470j</guid>
      <description>&lt;h2&gt;
  
  
  defaults
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;alias ydl='youtube-dl -o "./%(title)s.%(ext)s"'

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Doesn’t change much of the defaults. Only removes unnecessary info from filename eg: &lt;code&gt;video-title-dQw4w9WgXcQ.mp4&lt;/code&gt; to &lt;code&gt;video-title.mp4&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  720p single video
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;alias yhd='youtube-dl -f "[height&amp;lt;=720]" -o "~/Videos/%(uploader)s/%(title)s.%(ext)s" --no-playlist '

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;720p&lt;/li&gt;
&lt;li&gt;Single video. No playlist&lt;/li&gt;
&lt;li&gt;Saves to &lt;code&gt;~/Videos/Uploader/Title.mp4&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  720p video playlist
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;alias ypl='youtube-dl -f "[height&amp;lt;=720]" -o "~/Videos/%(uploader)s/%(playlist)s/%(title)s.%(ext)s" '

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;720p&lt;/li&gt;
&lt;li&gt;Downloads entire playlist&lt;/li&gt;
&lt;li&gt;Saves to &lt;code&gt;~/Videos/Uploader/Playlist/Title.mp4&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Audio
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;alias ymp3='youtube-dl -f "bestaudio" -o "~/Music/%(uploader)s/%(title)s.%(ext)s" --no-playlist -x --audio-format mp3 --embed-thumbnail ' 

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;mp3&lt;/li&gt;
&lt;li&gt;Single audio. No playlist&lt;/li&gt;
&lt;li&gt;Saves to &lt;code&gt;~/Music/Uploader/Title.mp3&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Adds thumbnail as cover art&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Audio Playlist
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;alias ypl3='youtube-dl -f "bestaudio" -o "~/Music/%(uploader)s/%(playlist)s/%(title)s.%(ext)s" -x --audio-format mp3 --embed-thumbnail'

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Downloads entire playlist&lt;/li&gt;
&lt;li&gt;Saves to &lt;code&gt;~/Videos/Uploader/Playlist/Title.mp3&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Adds thumbnail as cover art&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>tips</category>
    </item>
    <item>
      <title>Reproducible Builds</title>
      <dc:creator>Ian Muchina</dc:creator>
      <pubDate>Sun, 24 Jan 2021 08:30:00 +0000</pubDate>
      <link>https://forem.com/ianmuchina/reproducible-builds-55jg</link>
      <guid>https://forem.com/ianmuchina/reproducible-builds-55jg</guid>
      <description>&lt;p&gt;A reproducible build is one that produces the same byte for byte output when given the same input. These builds aren’t common. Mostly because of compiler defaults.&lt;/p&gt;

&lt;p&gt;The things that can make a build non-reproducible are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Timestamps&lt;/li&gt;
&lt;li&gt;Unique IDs&lt;/li&gt;
&lt;li&gt;Build paths&lt;/li&gt;
&lt;li&gt;&lt;em&gt;etc&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why they matter
&lt;/h2&gt;

&lt;p&gt;Reproducible builds have inherent security. They allow us to verify the source code a binary comes from. This makes detecting changes or tampering straightforward.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Compile the program on at least two different systems&lt;/li&gt;
&lt;li&gt;Compare the checksums.&lt;/li&gt;
&lt;li&gt;If they match, that’s good. If they don’t match, something is wrong.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The builds have more integrity, which benefits everyone. For security-minded people, it means a straightforward way of detecting backdoors in the build process. For open source enthusiasts, it means a clear way of detecting GPL violations. For everyone else, we get safer software.&lt;/p&gt;

&lt;p&gt;You can find out how to acheive reproducible builds at &lt;a href="https://reproducible-builds.org"&gt;reproducible-builds.org/docs&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Attacks on build systems
&lt;/h2&gt;

&lt;p&gt;Back-doors introduced in the build process are not easy to detect. Most of the detection happens too late when the damage is already done. The attacks can have a high impact in a short period, so early detection is important.&lt;/p&gt;

&lt;p&gt;There have been many attacks like this in the past. Some of them are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.crowdstrike.com/blog/sunspot-malware-technical-analysis/"&gt;SUNSPOT&lt;/a&gt;, An attack on SolarWinds that affected &lt;a href="https://businessinsider.com/tech-insider/heres-a-list-of-the-us-agencies-and-companies-that-were-reportedly-hacked-in-the/n58jz32"&gt;lots of important people&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://en.wikipedia.org/wiki/XcodeGhost"&gt;XcodeGhost&lt;/a&gt; - Attack on an IDE for Mac. Lots of iOS apps were affected. Including Angry Birds&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Defending against them
&lt;/h2&gt;

&lt;p&gt;Reproducible builds are the best way to defend against these kinds of attacks. Attackers lose their incentive bacause they are detected quickly and need to compromise more systems.&lt;/p&gt;

&lt;h2&gt;
  
  
  The disadvantages
&lt;/h2&gt;

&lt;p&gt;Like everything there are downsides. Some of them are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Need to use a specific compiler version&lt;/li&gt;
&lt;li&gt;No &lt;a href="https://en.wikipedia.org/wiki/Profile-guided_optimization"&gt;Profile-guided optimization&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What they don’t protect us from
&lt;/h2&gt;

&lt;p&gt;Reproducible builds don’t protect us from malicious developers. A developer could knowingly write vulnerable code that it looks like a mistake when discovered. This called underhanded code.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://en.wikipedia.org/wiki/Underhanded_C_Contest"&gt;Underhanded C Contest&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://underhandedcrypto.com/"&gt;Underhanded Crypto Contest&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the paper titled &lt;a href="https://www.cs.cmu.edu/~rdriley/487/papers/Thompson_1984_ReflectionsonTrustingTrust.pdf"&gt;Trusting Trust&lt;/a&gt; Ken Thompson asks us:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;To what extent should one trust a statement that a program is free of Trojan horses? Perhaps it is more important to trust the people who wrote the software.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Who does reproducible builds?
&lt;/h2&gt;

&lt;p&gt;Many open-source projects have reproducible builds to assure users of their integrity. Some of them include:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://daniel-lima.github.io/bitcoin-devenv/vagrant/how-to/deterministically-build-bitcoin-core.html"&gt;Bitcoin&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://blog.torproject.org/deterministic-builds-part-two-technical-details"&gt;Tor Browser&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://f-droid.org/docs/Reproducible_Builds/?title=Deterministic,_Reproducible_Builds"&gt;F-Droid&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://signal.org/blog/reproducible-android/."&gt;Signal&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://core.telegram.org/reproducible-builds"&gt;Telegram&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://reproducible-builds.org/projects/"&gt;&lt;em&gt;more&lt;/em&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Linux distros
&lt;/h3&gt;

&lt;p&gt;Around 80%-90% of the packages in Linux distributions like &lt;em&gt;( Arch, Debian, OpenSUSE, NixOS, Guix)&lt;/em&gt; are already reproducible. You can find the exact numbers &lt;a href="https://reproducible-builds.org/citests/"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Digital signatures
&lt;/h2&gt;

&lt;p&gt;Digital signatures still have their place. They are useful when verifying who a document or message comes from. However, they aren’t useful when verifying the source code a binary comes from. Some forms of digital signatures can get in the way, as explained by telegram developers in &lt;a href="https://core.telegram.org/reproducible-builds"&gt;this article&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;You can’t trust non-reproducible software. It’s a single point of failure. Mike Perry of the tor project &lt;a href="https://mailman.stanford.edu/pipermail/liberationtech/2013-June/009257.html#:~:text=nor%20do%20I%20believe"&gt;described it&lt;/a&gt; in 2013 as follows:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I don’t believe that software development models based on trusting a single party can be secure against serious adversaries anymore, given the current trends in computer security.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This statement is true to this day. &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MMIX1dsv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://memegenerator.net/img/instances/82411119/till-this-day.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MMIX1dsv--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://memegenerator.net/img/instances/82411119/till-this-day.jpg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Further reading
&lt;/h2&gt;

&lt;p&gt;Many people have written about reproducible builds and have gone into more detail than I have in this post. Here are some of them.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;a href="https://reproducible-builds.org"&gt;reproducible-builds.org&lt;/a&gt;
&lt;/h4&gt;

&lt;p&gt;A website with technical information on reproducible builds. It also has status updates on Linux distributions.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://www.win.tue.nl/~aeb/linux/hh/thompson/trust.html"&gt;Reflections on Trusting Trust&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;A paper by Ken Thompson. He asks us what if compilers had backdoors. Would it possible to even detect &amp;amp; prevent such an attack?&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://dwheeler.com/trusting-trust/"&gt;Countering Compiler backdoors&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;David A. Wheeler answers the above question. He proposes a method called Diverse Double-Compiling.&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;a href="https://securitylab.github.com/research/octopus-scanner-malware-open-source-supply-chain"&gt;The Octopus Scanner Malware&lt;/a&gt;
&lt;/h4&gt;

&lt;p&gt;Writeup on the discovery of a supply chain attack that targeted developer’s machines.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://lwn.net/Articles/555761/"&gt;Verifying the source code for binaries&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;An Lwn article on reproducible builds&lt;/p&gt;

</description>
      <category>security</category>
    </item>
    <item>
      <title>Building a Pentest lab with Docker</title>
      <dc:creator>Ian Muchina</dc:creator>
      <pubDate>Sat, 13 Jun 2020 11:30:00 +0000</pubDate>
      <link>https://forem.com/ianmuchina/building-a-pentest-lab-with-docker-1eei</link>
      <guid>https://forem.com/ianmuchina/building-a-pentest-lab-with-docker-1eei</guid>
      <description>&lt;h2&gt;
  
  
  What is Docker?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QXRXutVc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/docker-lab/docker.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QXRXutVc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/docker-lab/docker.svg" alt="Docker Logo"&gt;&lt;/a&gt;Docker is a container platform that is similar to a Hypervisor like Virtualbox. Containers use less storage and RAM and are portable.&lt;/p&gt;

&lt;p&gt;Docker can run on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Linux&lt;/li&gt;
&lt;li&gt;Windows&lt;/li&gt;
&lt;li&gt;Mac OS&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In this article I will go over how to set up a penetration testing lab entirely in docker&lt;/p&gt;

&lt;p&gt;It will consist of two types of containers.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Attacker Machine&lt;/li&gt;
&lt;li&gt;Target Machines&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Installation on Linux
&lt;/h2&gt;

&lt;p&gt;The Docker engine is in the official repositories of most Linux distributions.&lt;/p&gt;

&lt;h4&gt;
  
  
  Ubuntu/Debian
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EhX9gUHO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/docker-lab/ubuntu.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EhX9gUHO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/docker-lab/ubuntu.svg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Anything that uses &lt;code&gt;apt&lt;/code&gt; to install software is Debian based. Find a complete list &lt;a href="https://en.wikipedia.org/wiki/List_of_Linux_distributions#Debian-based"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To install on Ubuntu :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo apt install docker.io

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

&lt;/div&gt;



&lt;h4&gt;
  
  
  Fedora
&lt;/h4&gt;

&lt;p&gt;To install on fedora:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo dnf install docker

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

&lt;/div&gt;



&lt;p&gt;Start the Docker service&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo systemctl start docker

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

&lt;/div&gt;



&lt;h4&gt;
  
  
  Arch/Manjaro
&lt;/h4&gt;

&lt;p&gt;To install Arch based distros:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo pacman -Syu

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

&lt;/div&gt;



&lt;p&gt;Enable the loop kernel module&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo tee /etc/modules-load.d/loop.conf &amp;lt;&amp;lt;&amp;lt; "loop"
$ modprobe loop

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

&lt;/div&gt;



&lt;p&gt;Install Docker&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo pacman -S docker

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

&lt;/div&gt;



&lt;p&gt;Start and enable the service&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo systemctl start docker.service
$ sudo systemctl enable docker.service

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

&lt;/div&gt;






&lt;h2&gt;
  
  
  Docker on Windows
&lt;/h2&gt;

&lt;p&gt;To run docker in windows, install &lt;a href="https://docs.docker.com/docker-for-windows/install/"&gt;Docker desktop&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1JeW88Ud--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/docker-lab/windows10.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1JeW88Ud--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/docker-lab/windows10.svg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Docker Desktop is an awesome app with a graphical interface. It can run Linux containers from windows. However, there’s one major deal-breaker.&lt;/p&gt;

&lt;p&gt;Docker Desktop cannot co-exist with VirtualBox or VMware, because it requires Hyper-V to run Linux containers😤&lt;sup id="fnref:1"&gt;1&lt;/sup&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Hyper-V is Microsoft’s hardware virtualization product&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;As a workaround.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use &lt;a href="Use%20https://docs.docker.com/toolbox/"&gt;Docker Toolbox&lt;/a&gt; 👨‍💻&lt;/li&gt;
&lt;li&gt;Learn Hyper-V 📚&lt;/li&gt;
&lt;li&gt;Install Linux 🤷‍♀️&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;This is also the same reason &lt;a href="https://blogs.windows.com/windowsdeveloper/2016/07/22/fun-with-the-windows-subsystem-for-linux/"&gt;WSL&lt;/a&gt; cannot co-exist with VMware/Virtualbox.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now I’m starting to see why people hate Microsoft. They lock users to their ecosystem.&lt;/p&gt;




&lt;h2&gt;
  
  
  Hello World
&lt;/h2&gt;

&lt;p&gt;After you have installed docker, run this command as a test&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo docker run hello-world

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

&lt;/div&gt;



&lt;p&gt;If it completes successfully, you can follow along&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BKMlZR-0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/docker-lab/Server%2520status-pana.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BKMlZR-0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/docker-lab/Server%2520status-pana.svg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Network
&lt;/h2&gt;

&lt;p&gt;The network will be called &lt;code&gt;vulnerable&lt;/code&gt;. It will have a 10.0.0/24 subnet&lt;/p&gt;

&lt;p&gt;Create it with this command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo docker network create vulnerable --attachable --subnet 10.0.0.0/24

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Attacker Container
&lt;/h2&gt;

&lt;p&gt;For this, I will use Parrot OS. It’s docker images are better Kali Linux Images.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--sdha-bJU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/docker-lab/cyberr.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--sdha-bJU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/docker-lab/cyberr.svg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;First download the Parrot OS Docker image. This command will take a while depending on your internet connection.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ docker pull parrotsec/security:latest

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

&lt;/div&gt;



&lt;p&gt;Create and run the container .&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo docker run \
    --name parrot \
    -it \
    --hostname parrot \
    --network vulnerable \
    --ip="10.0.0.2" \
    --env DISPLAY=$DISPLAY \
    -v /dev/shm:/dev/shm \
    --device /dev/snd \
    --device /dev/dri \
    --mount type=bind,src=/tmp/.X11-unix,dst=/tmp/.X11-unix \
    parrotsec/security:latest \
    /bin/bash 

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

&lt;/div&gt;



&lt;p&gt;All tools available in Parrot OS are now an &lt;code&gt;apt-get&lt;/code&gt; away.&lt;/p&gt;

&lt;p&gt;Use this command to restart the parrot OS container after a reboot.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo docker start -a parrot

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Target container:Metasploitable2
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oMiIZRD7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/docker-lab/Target-pana.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oMiIZRD7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/docker-lab/Target-pana.svg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is a very vulnerable test machine. It is what I recommend for anyone starting out.&lt;/p&gt;

&lt;p&gt;Open another terminal and pull the metasploitable image. The image is around 500MB.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ docker pull tleemcjr/metasploitable2

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

&lt;/div&gt;



&lt;p&gt;To run a metasploitable container:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker run \
    -it \
    --network vulnerable \
    --ip="10.0.0.3" \
    --name metasploitable \
    --hostname metasploitable2 \
    tleemcjr/metasploitable2 \
    bash

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

&lt;/div&gt;



&lt;p&gt;You should see a terminal prompt like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;root@metasploitable2:/#

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

&lt;/div&gt;



&lt;p&gt;Start the vulnerable services&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;root@metasploitable2:/# services.sh

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

&lt;/div&gt;



&lt;p&gt;You can now access metasploitable from &lt;a href="http://10.0.0.3"&gt;10.0.0.3&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you want to stop the container, close the terminal with &lt;code&gt;CTRL + D&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Run this command to start metasploitable again&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo docker start -a parrot

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

&lt;/div&gt;



&lt;p&gt;Then start the vulnerable services.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;root@metasploitable2:/# services.sh

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

&lt;/div&gt;



&lt;h4&gt;
  
  
  Guides &amp;amp; Tutorials
&lt;/h4&gt;

&lt;p&gt;There are tons of free guides out there on metasploitable.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--W_t1VGVx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/docker-lab/read.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--W_t1VGVx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/docker-lab/read.svg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://www.exploit-db.com/docs/english/44040-the-easiest-metasploit-guide-you%E2%80%99ll-ever-read.pdf"&gt;The Easiest Metasploit Guide You’ll Ever Read&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.offensive-security.com/metasploit-unleashed/"&gt;Metasploit Unleashed&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://metasploit.help.rapid7.com/docs/metasploitable-2-exploitability-guide"&gt;Metasploitable 2 Exploitability Guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/results?search_query=metasploitable"&gt;Youtube Tutorials&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you don’t know what guide to use, I recommend &lt;a href="https://metasploit.help.rapid7.com/docs/metasploitable-2-exploitability-guide"&gt;this one&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  More vulnerable containers 🧑‍💻
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--h_ZiPm9e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/docker-lab/hacker.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--h_ZiPm9e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/docker-lab/hacker.svg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can extend the lab with any of these containers depending on your learning goal.&lt;/p&gt;

&lt;h3&gt;
  
  
  OWASP Juiceshop
&lt;/h3&gt;

&lt;p&gt;This container focusses on web application security.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9DbAi0pU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/docker-lab/juiceshop.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9DbAi0pU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/docker-lab/juiceshop.svg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To create and start the juiceshop container for the first time&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker run -d \
    --name juiceshop \
    --network vulnerable \
    --ip="10.0.0.6" \
    bkimminich/juice-shop

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

&lt;/div&gt;



&lt;p&gt;Check if it is running&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ docker ps 

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

&lt;/div&gt;



&lt;p&gt;Access the web interface from this URL&lt;/p&gt;

&lt;p&gt;&lt;a href="http://10.0.0.6:3000/"&gt;http://10.0.0.6:3000/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Stop the container when you’re done&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker stop juiceshop

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

&lt;/div&gt;



&lt;p&gt;Start the container again&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker start juiceshop

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

&lt;/div&gt;



&lt;h5&gt;
  
  
  Juiceshop Guides
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://pwning.owasp-juice.shop/"&gt;Pwning Juiceshop&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/results?search_query=owasp+juiceshop"&gt;Youtube Videos&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  OWASP Webgoat 🐐
&lt;/h4&gt;

&lt;p&gt;&lt;a href="(https://owasp.org/www-project-webgoat/)"&gt;Webgoat&lt;/a&gt; is a ctf-style vulnerable container focused on web application security.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gW3TfeGj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/docker-lab/goat.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gW3TfeGj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/docker-lab/goat.svg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Create and run the container for the first time&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker run -d \
    --name webgoat \
    --network vulnerable \
    --ip="10.0.0.4" \
    -e TZ=$(cat /etc/timezone) \
    webgoat/goatandwolf

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

&lt;/div&gt;



&lt;p&gt;Access Webgoat and Webwolf from these URLs&lt;/p&gt;

&lt;p&gt;&lt;a href="http://10.0.0.4:8080/WebGoat"&gt;10.0.0.4:8080/WebGoat&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://10.0.0.4:9090/WebWolf"&gt;10.0.0.4:9090/WebWolf&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To stop the container&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker stop webgoat

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

&lt;/div&gt;



&lt;p&gt;To Start the container again.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker start webgoat

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

&lt;/div&gt;



&lt;p&gt;If you can’t access the url, check if it is running.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ docker ps -a

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  Why I use docker for a pentest lab
&lt;/h3&gt;

&lt;p&gt;Two Operating systems make my computer painfully slow. Containers aren’t resource-intensive and perform well. This fits my use case.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0Zp8X1LF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/docker-lab/lab.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0Zp8X1LF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/docker-lab/lab.svg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you have RAM to spare then it’s really not that much of a difference.&lt;/p&gt;

&lt;h2&gt;
  
  
  When not to use Docker
&lt;/h2&gt;

&lt;p&gt;If you want to run Windows containers on a Linux host. You can run linux containers on WIndows though&lt;/p&gt;

&lt;h3&gt;
  
  
  Common Docker Commands
&lt;/h3&gt;

&lt;p&gt;Stop a container:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo docker stop containerName

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

&lt;/div&gt;



&lt;p&gt;Start a container&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo docker start containerName 

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

&lt;/div&gt;



&lt;p&gt;List running and stopped containers&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo docker ps -a

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

&lt;/div&gt;



&lt;p&gt;Spawn a bash shell in a running container&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo docker exec -it containerName bash

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

&lt;/div&gt;



&lt;p&gt;Docker has tab completion for each of these commands.&lt;/p&gt;

&lt;h3&gt;
  
  
  Graphical apps inside docker
&lt;/h3&gt;

&lt;p&gt;Sometimes you may want to run a GUI tool like firefox or burpsuite.&lt;/p&gt;

&lt;p&gt;The Parrot OS commands above are already set for running graphical apps. You only need to install these packages&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ apt install hicolor-icon-theme \
    libcanberra-gtk* libgl1-mesa-dri \
    libgl1-mesa-glx libpangox-1.0-0 \
    libpulse0 libv4l-0 fonts-symbola \ 

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

&lt;/div&gt;



&lt;p&gt;You can run a few commands to avoid some errors encountered when running GUI apps&lt;/p&gt;

&lt;h4&gt;
  
  
  Burpsuite
&lt;/h4&gt;

&lt;p&gt;Burp Suite is a web app pentesting tool for monitoring http requests and responses.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MyIiYZaL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/docker-lab/burp.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MyIiYZaL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/docker-lab/burp.svg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To install and run burpsuite inside the parrot os container.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# sudo apt update
# sudo apt install burpsuite
# java -jar -Xmx2G /usr/bin/burpsuite

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

&lt;/div&gt;



&lt;p&gt;You can then point your browser to use &lt;code&gt;10.0.0.2:8080&lt;/code&gt; as the proxy and burp will intercept everything&lt;/p&gt;

&lt;h4&gt;
  
  
  Firefox
&lt;/h4&gt;

&lt;p&gt;Firefox, is a free and open-source web browser.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SNCcrplI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/docker-lab/firefox.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SNCcrplI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/docker-lab/firefox.svg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To install and run firefox:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ apt install firefox ca-certificates 

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Credits
&lt;/h2&gt;

&lt;p&gt;Illustrations from &lt;a href="https://stories.freepik.com/"&gt;Freepik&lt;/a&gt; &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UxNZcCT---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/freepik.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UxNZcCT---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/freepik.svg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Further reading/research
&lt;/h3&gt;

&lt;p&gt;Jess Frazelle has written an awesome &lt;a href="https://blog.jessfraz.com/post/docker-containers-on-the-desktop/"&gt;blog post&lt;/a&gt; with details on running graphical apps inside Docker containers. She’s also given this awesome &lt;a href="https://youtu.be/cYsVvV1aVss"&gt;Talk/Demo&lt;/a&gt; on running various applications and retro games inside docker containers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Footnotes
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Docker requires a Linux kernel to run Linux containers on Windows. Docker accomplishes this by running a Linux Virtual Machine inside Hyper-V. This is still more resource-efficient than full VM’s. Plus there’s the added benefit of running both Windows and Linux containers. This is not possible on Linux ↩&lt;/p&gt;

</description>
      <category>docker</category>
      <category>infosec</category>
    </item>
    <item>
      <title>Automating updates on Debian</title>
      <dc:creator>Ian Muchina</dc:creator>
      <pubDate>Sun, 31 May 2020 08:30:00 +0000</pubDate>
      <link>https://forem.com/ianmuchina/automating-updates-on-debian-4eka</link>
      <guid>https://forem.com/ianmuchina/automating-updates-on-debian-4eka</guid>
      <description>&lt;p&gt;Debian is a good operating system. Forming the basis for Ubuntu, Kali Linux and many others it is one of the most stable operating systems out there.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wGuUHHM3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/deb-updates/debian.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wGuUHHM3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/deb-updates/debian.png" alt="Image of the Debian Logo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this post, I will go over how to configure automatic security updates on Debian, which are not enabled by default.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Debian uses the &lt;code&gt;apt&lt;/code&gt; package manager. A system update is done with the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ apt update
$ apt upgrade

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  The importance of security updates
&lt;/h2&gt;

&lt;p&gt;Security updates contain fixes for security vulnerabilities. They are an overlooked protection measure against many attacks.&lt;/p&gt;

&lt;p&gt;In 2017 there was a ransomware attack named &lt;a href="https://www.kaspersky.com/resource-center/threats/ransomware-wannacry"&gt;Wannacry&lt;/a&gt;. All the infected computers had one thing in common. They weren’t updated.&lt;/p&gt;

&lt;p&gt;Updating a system regularly can prevent lots of attacks.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aHpkayzg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/deb-updates/hacker.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aHpkayzg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/deb-updates/hacker.webp" alt="Ilustration of a Hacker"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Automate?
&lt;/h2&gt;

&lt;p&gt;Performing manual updates is repetitive and can be a huge burden to system administrators.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setting up automatic updates
&lt;/h2&gt;

&lt;p&gt;First update the package list.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ apt update

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

&lt;/div&gt;



&lt;p&gt;Install these 2 packages&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ apt install unattended-upgrades apt-listchanges

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

&lt;/div&gt;



&lt;p&gt;Perform a quick configuration&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo dpkg-reconfigure -plow unattended-upgrades

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

&lt;/div&gt;



&lt;p&gt;At this point, automatic upgrades have been configured and will run every 24 hours.&lt;/p&gt;

&lt;h2&gt;
  
  
  Automatic reboots
&lt;/h2&gt;

&lt;p&gt;The next thing is to set up automatic reboots. Some updates such as those to the Linux kernel require a reboot.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;With a text editor open the &lt;code&gt;unattended-upgrades&lt;/code&gt; configuration file.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ vim /etc/apt/apt.conf.d/50unattended-upgrades

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Uncomment the line with &lt;code&gt;Automatic-Reboot&lt;/code&gt; and set it to True.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Unattended-Upgrade::Automatic-Reboot "true";

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;This step is not neccesary but makes updates predictable.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Unattended-Upgrade::Automatic-Reboot-Time "23:00";

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

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Commented lines are those that start with two slashes &lt;code&gt;//&lt;/code&gt; , remove the slashes to uncomment the lines.&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// This line is commented
This line is not commented

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Live Patching
&lt;/h2&gt;

&lt;p&gt;If server uptime is important to you, a good solution is &lt;a href="https://ubuntu.com/livepatch"&gt;Livepatch&lt;/a&gt; by Cannonical, the company behind Ubuntu. It is free for up to 3 devices.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Livepatch&lt;/strong&gt; allows you to install some critical kernel security updates without rebooting your system, by directly patching the running kernel. … It’s mainly intended for servers which are supposed to have months and years of continuous uptime without reboots&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can read more on kernel live patching &lt;a href="https://mkyong.com/linux/an-introduction-to-kernel-live-patching-on-linux/"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Alerts on update failure
&lt;/h2&gt;

&lt;p&gt;Debian is a very stable OS, however, updates can fail when using software that is not in the official repos. When that happens you will want to receive an alert.&lt;/p&gt;

&lt;p&gt;I will be setting up email alerts in case of update failure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Configuring &lt;code&gt;unattended-upgrades&lt;/code&gt; to send email
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;With a text editor modify the following lines in the &lt;code&gt;unattended-upgrades&lt;/code&gt;configuration file
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ vim /etc/apt/apt.conf.d/50unattended-upgrades

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Uncomment and modify these lines.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Unattended-Upgrade::Mail "your@email.address";
Unattended-Upgrade::MailOnlyOnError "true";

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Setting up postfix to send email
&lt;/h2&gt;

&lt;p&gt;To send the email alerts you need a working email setup. For this, I will be using postfix to send email from a Gmail account&lt;/p&gt;

&lt;h3&gt;
  
  
  Create an app password
&lt;/h3&gt;

&lt;p&gt;If you use Gmail, a good way to control access is by using app passwords. I use this method because I can revoke app passwords in case of compromise.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;An App Password is a 16-digit passcode that gives a non-Google app or device permission to access your Google Account&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ol&gt;
&lt;li&gt;To create an app password, go to the Google account &lt;a href="https://myaccount.google.com/security"&gt;security page&lt;/a&gt; while signed in.&lt;/li&gt;
&lt;li&gt;Under &lt;em&gt;Signing into Google&lt;/em&gt; , Select App Passwords&lt;/li&gt;
&lt;li&gt;Generate a custom App password, name it to something relevant like &lt;em&gt;server-x email alerts&lt;/em&gt; and copy it. We’ll need it later.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6JSsEP9o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/deb-updates/app-passwords.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6JSsEP9o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/deb-updates/app-passwords.webp" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Install and Configure Postfix
&lt;/h3&gt;

&lt;p&gt;The next thing is to install Postfix and other required packages. They are required to send emails using the app passwords we just created.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install &lt;code&gt;postfix&lt;/code&gt;, &lt;code&gt;libsasl&lt;/code&gt; and &lt;code&gt;bsd-mailx&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ apt install postfix libsasl2-modules bsd-mailx

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

&lt;/div&gt;



&lt;p&gt;When prompted, select Internet site.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_gpngjUj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/deb-updates/postfix.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_gpngjUj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/deb-updates/postfix.webp" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Configure postfix
&lt;/h3&gt;

&lt;p&gt;The first step is to configure postfix. Follow these steps.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the postfix configuration file.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ vim /etc/postfix/main.cf

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Find the line with &lt;code&gt;relayhost&lt;/code&gt; and add this.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;relayhost = [smtp.gmail.com]:587

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

&lt;/div&gt;



&lt;h4&gt;
  
  
  Set up TLS
&lt;/h4&gt;

&lt;p&gt;The next step is to configure TLS. It stands for Transport Layer Security This ensures the email contents and credentials are encrypted in transit.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the postfix configuration file.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ vim /etc/postfix/main.cf

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Append the following lines to the end of the file
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Enable SASL authentication
smtp_sasl_auth_enable = yes
# Disallow methods that allow anonymous authentication
smtp_sasl_security_options = noanonymous
# Location of sasl_passwd
smtp_sasl_password_maps = hash:/etc/postfix/sasl/sasl_passwd
# Enable STARTTLS encryption
smtp_tls_security_level = encrypt
# Location of CA certificates
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt

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

&lt;/div&gt;



&lt;h4&gt;
  
  
  Set up the credentials
&lt;/h4&gt;

&lt;p&gt;The next step is to configure postfix to use the Gmail app passwords we have created.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open &lt;code&gt;/etc/postfix/sasl/sasl_passwd&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ vim /etc/postfix/sasl/sasl_passwd

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Add the following contents
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[smtp.gmail.com]:587 yourusername@gmail.com:password

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Generate the password database
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ postmap /etc/postfix/sasl/sasl_passwd

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

&lt;/div&gt;



&lt;h4&gt;
  
  
  Secure the credentials
&lt;/h4&gt;

&lt;p&gt;By default, the files containing the email credentials are readable by everyone. We can change this.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Modify the permissions so that the root user owns them with &lt;code&gt;chown&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo chown root:root /etc/postfix/sasl/sasl_passwd /etc/postfix/sasl/sasl_passwd.db

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;With &lt;code&gt;chmod&lt;/code&gt;, change the permissions so that only root can the file.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo chmod 0600 /etc/postfix/sasl/sasl_passwd /etc/postfix/sasl/sasl_passwd.db

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

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Restart Postfix
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ systemctl restart postfix

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

&lt;/div&gt;



&lt;h4&gt;
  
  
  Test the email setup
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Send yourself a test email from the terminal
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ echo "Test completed" | mail -s “Test From server” your_email@gmail.com

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

&lt;/div&gt;



&lt;p&gt;If the email is received, then congratulations. The email setup is comlete. You now have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Automatic daily updates&lt;/li&gt;
&lt;li&gt;Automatic reboots&lt;/li&gt;
&lt;li&gt;A feedback system incase updates fail&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Image Credits
&lt;/h2&gt;

&lt;p&gt;Illustrations from &lt;a href="https://stories.freepik.com"&gt;Stories by Freepik&lt;/a&gt;&lt;/p&gt;

</description>
      <category>sysadmin</category>
    </item>
    <item>
      <title>Why SSH certificates are awesome</title>
      <dc:creator>Ian Muchina</dc:creator>
      <pubDate>Fri, 15 May 2020 08:30:00 +0000</pubDate>
      <link>https://forem.com/ianmuchina/why-ssh-certificates-are-awesome-71h</link>
      <guid>https://forem.com/ianmuchina/why-ssh-certificates-are-awesome-71h</guid>
      <description>&lt;p&gt;Big Tech companies such as Facebook, Google, Netflix, Uber with thousands of users and servers use SSH Certificates to manage access. This post will go over why that’s the case&lt;/p&gt;

&lt;h2&gt;
  
  
  What is SSH?
&lt;/h2&gt;

&lt;p&gt;SSH is a protocol used by system administrators and developers to communicate securely with a server. Authentication can be done with SSH keys or passwords.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZKi9370l--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/ssh_certs/ZsMtNKh.png.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZKi9370l--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/ssh_certs/ZsMtNKh.png.webp" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Passwords and why they’re not recommended
&lt;/h2&gt;

&lt;p&gt;We all know passwords and have used them at some point. Those secret string of characters you have to remember to prove your identity.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Z1F2vZi7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/ssh_certs/2fYbsnl.png.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Z1F2vZi7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/ssh_certs/2fYbsnl.png.webp" alt="How many times have you forgotten your password?"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Passwords are good and better than nothing, but securing a server with just a password is not recommended especially on critical systems.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Weak passwords can be brute-forced&lt;/li&gt;
&lt;li&gt;Sometimes passwords have to be shared for group accounts.&lt;/li&gt;
&lt;li&gt;Only one compromised server is enough to phish all user credentials.&lt;/li&gt;
&lt;li&gt;Revocation of compromised user passwords is not easy or convenient&lt;/li&gt;
&lt;li&gt;Without a second factor, they are a single point of failure&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can improve the security by using tools like fail2ban to block IP addresses that have multiple failed login attempts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why use keys?
&lt;/h2&gt;

&lt;p&gt;Keys are the default authentication method on most cloud providers eg: Digital Ocean. There is a good reason for this. Keys are more secure than passwords&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;SSH keys are a matching set of cryptographic keys which can be used for authentication.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3IRUOHNO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/ssh_certs/jC5HqKn.png.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3IRUOHNO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/ssh_certs/jC5HqKn.png.webp" alt="Keys are awesome"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Each set contains a public and a private key. The public key can be shared freely without concern, while the private key must be vigilantly guarded and never exposed to anyone. source&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Why SSH Keys are more secure
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;One user account can have multiple keys. This makes auditing easier&lt;/li&gt;
&lt;li&gt;Keys can be password protected. Note the password is just for unlocking the key and never sent to the server&lt;/li&gt;
&lt;li&gt;Keys can be combined with passwords&lt;/li&gt;
&lt;li&gt;Keys can be revoked&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Keys are created with the &lt;code&gt;ssh-keygen&lt;/code&gt; command.&lt;/p&gt;

&lt;p&gt;When creating keys, it is a good idea to encrypt them with a password. So that even if the key is leaked, the password will add another layer of security.&lt;/p&gt;

&lt;h2&gt;
  
  
  Managing SSH keys
&lt;/h2&gt;

&lt;p&gt;To connect to a server using keys, a user’s public key has to be in the authorized_keys file on every server they want to connect to.&lt;/p&gt;

&lt;p&gt;This method of managing keys is the most common and works okay for small teams but it can be a burden for large organizations with many users. &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--twCC5MMX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/ssh_certs/RHoK5W9.png.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--twCC5MMX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/ssh_certs/RHoK5W9.png.webp" alt="Managing keys is a pain"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;But growth creeps upon you, and before you know it you are securing significant assets with sub-standard methods&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Key management issues&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;code&gt;authorized_keys file&lt;/code&gt; on all servers has to be maintained regularly&lt;/li&gt;
&lt;li&gt;Issuing a new key is a long process&lt;/li&gt;
&lt;li&gt;Losing a key locks you out&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The task of updating the &lt;code&gt;authorized_keys&lt;/code&gt; file can and should be automated for large companies. This method “works” but there is a much better alternative&lt;/p&gt;

&lt;h2&gt;
  
  
  SSH Certificates
&lt;/h2&gt;

&lt;p&gt;This is where public keys are signed by a Certificate Authority(CA). This method scales very well across thousands of machines. It can be used for both user and host verification. This method eliminates the Trust on first use requirement. &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cMKrB3Kt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/ssh_certs/KnaoAHm.png.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cMKrB3Kt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/ssh_certs/KnaoAHm.png.webp" alt="Certificates are never talked about that much"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Advantages of certificates
&lt;/h3&gt;

&lt;p&gt;SSH certificates are underrated and awesome in my opinion. They have some good features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Server configuration is done only once&lt;/li&gt;
&lt;li&gt;Updating the &lt;code&gt;authorized_keys&lt;/code&gt; file on every server is not needed.&lt;/li&gt;
&lt;li&gt;Audits are easier since every key is unique&lt;/li&gt;
&lt;li&gt;Works perfectly for giving users access to offline/air-gapped servers&lt;/li&gt;
&lt;li&gt;Keys can expire&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Available Metadata
&lt;/h2&gt;

&lt;p&gt;The signed key can contain the following useful information&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Key Expiry date &amp;amp; time
&lt;/h3&gt;

&lt;p&gt;This is how long a key is valid. The value can range from minutes to years. Netflix set their certificates to expire after two minutes. That’s enough time for a developer to login into a server and start an ssh session. Note that the session does not terminate when a certificate expires, only when a user logs out&lt;/p&gt;

&lt;h4&gt;
  
  
  2. Principals
&lt;/h4&gt;

&lt;p&gt;Principals control which user accounts and hosts a user has access to. For example, there can be a &lt;code&gt;root_staging&lt;/code&gt; principal which allows users to login as root on a staging server&lt;/p&gt;

&lt;p&gt;You can Parse this data offline with &lt;code&gt;ssh-keygen -Lf /Path/To/Signed_Cert&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You can also use &lt;a href="https://gravitational.com/resources/ssh-certificate-parser/"&gt;this site&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Open Source Implementations
&lt;/h2&gt;

&lt;p&gt;There are many solutions to giving users SSH access. All these are available on GitHub. Note that documentation is not that good for some tools though &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SLudGlwz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/ssh_certs/uphOO5p.png.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SLudGlwz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/ssh_certs/uphOO5p.png.webp" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  1. &lt;a href="https://keybase.io/blog/keybase-ssh-ca"&gt;Keybase Certificate Authority bot&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;This is a keybase chatbot that signs public keys. it is cli based. The bot doesn’t need any ports open.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Used internaly @ Keybase&lt;/li&gt;
&lt;li&gt;Only supports keybase Authentication&lt;/li&gt;
&lt;li&gt;Good &lt;a href="https://keybase-ssh-ca-bot.readthedocs.io/en/latest/"&gt;Documentation&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://keybase.io/blog/keybase-ssh-ca"&gt;Blog post&lt;/a&gt; on keybase SSH&lt;/p&gt;

&lt;h4&gt;
  
  
  2. &lt;a href="https://github.com/nsheridan/cashier"&gt;Cashier&lt;/a&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Controlled via a web interface&lt;/li&gt;
&lt;li&gt;Integrates well with LDAP or Active Directory&lt;/li&gt;
&lt;li&gt;Google, Github or Gitlab login available&lt;/li&gt;
&lt;li&gt;Key revocation page&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://youtu.be/NCEQj27A3XA"&gt;Video&lt;/a&gt; on The Tool&lt;/p&gt;

&lt;h4&gt;
  
  
  3. &lt;a href="https://github.com/Netflix/bless"&gt;BLESS - By Netflix&lt;/a&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Used internally @ Netflix,&lt;/li&gt;
&lt;li&gt;Runs on AWS Lambda&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://youtu.be/JwLGsWYVjqU"&gt;Video&lt;/a&gt; on the tool&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  4. &lt;a href="https://github.com/stoggi/sshrimp"&gt;SSHrimp - by Stoggi&lt;/a&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Runs on AWS Lambda&lt;/li&gt;
&lt;li&gt;Authenticate with OpenID connect&lt;/li&gt;
&lt;li&gt;Still in Beta&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  5. &lt;a href="https://github.com/Cloud-Foundations/keymaster"&gt;Keymaster - Symantec&lt;/a&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Supportts Oauth2 login&lt;/li&gt;
&lt;li&gt;Integrates well with LDAP/Active Directory&lt;/li&gt;
&lt;li&gt;Made by Symantec&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Cloud-Foundations/keymaster/blob/master/docs/Keymaster-DesignDoc.md"&gt;Documentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;More Tools&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/smallstep/certificates"&gt;Smallstep CA&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/uber/pam-ussh"&gt;Uber’s PAM module&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Video Resources
&lt;/h3&gt;

&lt;p&gt;For those that prefer videos to blog posts&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=GSIDS_lvRv4"&gt;Public key Cryptography Explained&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=vsXMMT2CqqE"&gt;The Key Exchange Problem&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/playlist?list=PLYiD9Y1aw76Y0NlUeFDl_YWfkZmdRcYpj"&gt;Conference Talks on SSH Certificates&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Further Reading
&lt;/h2&gt;

&lt;p&gt;I’m not the first one to write about this topic, so here’s related content covering it&lt;/p&gt;

&lt;h3&gt;
  
  
  Blog Posts
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://engineering.fb.com/production-engineering/scalable-and-secure-access-with-ssh/"&gt;How SSH is secured At Facebook&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/@dmuth/ssh-at-scale-cas-and-principals-b27edca3a5d"&gt;SSH at scale - CAs and Principals&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gravitational.com/blog/how-to-ssh-properly/"&gt;How to SSH Properly&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://smallstep.com/blog/use-ssh-certificates/"&gt;If you’re not using SSH certificates you’re doing SSH wrong&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--P01XgA8a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://assets/img/posts/ssh_certs/YqKOBwg.png.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--P01XgA8a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://assets/img/posts/ssh_certs/YqKOBwg.png.webp" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Whitepapers and Manuals
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/openssh-sssd"&gt;Redhat Deployment Guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://nvlpubs.nist.gov/nistpubs/ir/2015/NIST.IR.7966.pdf"&gt;NIST whitepaper on SSH automation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://tools.ietf.org/html/draft-ylonen-sshkeybcp-01"&gt;IETF Memo on recomended practice&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://blog.habets.se/2011/07/OpenSSH-certificates.html"&gt;ssh-keygen manual&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Image Credits
&lt;/h2&gt;

&lt;p&gt;Illustrations from &lt;a href="https://stories.freepik.com"&gt;Stories by Freepik&lt;/a&gt;&lt;/p&gt;

</description>
      <category>sysadmin</category>
    </item>
    <item>
      <title>Isolating vocals from songs using Spleeter</title>
      <dc:creator>Ian Muchina</dc:creator>
      <pubDate>Sun, 08 Mar 2020 07:00:00 +0000</pubDate>
      <link>https://forem.com/ianmuchina/isolating-vocals-from-songs-using-spleeter-p0l</link>
      <guid>https://forem.com/ianmuchina/isolating-vocals-from-songs-using-spleeter-p0l</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DfzxFobb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/MESGoeT.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DfzxFobb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/MESGoeT.jpg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Isolating vocals from a song in the past has had a high barrier to entry. It is now an easy thing to do . In this article, I will go over the various methods.&lt;/p&gt;

&lt;h1&gt;
  
  
  1. The browser method
&lt;/h1&gt;

&lt;p&gt;This is done entirely online. Open a browser, go to a upload a song and get vocal and instrumental stems. This is a simple method which relies on third party websites to process the music.&lt;/p&gt;

&lt;h3&gt;
  
  
  Steps
&lt;/h3&gt;

&lt;p&gt;The only requirement is a browser.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to &lt;a href="https://moises.ai/"&gt;moises.ai&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Create an account&lt;/li&gt;
&lt;li&gt;Upload a song&lt;/li&gt;
&lt;li&gt;Wait for the isolation to be done&lt;/li&gt;
&lt;li&gt;Enjoy !!&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Demo
&lt;/h3&gt;

&lt;p&gt;Here’s a sample of the results:&lt;/p&gt;

&lt;p&gt;.embed-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; } .embed-container iframe, .embed-container object, .embed-container embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }&lt;/p&gt;

&lt;h5&gt;
  
  
  Advantages]
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;Can be done from any device with a browser even a mobile phone&lt;/li&gt;
&lt;li&gt;Requires no special knowledge&lt;/li&gt;
&lt;li&gt;Easy user interface 
##### Disadvantages&lt;/li&gt;
&lt;li&gt;Only 5 uploads per month&lt;/li&gt;
&lt;li&gt;There’s a queue that may affect your waiting time&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can use &lt;a href="https://ezstems.com"&gt;ezstems.com&lt;/a&gt; as an alternative for more upload options and it works in a simmilar way.&lt;/p&gt;

&lt;h1&gt;
  
  
  2. The App Method
&lt;/h1&gt;

&lt;p&gt;This second method is simmilar to the first, but only uses the computer’s resources. &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--SPuy9h9a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/spleeter/uJrx7GI.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--SPuy9h9a--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/spleeter/uJrx7GI.jpg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Steps
&lt;/h4&gt;

&lt;p&gt;This method only works on windows&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Download and install the latest version of &lt;a href="https://www.python.org/downloads/"&gt;Python&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;During the installation make sure add to path checkbox is selected.&lt;/li&gt;
&lt;li&gt;Download &lt;a href="https://github.com/lazydevyo/SpleetGUI/releases"&gt;SpleetGUI&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Extract the zip file&lt;/li&gt;
&lt;li&gt;Install SpleetGUI&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;*I have no idea if it is safe to use&lt;/p&gt;

&lt;h1&gt;
  
  
  3. Command line Method
&lt;/h1&gt;

&lt;p&gt;This last is done entirely from the command line and is great for those familiar with.&lt;/p&gt;

&lt;h4&gt;
  
  
  Steps
&lt;/h4&gt;

&lt;p&gt;For this method, you will require git and &lt;a href="https://docs.conda.io/projects/conda/en/latest/user-guide/install/"&gt;conda&lt;/a&gt; already installed on your computer. Then type the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo apt install git


$ git clone https://github.com/Deezer/spleeter
$ conda install -c conda-forge spleeter

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

&lt;/div&gt;



&lt;p&gt;To run spleeter&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ python3 -m spleeter -i your_song.mp3 -p spleeter:2stems -o output

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  How Does it Work?
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--o3F6z5JO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/spleeter/machine-learning.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--o3F6z5JO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/spleeter/machine-learning.webp" alt="xkcd comic"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Machine learning is artificial intelligence that can automatically learn from past data. You give it enough data and it can literally learn like humans, through practice&lt;/p&gt;

&lt;p&gt;For more detailed information, check out the documentation &lt;a href="https://github.com/deezer/spleeter/wiki/2.-Getting-started"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;This is a great tool that can be used to get clean vocals from almost any song. It also works well to de-noise a track.&lt;/p&gt;

</description>
      <category>tools</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>Tracking documents with Canarytokens</title>
      <dc:creator>Ian Muchina</dc:creator>
      <pubDate>Sat, 15 Feb 2020 08:30:00 +0000</pubDate>
      <link>https://forem.com/ianmuchina/tracking-documents-with-canarytokens-4jk0</link>
      <guid>https://forem.com/ianmuchina/tracking-documents-with-canarytokens-4jk0</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;The ability to track Documents might come in handy in some situations. To do this we use Canarytokens. These are files and links that trigger email alerts anytime anyone accesses them.&lt;/p&gt;

&lt;p&gt;In this article, I will go over how to create and deploy these tokens.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GsaHexpx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/aSRi2X6.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GsaHexpx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.imgur.com/aSRi2X6.jpg" alt="Tracking Documents over the internet" title="Tracking Files "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Things You Will Need
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Email Address&lt;/li&gt;
&lt;li&gt;Target With An Internet Connection&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  1. Creating the file
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Go to &lt;a href="http://canarytokens.org"&gt;canarytokens.org&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Choose either a Word Document or an Adobe PDF token&lt;/li&gt;
&lt;li&gt;Enter an email address where alerts will be sent&lt;/li&gt;
&lt;li&gt;Choose an appropriate reminder eg: “Opened”&lt;/li&gt;
&lt;li&gt;Click on &lt;em&gt;“Create My Canary Token”&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Download the token&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BWL2F5c_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/canarytokens/uXAWKII.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BWL2F5c_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ianmuchina.com/assets/img/posts/canarytokens/uXAWKII.webp" alt="Creating a Token"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Setting up the file
&lt;/h3&gt;

&lt;p&gt;After Downloading the file you should:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Rename the file&lt;/li&gt;
&lt;li&gt;Edit the content of the file&lt;/li&gt;
&lt;li&gt;Send the file to someone&lt;/li&gt;
&lt;li&gt;Wait for an alert&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Receiving Alerts
&lt;/h3&gt;

&lt;p&gt;The alerts contain:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The IP address the file was opened from&lt;/li&gt;
&lt;li&gt;A Reminder if you wrote one&lt;/li&gt;
&lt;li&gt;The time and date when the file was opened&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If someone with internet access opens the document, you will be alerted. Usualy within seconds.&lt;/p&gt;

&lt;h2&gt;
  
  
  Further Reading
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://docs.canarytokens.org/guide/"&gt;Official Documentation&lt;/a&gt;&lt;/p&gt;

</description>
      <category>honeypots</category>
    </item>
  </channel>
</rss>
