Alien::Build::Manual::Security(3pm) | User Contributed Perl Documentation | Alien::Build::Manual::Security(3pm) |
Alien::Build::Manual::Security - General alien author documentation
version 2.80
perldoc Alien::Build::Manual::Security
You are rightly concerned that an Alien might be downloading something random off the internet. This manual will describe some of the real risks and go over how you can mitigate them.
Alien::Build provides Alien authors with tools to add external non-Perl dependencies to CPAN modules. It is open source software that is entirely volunteer driven, meaning the people writing this software are not getting compensated monetarily for the work. As such, we do our best not to intentionally introduce security vulnerabilities into our modules, or their dependencies. But it is also not our responsibility either. If you are operating in an environment where you need absolute security, you need to carefully audit all of the software that you use.
I suppose you could argue that Alien::Build based Aliens and Aliens in general are inherently less secure than the the Perl modules on CPAN that don't download random stuff off the internet. Worse yet, Aliens might be downloading from insecure sources like "http" or "ftp".
This argument falls apart pretty quickly when you realize that
The TL;DR is that if you are using a Perl module, whether it be "Foo::PP", "Foo::XS" or "Alien::libfoo" and you are concerned about security you need to audit all of your Perl modules, not just the Alien ones.
Okay, granted you need to audit software for security regardless of if it is Alien, you still don't like the idea of downloading external dependencies and you can't firewall just the CPAN module installs.
Alien::Build based Aliens respect a number of environment variables that at least give you some control over how aggresive Alien::Build will be at fetching random stuff off the internet.
Part of the design of the Alien::Build system is that it typically tries to download the latest version of a package instead of a fixed version, so that the Alien doesn't need to be updated when a new alienized package is released. This means that we frequently have to rely on TLS or bundled alienized packages to ensure that the alienized package is fetched securely.
Recently (as of Alien::Build 2.59) we started supporting cryptographic signatures defined in alienfiles, but they are not yet very common, and they only really work when a single alienized package URL is hard coded into the alienfile instead of the more typical mode of operation where the latest version is downloaded.
This is unfortunately currently the default mode of Alien::Build, for historical reasons. Once plugins and Aliens are updated to either use secure fetch (TLS or bundled alienized packages), or cryptographic signatures, the default will be changed to "digest_or_encrypt".
This will likely be the default for Alien::Build in the near future, but it doesn't hurt to set it now, if you don't mind submitting tickets to Aliens or plugins that don't support this mode yet.
This is similar to setting "ALIEN_INSTALL_TYPE" to "system" (see below), except it does allow Aliens that bundle their alienized package inside the CPAN package tarball.
Some Aliens will not install properly at first, but when they error you can install the system package and try to re-install the Alien.
Note that this is definitely best effort. If the Alien author makes a mistake or is malicious they could override these environment variables inside the "Makefile.PL", so you still need to audit any software to ensure that it doesn't fetch source off the internet.
There are a number of plugins that give the user or installer control over how Alien::Build behaves, and may be useful for rudimentary security.
You can configure the way Alien::Build based Aliens are installed with the local configuration file "~/.alienbuild/rc.pl". See Alien::Build::rc for details.
This whole document is caveats, but if you haven't gotten it by now then, fundamentally if you need to use Perl modules securely then you need to audit the code for security vulnerabilities. If you think that the security of Alien::Build and the Aliens that depend on it, then patches welcome.
Author: Graham Ollis <plicease@cpan.org>
Contributors:
Diab Jerius (DJERIUS)
Roy Storey (KIWIROY)
Ilya Pavlov
David Mertens (run4flat)
Mark Nunberg (mordy, mnunberg)
Christian Walde (Mithaldu)
Brian Wightman (MidLifeXis)
Zaki Mughal (zmughal)
mohawk (mohawk2, ETJ)
Vikas N Kumar (vikasnkumar)
Flavio Poletti (polettix)
Salvador Fandiño (salva)
Gianni Ceccarelli (dakkar)
Pavel Shaydo (zwon, trinitum)
Kang-min Liu (劉康民, gugod)
Nicholas Shipp (nshp)
Juan Julián Merelo Guervós (JJ)
Joel Berger (JBERGER)
Petr Písař (ppisar)
Lance Wicks (LANCEW)
Ahmad Fatoum (a3f, ATHREEF)
José Joaquín Atria (JJATRIA)
Duke Leto (LETO)
Shoichi Kaji (SKAJI)
Shawn Laffan (SLAFFAN)
Paul Evans (leonerd, PEVANS)
Håkon Hægland (hakonhagland, HAKONH)
nick nauwelaerts (INPHOBIA)
Florian Weimer
This software is copyright (c) 2011-2022 by Graham Ollis.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
2023-11-05 | perl v5.36.0 |