|
| 1 | +<!doctype html> |
| 2 | +<html lang="en"> |
| 3 | + <head> |
| 4 | + <meta charset="utf-8" /> |
| 5 | + <title>Reining In Unruely Aliens</title> |
| 6 | + <script type="text/javascript" src="https://shjs.wdlabs.com/sh_main.min.js"></script> |
| 7 | + <script type="text/javascript" src="https://shjs.wdlabs.com/lang/sh_perl.min.js"></script> |
| 8 | + <link type="text/css" rel="stylesheet" href="https://shjs.wdlabs.com/css/sh_acid.css"> |
| 9 | + <link type="text/css" rel="stylesheet" href="https://hatch.wdlabs.com/css/default.css"> |
| 10 | + </head> |
| 11 | + <body onload="sh_highlightDocument();"> |
| 12 | + <div class="nx-header-flag-1"></div> |
| 13 | + <div class="nx-header-flag-2"></div> |
| 14 | + <div class="nx-header-title"><a href="/">🌻</a> <a href="/blog/">🪵</a> Reining In Unruely Aliens</div> |
| 15 | + <p>By <b>Graham Ollis</b> on 21 September 2022</p> |
| 16 | + |
| 17 | +<p>When I have talked to Perl developers about the Alien technique, some are |
| 18 | +rightly concerned about the security implications of downloading arbitrary |
| 19 | +stuff off the internet. My response to this has always to point out that |
| 20 | +if you are installing modules from CPAN then you are doing the same.</p> |
| 21 | + |
| 22 | +<p>In fact the default for one of the most popular cpan clients is to use an |
| 23 | +unencrypted http connection to fetch modules off the internet. The default |
| 24 | +for the Perl's in core HTTP client is to not verify server identity making |
| 25 | +man in the middle attackes much easier. There are historical reasons for |
| 26 | +these decisions, but overall I think these are examples of how Perl is |
| 27 | +increasingly out of step with the rest of the internet.</p> |
| 28 | + |
| 29 | +<p>The team responsible for <a href="/pod/Alien/Build.html" class="module">Alien::Build</a> and <a href="/pod/Alien/Base/ModuleBuild.html" class="module">Alien::Base::ModuleBuild</a> |
| 30 | +plan on making it easier for users to control the security model for |
| 31 | +downloading and installing alienized packages for <a href="/pod/Alien.html" class="module">Alien</a>s that use them. |
| 32 | +We also plan on changing the default model to err on the side of more |
| 33 | +secure. None of these changes is a substitue for properly auditing |
| 34 | +the open source code that you use, if your threat model dictates that. |
| 35 | +At the end of the day, although there are a few Perl modules that can |
| 36 | +be installed statically, the vast majoirty still rely on executing a |
| 37 | +<code>Makefile.PL' or</code>Build.PL` which is arbitrary Perl code.</p> |
| 38 | + |
| 39 | +<p>The TL;DR is that if you are an Alien author, or if you are the author |
| 40 | +of an <a href="/pod/Alien/Build/Plugin.html" class="module">Alien::Build plugin</a> you should check to |
| 41 | +see if your modules still work when <code>ALIEN_DOWNLOAD_RULE</code> is set to |
| 42 | +<code>digest_or_encrypt</code>, which will soon become the new default. This |
| 43 | +will require that alienized packages be either</p> |
| 44 | + |
| 45 | +<ul> |
| 46 | +<li>Downloaded using a secure protocol such as <code>https</code></li> |
| 47 | +<li>Checked with a cryptographic signature included in the <a href="/pod/alienfile.html" class="module">alienfile</a> (or <code>Build.PL</code> for <a href="/pod/Alien/Base/ModuleBuild.html" class="module">Alien::Base::ModuleBuild</a> based aliens)</li> |
| 48 | +<li>Bundled within the <a href="/pod/Alien.html" class="module">Alien</a> itself.</li> |
| 49 | +</ul> |
| 50 | + |
| 51 | +<p>For more details on the security implications please see |
| 52 | +<a href="https://metacpan.org/pod/Alien::Build::Manual::Secirty" class="module">Alien::Build::Manual::Secirty</a>.</p> |
| 53 | + |
| 54 | +<p>I have already gone through all of the plugins that I am aware of and |
| 55 | +fixed them. (Unfortunately even plugins that do not modify the |
| 56 | +fetch or download stages of L<Alien::Build> are potentially susceptible |
| 57 | +because their tests often need to fake the fetch and download steps |
| 58 | +and may do so in a way that seems unsafe to L<Alien::Build>). I will |
| 59 | +also go through all of the aliens that I have control over to make sure |
| 60 | +they work with this new default.</p> |
| 61 | + |
| 62 | +<p>None of this completely removes the peril of downloading arbitrary |
| 63 | +software off the internet, but it does improve the default security |
| 64 | +model, and gives the end user more control over the security model |
| 65 | +via the <code>ALIEN_DOWNLOAD_RULE</code> environment variable.</p> |
| 66 | + |
| 67 | + |
| 68 | + <div class="nx-footer"> |
| 69 | + <p> |
| 70 | + [ |
| 71 | + <a href="https://wdlabs.com">wdlabs.com</a> | |
| 72 | + <a href="https://alienfile.org">alienfile.org</a> | |
| 73 | + <a href="https://pl.atypus.org">pl.atypus.org</a> | |
| 74 | + <a href="https://perlwasm.github.io">perlwasm</a> | |
| 75 | + <a href="https://uperl.github.io">uperl</a> |
| 76 | + ] |
| 77 | + Copyright © 2022 Graham Ollis |
| 78 | + </p> |
| 79 | + </div> |
| 80 | + </body> |
| 81 | +</html> |
0 commit comments