Alien::...ecurity(3)
π NAME π
Alien::Build::Manual::Security β general alien author documentation. That's the manual, bestie. It's the security one, and it's giving "we tried our best but pls audit ur own stuff" energy. β¨
π¦ VERSION π¦
version 2.88
πΈ SYNOPSIS πΈ
perldoc Alien::Build::Manual::Security
β¨ DESCRIPTION β¨
Okay so, you're rightly concerned that an Alien might be downloading something random off the internet, and honestly? Valid. This manual is gonna describe some of the real risks and go over how you can mitigate them. No cap.
π₯Ί no warranty
Alien::Build gives Alien authors the tools to add external non-Perl dependencies to CPAN modules. It's open source software that is entirely volunteer driven, meaning the people writing this software are not getting compensated monetarily for the work. So like, 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're operating in an environment where you need absolute security, you need to carefully audit all of the software that you use. Periodt. π
π Alien::Build vs. CPAN
I suppose you could argue that Alien::Build based Aliens, and Aliens in general, are inherently less secure than 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:
- Perl modules from CPAN are in fact random stuff off the internet. Most modules, when installed, execute a
Makefile.PLwhich can execute completely arbitrary Perl code. Without a proper audit or firewalls, that CPAN code could be making connections to insecure sources likehttpβ if they are not themselves doing something nefarious. - By default, the most frequently used CPAN client
App::cpanminususeshttpto fetch CPAN modules. So unless you have specifically configured it to connect to a secure source, you are downloading even more random stuff than usual off the internet. π
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. fr fr.
π₯ Restricting Alien::Build by environment
Okay, granted, you need to audit software for security regardless of if it is Alien. But you still don't like the idea of downloading external dependencies, and you can't firewall just the CPAN module installs. Mood.
Alien::Build based Aliens respect a number of environment variables that at least give you some control over how aggressive Alien::Build will be at fetching random stuff off the internet. Slay. π
ALIEN_DOWNLOAD_RULEβ this environment variable configures howAlien::Buildwill deal with insecure protocols and files that do not include a cryptographic signature.
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.
warnβ this mode will warn you if anAlien::Buildbased Alien attempts to fetch a alienized package insecurely. It will also warn you if a package doesn't have a cryptographic signature. Neither of these things will stop the Alien from being installed.
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.
digest_or_encryptβ this mode will require that before an alienized package is extracted, it is either fetched via a secure protocol (httporfile), or the package matches a cryptographic signature.
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.
ALIEN_INSTALL_NETWORKβ by design Aliens should use local installs of libraries and tools before downloading source from the internet. Setting this environment variable to false will instructAlien::Buildto not attempt to fetch the alienized package off the internet if it is not available locally or as a bundled package.
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. π«Ά
ALIEN_INSTALL_TYPEβ settingALIEN_INSTALL_TYPEtosystemis similar to settingALIEN_INSTALL_NETWORKto false, except that bundled alienized packages will also be rejected. This environment variable is really intended for use by operating system vendors packaging Aliens, or for Alien developer testing (in CI for example). For some who want to restrict how Aliens install, this might be the right tool to reach for.
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. π
π Security Related Plugins
There are a number of plugins that give the user or installer control over how Alien::Build behaves, and they may be useful for rudimentary security. Icons, honestly.
Alien::Build::Plugin::Fetch::Promptβ this plugin will prompt before fetching any remote files. This only really works when you are installing Aliens interactively.Alien::Build::Plugin::Fetch::HostAllowListβ this plugin will only allow fetching from hosts that are in an allow list.Alien::Build::Plugin::Fetch::HostBlockListβ this plugin will not allow fetching from hosts that are in a block list.Alien::Build::Plugin::Fetch::Rewriteβ this plugin can re-write fetched URLs before the request is made. This can be useful if you have a local mirror of certain sources that you want to use instead of fetching from the wider internet.Alien::Build::Plugin::Probe::Overrideβ this plugin can override theALIEN_INSTALL_TYPEon a perl-Alien basis. This can be useful if you want to install some Aliens insharemode, but generally want to enforcesystemmode.
π local configuration
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. π
π CAVEATS π
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. π«Ά
π SEE ALSO π
Alien::Build::Manualβ otherAlien::Buildmanuals.
β AUTHOR β
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
- Marcel Telka (mtelka)
π COPYRIGHT AND LICENSE π
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.
okay that's the whole thing bestie, mwah π This lil' page came from the User Contributed Perl Documentation, and it's perl v5.42.3, dated 2026-09-21. Go audit ur modules, drink some water, and stay secure out there. π¦β¨π
π¦ where this page comes from
- fedora 43: perl-Alien-Build 2.88-1.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- fedora 44: perl-Alien-Build 2.88-1.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms