eyepopslikeamosquito has asked for the wisdom of the Perl Monks concerning the following question:
Reviewing my first attempt to build perl securely from source on Linux (as non-root) today, I felt happy enough with the first part namely:
$ cd $HOME $ mkdir localperl $ cd localperl $ wget https://www.cpan.org/src/5.0/perl-5.38.0.tar.gz $ sha256sum perl-5.38.0.tar.gz 213ef58089d2f2c972ea353517dc60ec3656f050dcc027666e118b508423e517 perl +-5.38.0.tar.gz # (eyeball this to verify it matches the value displayed at: # https://www.cpan.org/src/5.0/perl-5.38.0.tar.gz.sha256.txt) $ tar -xzf perl-5.38.0.tar.gz $ cd perl-5.38.0 $ ./Configure -des -Dprefix=$HOME/localperl $ make 2>&1 | tee make.tmp $ make test 2>&1 | tee test.tmp $ make install 2>&1 | tee install.tmp $ type perl perl is /usr/bin/perl $ export PATH=$HOME/localperl/bin:$PATH $ type perl perl is $HOME/localperl/bin/perl $ perl -v This is perl 5, version 38, subversion 0 (v5.38.0) built for x86_64-li +nux ...
At least that looks safe enough to me.
I was also happy enough with the last part, namely installing CPAN modules more securely via cpanm's --verify option, which verifies the integrity of distribution files retrieved from CPAN using CHECKSUMS file and SIGNATURES file (if found in the distribution).
Now here comes the bit I seek advice on, namely the best/most secure way to install cpanm itself. Please note that I have very limited knowledge of cpanm and how it works.
In my first attempt, I simply installed cpanm via the cpan command:
$ cpan App::cpanminus 2>&1 | tee inst-cpanminus.tmp
Wondering if there's a better/more secure way to install cpanm, I browsed the App::cpanminus doco today, which advises you to install it via:
curl -L https://cpanmin.us | perl - App::cpanminus
Now I don't understand exactly how that command works. Nor do I understand the security implications of installing it like this compared to my original installation of cpanm (and Module::Signature) via the cpan command. Hence this question.
General tips/advice on good ways to securely install Perl and CPAN modules from source as a non-root user welcome.
👁️🍾👍🦟
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Building Perl and CPAN Modules Securely from Source
by Corion (Patriarch) on Sep 02, 2024 at 06:40 UTC | |
|
Re: Building Perl and CPAN Modules Securely from Source
by parv (Parson) on Sep 02, 2024 at 07:28 UTC | |
by cavac (Prior) on Sep 04, 2024 at 12:28 UTC | |
by parv (Parson) on Sep 05, 2024 at 21:11 UTC | |
by etj (Priest) on Sep 06, 2024 at 12:59 UTC | |
by parv (Parson) on Sep 08, 2024 at 06:21 UTC | |
by eyepopslikeamosquito (Archbishop) on Sep 08, 2024 at 08:39 UTC | |
|
Re: Building Perl and CPAN Modules Securely from Source
by cavac (Prior) on Sep 04, 2024 at 13:55 UTC |